vtkContourWidget Class Reference

#include <vtkContourWidget.h>

Inheritance diagram for vtkContourWidget:

Inheritance graph
[legend]
Collaboration diagram for vtkContourWidget:

Collaboration graph
[legend]

List of all members.


Detailed Description

create a contour with a set of points

The vtkContourWidget is used to select a set of points, and draw lines between these points. The contour may be opened or closed, depending on how the last point is added. The widget handles all processing of widget events (that are triggered by VTK events). The vtkContourRepresentation is responsible for all placement of the points, calculation of the lines, and contour manipulation. This is done through two main helper classes: vtkPointPlacer and vtkContourLineInterpolator. The representation is also responsible for drawing the points and lines.

Event Bindings:
By default, the widget responds to the following VTK events (i.e., it watches the vtkRenderWindowInteractor for these events):
   LeftButtonPressEvent - triggers a Select event
   RightButtonPressEvent - triggers a AddFinalPoint event
   MouseMoveEvent - triggers a Move event
   LeftButtonReleaseEvent - triggers an EndSelect event
   Delete key event - triggers a Delete event
   Shift + Delete key event - triggers a Reset event
 
Event Bindings:
Note that the event bindings described above can be changed using this class's vtkWidgetEventTranslator. This class translates VTK events into the vtkContourWidget's widget events:
   vtkWidgetEvent::Select
        widget state is:
            Start or
            Define: If we already have at least 2 nodes, test
                 whether the current (X,Y) location is near an existing
                 node. If so, close the contour and change to Manipulate
                 state. Otherwise, attempt to add a node at this (X,Y)
                 location.
            Manipulate: If this (X,Y) location activates a node, then
                 set the current operation to Translate. Otherwise, if
                 this location is near the contour, attempt to add a
                 new node on the contour at this (X,Y) location.
Event Bindings:
   vtkWidgetEvent::AddFinalPoint
        widget state is:
            Start: Do nothing.
            Define: If we already have at least 2 nodes, test
                 whether the current (X,Y) location is near an existing
                 node. If so, close the contour and change to Manipulate
                 state. Otherwise, attempt to add a node at this (X,Y)
                 location. If we do, then leave the contour open and
                 change to Manipulate state.
            Manipulate: Do nothing.
Event Bindings:
   vtkWidgetEvent::Move
        widget state is:
            Start or
            Define: Do nothing.
            Manipulate: If our operation is Translate, then invoke
                  WidgetInteraction() on the representation. If our
                  operation is Inactive, then just attempt to activate
                  a node at this (X,Y) location.
Event Bindings:
   vtkWidgetEvent::EndSelect
        widget state is:
            Start or
            Define: Do nothing.
            Manipulate: If our operation is not Inactive, set it to
                  Inactive.
Event Bindings:
   vtkWidgetEvent::Delete
        widget state is:
            Start: Do nothing.
            Define: Remove the last point on the contour.
            Manipulate: Attempt to activate a node at (X,Y). If
                   we do activate a node, delete it. If we now
                   have less than 3 nodes, go back to Define state.
Event Bindings:
   vtkWidgetEvent::Reset
        widget state is:
            Start: Do nothing.
            Define: Remove all points and line segments of the contour.
                 Essentially calls Intialize(NULL)
            Manipulate: Do nothing.
 
Event Bindings:
This widget invokes the following VTK events on itself (which observers can listen for):
   vtkCommand::StartInteractionEvent (beginning to interact)
   vtkCommand::EndInteractionEvent (completing interaction)
   vtkCommand::InteractionEvent (moving after selecting something)
   vtkCommand::PlacePointEvent (after point is positioned;
                                call data includes handle id (0,1))
   vtkCommand::WidgetValueChangedEvent (Invoked when the contour is closed
                                        for the first time. )
 
See also:
vtkHandleWidget
Events:
vtkCommand::EndInteractionEvent vtkCommand::InteractionEvent vtkCommand::StartInteractionEvent
Tests:
vtkContourWidget (Tests)

Definition at line 136 of file vtkContourWidget.h.

typedef vtkAbstractWidget Superclass
static int IsTypeOf (const char *type)
static vtkContourWidgetSafeDownCast (vtkObject *o)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)

Public Member Functions

virtual void SetEnabled (int)
void CreateDefaultRepresentation ()
void CloseLoop ()
void SetRepresentation (vtkContourRepresentation *r)
vtkContourRepresentationGetContourRepresentation ()
virtual void SetWidgetState (int)
virtual int GetWidgetState ()
void SetAllowNodePicking (int)
virtual int GetAllowNodePicking ()
virtual void AllowNodePickingOn ()
virtual void AllowNodePickingOff ()
virtual void SetFollowCursor (int)
virtual int GetFollowCursor ()
virtual void FollowCursorOn ()
virtual void FollowCursorOff ()
virtual void SetContinuousDraw (int)
virtual int GetContinuousDraw ()
virtual void ContinuousDrawOn ()
virtual void ContinuousDrawOff ()
virtual void Initialize (vtkPolyData *poly, int state=1)
virtual void Initialize ()

Static Public Member Functions

static vtkContourWidgetNew ()

Protected Types

enum  { Start, Define, Manipulate }

Protected Member Functions

 vtkContourWidget ()
 ~vtkContourWidget ()
void SelectNode ()
void AddNode ()

Static Protected Member Functions

static void SelectAction (vtkAbstractWidget *)
static void AddFinalPointAction (vtkAbstractWidget *)
static void MoveAction (vtkAbstractWidget *)
static void EndSelectAction (vtkAbstractWidget *)
static void DeleteAction (vtkAbstractWidget *)
static void TranslateContourAction (vtkAbstractWidget *)
static void ScaleContourAction (vtkAbstractWidget *)
static void ResetAction (vtkAbstractWidget *)

Protected Attributes

int WidgetState
int CurrentHandle
int AllowNodePicking
int FollowCursor
int ContinuousDraw
int ContinuousActive

Member Typedef Documentation

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

Definition at line 144 of file vtkContourWidget.h.


Member Enumeration Documentation

anonymous enum [protected]

Enumerator:
Start 
Define 
Manipulate 

Definition at line 234 of file vtkContourWidget.h.


Constructor & Destructor Documentation

vtkContourWidget::vtkContourWidget (  )  [protected]

vtkContourWidget::~vtkContourWidget (  )  [protected]


Member Function Documentation

static vtkContourWidget* vtkContourWidget::New (  )  [static]

Instantiate this class.

Reimplemented from vtkObject.

virtual const char* vtkContourWidget::GetClassName (  )  [virtual]

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

static int vtkContourWidget::IsTypeOf ( const char *  type  )  [static]

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

virtual int vtkContourWidget::IsA ( const char *  type  )  [virtual]

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

static vtkContourWidget* vtkContourWidget::SafeDownCast ( vtkObject o  )  [static]

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

void vtkContourWidget::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

virtual void vtkContourWidget::SetEnabled ( int   )  [virtual]

The method for activiating and deactiviating this widget. This method must be overridden because it is a composite widget and does more than its superclasses' vtkAbstractWidget::SetEnabled() method.

Reimplemented from vtkAbstractWidget.

void vtkContourWidget::SetRepresentation ( vtkContourRepresentation r  )  [inline]

Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene. Note that the representation is a subclass of vtkProp so it can be added to the renderer independent of the widget.

Definition at line 157 of file vtkContourWidget.h.

vtkContourRepresentation* vtkContourWidget::GetContourRepresentation (  )  [inline]

Return the representation as a vtkContourRepresentation.

Definition at line 163 of file vtkContourWidget.h.

void vtkContourWidget::CreateDefaultRepresentation (  )  [virtual]

Create the default widget representation if one is not set.

Implements vtkAbstractWidget.

void vtkContourWidget::CloseLoop (  ) 

Convenient method to close the contour loop.

virtual void vtkContourWidget::SetWidgetState ( int   )  [virtual]

Convenient method to change what state the widget is in.

virtual int vtkContourWidget::GetWidgetState (  )  [virtual]

Convenient method to determine the state of the method

void vtkContourWidget::SetAllowNodePicking ( int   ) 

Set / Get the AllowNodePicking value. This ivar indicates whether the nodes and points between nodes can be picked/un-picked by Ctrl+Click on the node.

virtual int vtkContourWidget::GetAllowNodePicking (  )  [virtual]

Set / Get the AllowNodePicking value. This ivar indicates whether the nodes and points between nodes can be picked/un-picked by Ctrl+Click on the node.

virtual void vtkContourWidget::AllowNodePickingOn (  )  [virtual]

Set / Get the AllowNodePicking value. This ivar indicates whether the nodes and points between nodes can be picked/un-picked by Ctrl+Click on the node.

virtual void vtkContourWidget::AllowNodePickingOff (  )  [virtual]

Set / Get the AllowNodePicking value. This ivar indicates whether the nodes and points between nodes can be picked/un-picked by Ctrl+Click on the node.

virtual void vtkContourWidget::SetFollowCursor ( int   )  [virtual]

Follow the cursor ? If this is ON, during definition, the last node of the contour will automatically follow the cursor, without waiting for the the point to be dropped. This may be useful for some interpolators, such as the live-wire interpolator to see the shape of the contour that will be placed as you move the mouse cursor.

virtual int vtkContourWidget::GetFollowCursor (  )  [virtual]

Follow the cursor ? If this is ON, during definition, the last node of the contour will automatically follow the cursor, without waiting for the the point to be dropped. This may be useful for some interpolators, such as the live-wire interpolator to see the shape of the contour that will be placed as you move the mouse cursor.

virtual void vtkContourWidget::FollowCursorOn (  )  [virtual]

Follow the cursor ? If this is ON, during definition, the last node of the contour will automatically follow the cursor, without waiting for the the point to be dropped. This may be useful for some interpolators, such as the live-wire interpolator to see the shape of the contour that will be placed as you move the mouse cursor.

virtual void vtkContourWidget::FollowCursorOff (  )  [virtual]

Follow the cursor ? If this is ON, during definition, the last node of the contour will automatically follow the cursor, without waiting for the the point to be dropped. This may be useful for some interpolators, such as the live-wire interpolator to see the shape of the contour that will be placed as you move the mouse cursor.

virtual void vtkContourWidget::SetContinuousDraw ( int   )  [virtual]

Define a contour by continuously drawing with the mouse cursor. Press and hold the left mouse button down to continuously draw. Releasing the left mouse button switches into a snap drawing mode. Terminate the contour by pressing the right mouse button. If you do not want to see the nodes as they are added to the contour, set the opacity to 0 of the representation's property. If you do not want to see the last active node as it is being added, set the opacity to 0 of the representation's active property.

virtual int vtkContourWidget::GetContinuousDraw (  )  [virtual]

Define a contour by continuously drawing with the mouse cursor. Press and hold the left mouse button down to continuously draw. Releasing the left mouse button switches into a snap drawing mode. Terminate the contour by pressing the right mouse button. If you do not want to see the nodes as they are added to the contour, set the opacity to 0 of the representation's property. If you do not want to see the last active node as it is being added, set the opacity to 0 of the representation's active property.

virtual void vtkContourWidget::ContinuousDrawOn (  )  [virtual]

Define a contour by continuously drawing with the mouse cursor. Press and hold the left mouse button down to continuously draw. Releasing the left mouse button switches into a snap drawing mode. Terminate the contour by pressing the right mouse button. If you do not want to see the nodes as they are added to the contour, set the opacity to 0 of the representation's property. If you do not want to see the last active node as it is being added, set the opacity to 0 of the representation's active property.

virtual void vtkContourWidget::ContinuousDrawOff (  )  [virtual]

Define a contour by continuously drawing with the mouse cursor. Press and hold the left mouse button down to continuously draw. Releasing the left mouse button switches into a snap drawing mode. Terminate the contour by pressing the right mouse button. If you do not want to see the nodes as they are added to the contour, set the opacity to 0 of the representation's property. If you do not want to see the last active node as it is being added, set the opacity to 0 of the representation's active property.

virtual void vtkContourWidget::Initialize ( vtkPolyData poly,
int  state = 1 
) [virtual]

Initialize the contour widget from a user supplied set of points. The state of the widget decides if you are still defining the widget, or if you've finished defining (added the last point) are manipulating it. Note that if the polydata supplied is closed, the state will be set to manipulate. State: Define = 0, Manipulate = 1.

virtual void vtkContourWidget::Initialize (  )  [inline, virtual]

Initialize the contour widget from a user supplied set of points. The state of the widget decides if you are still defining the widget, or if you've finished defining (added the last point) are manipulating it. Note that if the polydata supplied is closed, the state will be set to manipulate. State: Define = 0, Manipulate = 1.

Definition at line 224 of file vtkContourWidget.h.

static void vtkContourWidget::SelectAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::AddFinalPointAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::MoveAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::EndSelectAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::DeleteAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::TranslateContourAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::ScaleContourAction ( vtkAbstractWidget  )  [static, protected]

static void vtkContourWidget::ResetAction ( vtkAbstractWidget  )  [static, protected]

void vtkContourWidget::SelectNode (  )  [protected]

void vtkContourWidget::AddNode (  )  [protected]


Member Data Documentation

Definition at line 237 of file vtkContourWidget.h.

Definition at line 238 of file vtkContourWidget.h.

Definition at line 239 of file vtkContourWidget.h.

Definition at line 240 of file vtkContourWidget.h.

Definition at line 241 of file vtkContourWidget.h.

Definition at line 242 of file vtkContourWidget.h.


The documentation for this class was generated from the following file:

Generated on Wed Aug 24 11:32:24 2011 for VTK by  doxygen 1.5.6