Line

The Line source can be used to interactively or manually add a line to the 3D scene. The two end points of the line, the resolution of the line, and the visibility of the interaction widget can be changed used the property sheet. In addition, the two end points can be specified using the interaction widget. The line can be  translated, rotated, and scaled using the Actor control area of the Display tab for this source, and it can be interactively positioned using the Move operation of the camera.  The object created by this source is a vtkLineSource object, and the output of this source is vtkPolyData. An example of a line source is given on the right. Note that in this example the interaction widget is visible, and the lower left point of the line is being manipulated. Widget interaction is defined below.

 

 

The Line source has only one parameter:

 

Resolution: This value represents the number of line segments in line. By default this value is 1. As opposed to some other sources such as the sphere, cone, and cylinder, increasing the resolution does not increase the accuracy of the line, it simple increases the number of colinear line segments defining the line. This can sometimes be useful when using the data as input to a filter.

 

 

The Line source interaction widget has the following parameters which are displayed on the Line source property sheet:

 

Point1: These three values indicate the coordinates of one of the two end points of the line.

 

Point2: These three values indicate the other end point coordinate of the line.

 

Visibility: This check box can be used to toggle the visibility of the interaction widget. When the interaction widget is visible, you will see a thick line with two spheres at the end points. To see the actual line you must turn off the visibility of the interaction widget. By default the interaction widget is visible. This check box is tied to the interaction widget and not the source object, and therefore has an immediate effect (the Accept button does not need to be pressed).

 

 

The Line source interaction widget has the behavior described below. Changes made through the interaction widget must be accepted by pressing the Accept button on the property sheet before the change will be reflected in the output of the line source.

 

Left Mouse on End Point Ball: Clicking the left mouse button while the cursor is over one of the end point spheres, then dragging the mouse will cause that end point to translate.

 

Left Mouse on Line: Clicking the left mouse button while the cursor is over the line, then dragging the mouse will cause the line to translate.

 

Right Mouse on Line: Clicking the left mouse button while the cursor is over the line, then dragging the mouse will cause the line to increase or decrease in length. Upward mouse motion will cause an increase in length, downward motion will cause a decrease in length.