vtk
Class vtkLineWidget

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkInteractorObserver
              extended byvtk.vtk3DWidget
                  extended byvtk.vtkLineWidget
All Implemented Interfaces:
java.io.Serializable

public class vtkLineWidget
extends vtk3DWidget
implements java.io.Serializable

vtkLineWidget - 3D widget for manipulating a line. This 3D widget defines a line that can be interactively placed in a scene. The line has two handles (at its endpoints), plus the line can be picked to translate it in the scene. A nice feature of the object is that the vtkLineWidget, like any 3D widget, will work with the current interactor style and any other widgets present in the scene. That is, if vtkLineWidget does not handle an event, then all other registered observers (including the interactor style) have an opportunity to process the event. Otherwise, the vtkLineWidget will terminate the processing of the event that it handles. To use this object, just invoke SetInteractor() with the argument of the method a vtkRenderWindowInteractor. You may also wish to invoke "PlaceWidget()" to initially position the widget. The interactor will act normally until the "i" key (for "interactor") is pressed, at which point the vtkLineWidget will appear. (See superclass documentation for information about changing this behavior.) By grabbing one of the two end point handles (use the left mouse button), the line can be oriented and stretched (the other end point remains fixed). By grabbing the line itself, or using the middle mouse button, the entire line can be translated. Scaling (about the center of the line) is achieved by using the right mouse button. By moving the mouse "up" the render window the line will be made bigger; by moving "down" the render window the widget will be made smaller. Turn off the widget by pressing the "i" key again (or invoke the Off() method). (Note: picking the line or either one of the two end point handles causes a vtkPointWidget to appear. This widget has the ability to constrain motion to an axis by pressing the "shift" key while moving the mouse.) The vtkLineWidget has several methods that can be used in conjunction with other VTK objects. The Set/GetResolution() methods control the number of subdivisions of the line; the GetPolyData() method can be used to get the polygonal representation and can be used for things like seeding streamlines. Typical usage of the widget is to make use of the StartInteractionEvent, InteractionEvent, and EndInteractionEvent events. The InteractionEvent is called on mouse motion; the other two events are called on button down and button up (either left or right button). Some additional features of this class include the ability to control the properties of the widget. You can set the properties of the selected and unselected representations of the line. For example, you can set the property for the handles and line. In addition there are methods to constrain the line so that it is aligned along the x-y-z axes. JavaBean wrapper for vtkLineWidget object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
vtk3DWidget, vtkBoxWidget, Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkLineWidget()
           
protected vtkLineWidget(int dmy)
           
 
Method Summary
 void clampToBoundsOff()
          Enable/disable clamping of the point end points to the bounding box of the data.
 void clampToBoundsOn()
          Enable/disable clamping of the point end points to the bounding box of the data.
 int getAlign()
          Force the line widget to be aligned with one of the x-y-z axes.
 int getAlignMaxValue()
          Force the line widget to be aligned with one of the x-y-z axes.
 int getAlignMinValue()
          Force the line widget to be aligned with one of the x-y-z axes.
 int getClampToBounds()
          Enable/disable clamping of the point end points to the bounding box of the data.
 java.lang.String getClassName()
          Return the class name as a string.
 vtkProperty getHandleProperty()
          Get the handle properties (the little balls are the handles).
 vtkProperty getLineProperty()
          Get the line properties.
 double[] getPoint1()
          Set/Get the position of first end point.
 void getPoint1(double[] id0)
          Set position of other end point.
 double[] getPoint2()
          Set position of other end point.
 void getPoint2(double[] id0)
          Force the line widget to be aligned with one of the x-y-z axes.
 void getPolyData(vtkPolyData id0)
          Grab the polydata (including points) that defines the line.
 int getResolution()
          Set/Get the position of first end point.
 vtkProperty getSelectedHandleProperty()
          Get the handle properties (the little balls are the handles).
 vtkProperty getSelectedLineProperty()
          Get the line properties.
 vtkLineWidget getThisLineWidget()
           
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 void placeWidget()
          Methods that satisfy the superclass' API.
 void placeWidget(double[] id0)
          Methods that satisfy the superclass' API.
 void placeWidget(double id0, double id1, double id2, double id3, double id4, double id5)
          Set/Get the resolution (number of subdivisions) of the line.
 void setAlign(int id0)
          Force the line widget to be aligned with one of the x-y-z axes.
 void setAlignToNone()
          Enable/disable clamping of the point end points to the bounding box of the data.
 void setAlignToXAxis()
          Force the line widget to be aligned with one of the x-y-z axes.
 void setAlignToYAxis()
          Force the line widget to be aligned with one of the x-y-z axes.
 void setAlignToZAxis()
          Force the line widget to be aligned with one of the x-y-z axes.
 void setClampToBounds(int id0)
          Enable/disable clamping of the point end points to the bounding box of the data.
 void setEnabled(int id0)
          Methods that satisfy the superclass' API.
 void setPoint1(double[] id0)
          Set/Get the position of first end point.
 void setPoint1(double id0, double id1, double id2)
          Set/Get the position of first end point.
 void setPoint2(double[] id0)
          Set position of other end point.
 void setPoint2(double id0, double id1, double id2)
          Set position of other end point.
 void setResolution(int id0)
          Set/Get the resolution (number of subdivisions) of the line.
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtk3DWidget
getHandleSize, getHandleSizeMaxValue, getHandleSizeMinValue, getInput, getPlaceFactor, getPlaceFactorMaxValue, getPlaceFactorMinValue, getProp3D, getThis3DWidget, setHandleSize, setInput, setPlaceFactor, setProp3D
 
Methods inherited from class vtk.vtkInteractorObserver
enabledOff, enabledOn, getCurrentRenderer, getDefaultRenderer, getEnabled, getInteractor, getKeyPressActivation, getKeyPressActivationValue, getPriority, getPriorityMaxValue, getPriorityMinValue, getThisInteractorObserver, keyPressActivationOff, keyPressActivationOn, off, on, onChar, setCurrentRenderer, setDefaultRenderer, setInteractor, setKeyPressActivation, setKeyPressActivationValue, setPriority
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay, unRegister
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkLineWidget

public vtkLineWidget()

vtkLineWidget

protected vtkLineWidget(int dmy)
Method Detail

getThisLineWidget

public vtkLineWidget getThisLineWidget()

getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtk3DWidget

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
isA in class vtk3DWidget

setEnabled

public void setEnabled(int id0)
Methods that satisfy the superclass' API.

Overrides:
setEnabled in class vtkInteractorObserver

placeWidget

public void placeWidget(double[] id0)
Methods that satisfy the superclass' API.

Overrides:
placeWidget in class vtk3DWidget

placeWidget

public void placeWidget()
Methods that satisfy the superclass' API.

Overrides:
placeWidget in class vtk3DWidget

placeWidget

public void placeWidget(double id0,
                        double id1,
                        double id2,
                        double id3,
                        double id4,
                        double id5)
Set/Get the resolution (number of subdivisions) of the line.

Overrides:
placeWidget in class vtk3DWidget

setResolution

public void setResolution(int id0)
Set/Get the resolution (number of subdivisions) of the line.


getResolution

public int getResolution()
Set/Get the position of first end point.


setPoint1

public void setPoint1(double id0,
                      double id1,
                      double id2)
Set/Get the position of first end point.


setPoint1

public void setPoint1(double[] id0)
Set/Get the position of first end point.


getPoint1

public double[] getPoint1()
Set/Get the position of first end point.


getPoint1

public void getPoint1(double[] id0)
Set position of other end point.


setPoint2

public void setPoint2(double id0,
                      double id1,
                      double id2)
Set position of other end point.


setPoint2

public void setPoint2(double[] id0)
Set position of other end point.


getPoint2

public double[] getPoint2()
Set position of other end point.


getPoint2

public void getPoint2(double[] id0)
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


setAlign

public void setAlign(int id0)
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


getAlignMinValue

public int getAlignMinValue()
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


getAlignMaxValue

public int getAlignMaxValue()
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


getAlign

public int getAlign()
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


setAlignToXAxis

public void setAlignToXAxis()
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


setAlignToYAxis

public void setAlignToYAxis()
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


setAlignToZAxis

public void setAlignToZAxis()
Force the line widget to be aligned with one of the x-y-z axes. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the line to the axes if it is orginally not aligned.


setAlignToNone

public void setAlignToNone()
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.


setClampToBounds

public void setClampToBounds(int id0)
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.


getClampToBounds

public int getClampToBounds()
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.


clampToBoundsOn

public void clampToBoundsOn()
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.


clampToBoundsOff

public void clampToBoundsOff()
Enable/disable clamping of the point end points to the bounding box of the data. The bounding box is defined from the last PlaceWidget() invocation, and includes the effect of the PlaceFactor which is used to gram/shrink the bounding box.


getPolyData

public void getPolyData(vtkPolyData id0)
Grab the polydata (including points) that defines the line. The polydata consists of n+1 points, where n is the resolution of the line. These point values are guaranteed to be up-to-date when either the InteractionEvent or EndInteraction events are invoked. The user provides the vtkPolyData and the points and polyline are added to it.


getHandleProperty

public vtkProperty getHandleProperty()
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated.


getSelectedHandleProperty

public vtkProperty getSelectedHandleProperty()
Get the handle properties (the little balls are the handles). The properties of the handles when selected and normal can be manipulated.


getLineProperty

public vtkProperty getLineProperty()
Get the line properties. The properties of the line when selected and unselected can be manipulated.


getSelectedLineProperty

public vtkProperty getSelectedLineProperty()
Get the line properties. The properties of the line when selected and unselected can be manipulated.


VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtk3DWidget


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.