VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkContourWidget Class Reference

create a contour with a set of points More...

#include <vtkContourWidget.h>

Inheritance diagram for vtkContourWidget:
[legend]
Collaboration diagram for vtkContourWidget:
[legend]

Public Types

enum  { Start, Define, Manipulate }
 
typedef vtkAbstractWidget Superclass
 
- Public Types inherited from vtkAbstractWidget
typedef vtkInteractorObserver Superclass
 
- Public Types inherited from vtkInteractorObserver
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkContourWidgetNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void SetEnabled (int)
 
void SetRepresentation (vtkContourRepresentation *r)
 
vtkContourRepresentationGetContourRepresentation ()
 
void CreateDefaultRepresentation ()
 
void CloseLoop ()
 
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, vtkIdList *idList=NULL)
 
virtual void Initialize ()
 
- Public Member Functions inherited from vtkAbstractWidget
vtkAbstractWidgetNewInstance () const
 
virtual void SetProcessEvents (int)
 
virtual int GetProcessEvents ()
 
virtual void ProcessEventsOn ()
 
virtual void ProcessEventsOff ()
 
vtkWidgetEventTranslatorGetEventTranslator ()
 
void Render ()
 
void SetParent (vtkAbstractWidget *parent)
 
virtual vtkAbstractWidgetGetParent ()
 
vtkWidgetRepresentationGetRepresentation ()
 
virtual void SetManagesCursor (int)
 
virtual int GetManagesCursor ()
 
virtual void ManagesCursorOn ()
 
virtual void ManagesCursorOff ()
 
virtual void SetPriority (float)
 
- Public Member Functions inherited from vtkInteractorObserver
vtkInteractorObserverNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
int GetEnabled ()
 
void EnabledOn ()
 
void EnabledOff ()
 
void On ()
 
void Off ()
 
virtual void SetInteractor (vtkRenderWindowInteractor *iren)
 
virtual vtkRenderWindowInteractorGetInteractor ()
 
virtual float GetPriority ()
 
virtual void PickingManagedOn ()
 
virtual void PickingManagedOff ()
 
virtual void SetPickingManaged (bool)
 
virtual bool GetPickingManaged ()
 
virtual void SetKeyPressActivation (int)
 
virtual int GetKeyPressActivation ()
 
virtual void KeyPressActivationOn ()
 
virtual void KeyPressActivationOff ()
 
virtual void SetKeyPressActivationValue (char)
 
virtual char GetKeyPressActivationValue ()
 
virtual vtkRendererGetDefaultRenderer ()
 
virtual void SetDefaultRenderer (vtkRenderer *)
 
virtual vtkRendererGetCurrentRenderer ()
 
virtual void SetCurrentRenderer (vtkRenderer *)
 
virtual void OnChar ()
 
void GrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void ReleaseFocus ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkContourWidgetNew ()
 
static int IsTypeOf (const char *type)
 
static vtkContourWidgetSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkAbstractWidget
static int IsTypeOf (const char *type)
 
static vtkAbstractWidgetSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkInteractorObserver
static int IsTypeOf (const char *type)
 
static vtkInteractorObserverSafeDownCast (vtkObjectBase *o)
 
static void ComputeDisplayToWorld (vtkRenderer *ren, double x, double y, double z, double worldPt[4])
 
static void ComputeWorldToDisplay (vtkRenderer *ren, double x, double y, double z, double displayPt[3])
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkContourWidget ()
 
 ~vtkContourWidget ()
 
void SelectNode ()
 
void AddNode ()
 
- Protected Member Functions inherited from vtkAbstractWidget
 vtkAbstractWidget ()
 
 ~vtkAbstractWidget ()
 
void SetWidgetRepresentation (vtkWidgetRepresentation *r)
 
virtual void SetCursor (int vtkNotUsed(state))
 
- Protected Member Functions inherited from vtkInteractorObserver
 vtkInteractorObserver ()
 
 ~vtkInteractorObserver ()
 
virtual void StartInteraction ()
 
virtual void EndInteraction ()
 
void ComputeDisplayToWorld (double x, double y, double z, double worldPt[4])
 
void ComputeWorldToDisplay (double x, double y, double z, double displayPt[3])
 
virtual void RegisterPickers ()
 
void UnRegisterPickers ()
 
virtual void PickersModified ()
 
vtkPickingManagerGetPickingManager ()
 
vtkAssemblyPathGetAssemblyPath (double X, double Y, double Z, vtkAbstractPropPicker *picker)
 
int RequestCursorShape (int requestedShape)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

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 *)
 
- Static Protected Member Functions inherited from vtkAbstractWidget
static void ProcessEventsHandler (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 
- Static Protected Member Functions inherited from vtkInteractorObserver
static void ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 

Protected Attributes

int WidgetState
 
int CurrentHandle
 
int AllowNodePicking
 
int FollowCursor
 
int ContinuousDraw
 
int ContinuousActive
 
- Protected Attributes inherited from vtkAbstractWidget
vtkWidgetRepresentationWidgetRep
 
int ManagesCursor
 
vtkWidgetEventTranslatorEventTranslator
 
vtkWidgetCallbackMapperCallbackMapper
 
vtkAbstractWidgetParent
 
void * CallData
 
int ProcessEvents
 
- Protected Attributes inherited from vtkInteractorObserver
int Enabled
 
vtkCallbackCommandEventCallbackCommand
 
vtkCallbackCommandKeyPressCallbackCommand
 
float Priority
 
bool PickingManaged
 
int KeyPressActivation
 
char KeyPressActivationValue
 
vtkRenderWindowInteractorInteractor
 
vtkRendererCurrentRenderer
 
vtkRendererDefaultRenderer
 
unsigned long CharObserverTag
 
unsigned long DeleteObserverTag
 
vtkObserverMediatorObserverMediator
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

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 Initialize(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::StartInteractionEvent vtkCommand::InteractionEvent vtkCommand::EndInteractionEvent
Tests:
vtkContourWidget (Tests)

Definition at line 138 of file vtkContourWidget.h.

Member Typedef Documentation

◆ Superclass

Standard methods for a VTK class.

Definition at line 146 of file vtkContourWidget.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Start 
Define 
Manipulate 

Definition at line 232 of file vtkContourWidget.h.

Constructor & Destructor Documentation

◆ vtkContourWidget()

vtkContourWidget::vtkContourWidget ( )
protected

◆ ~vtkContourWidget()

vtkContourWidget::~vtkContourWidget ( )
protected

Member Function Documentation

◆ New()

static vtkContourWidget* vtkContourWidget::New ( )
static

Instantiate this class.

◆ IsTypeOf()

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

◆ IsA()

virtual int vtkContourWidget::IsA ( const char *  name)
virtual

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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAbstractWidget.

◆ SafeDownCast()

static vtkContourWidget* vtkContourWidget::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkContourWidget::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkAbstractWidget.

◆ NewInstance()

vtkContourWidget* vtkContourWidget::NewInstance ( ) const

◆ PrintSelf()

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

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkAbstractWidget.

◆ SetEnabled()

virtual void vtkContourWidget::SetEnabled ( int  )
virtual

The method for activating and deactivating 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.

◆ SetRepresentation()

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 159 of file vtkContourWidget.h.

◆ GetContourRepresentation()

vtkContourRepresentation* vtkContourWidget::GetContourRepresentation ( )
inline

Return the representation as a vtkContourRepresentation.

Definition at line 165 of file vtkContourWidget.h.

◆ CreateDefaultRepresentation()

void vtkContourWidget::CreateDefaultRepresentation ( )
virtual

Create the default widget representation if one is not set.

Implements vtkAbstractWidget.

◆ CloseLoop()

void vtkContourWidget::CloseLoop ( )

Convenient method to close the contour loop.

◆ SetWidgetState()

virtual void vtkContourWidget::SetWidgetState ( int  )
virtual

Convenient method to change what state the widget is in.

◆ GetWidgetState()

virtual int vtkContourWidget::GetWidgetState ( )
virtual

Convenient method to determine the state of the method

◆ SetAllowNodePicking()

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.

◆ GetAllowNodePicking()

virtual int vtkContourWidget::GetAllowNodePicking ( )
virtual

◆ AllowNodePickingOn()

virtual void vtkContourWidget::AllowNodePickingOn ( )
virtual

◆ AllowNodePickingOff()

virtual void vtkContourWidget::AllowNodePickingOff ( )
virtual

◆ SetFollowCursor()

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 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.

◆ GetFollowCursor()

virtual int vtkContourWidget::GetFollowCursor ( )
virtual

◆ FollowCursorOn()

virtual void vtkContourWidget::FollowCursorOn ( )
virtual

◆ FollowCursorOff()

virtual void vtkContourWidget::FollowCursorOff ( )
virtual

◆ SetContinuousDraw()

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.

◆ GetContinuousDraw()

virtual int vtkContourWidget::GetContinuousDraw ( )
virtual

◆ ContinuousDrawOn()

virtual void vtkContourWidget::ContinuousDrawOn ( )
virtual

◆ ContinuousDrawOff()

virtual void vtkContourWidget::ContinuousDrawOff ( )
virtual

◆ Initialize() [1/2]

virtual void vtkContourWidget::Initialize ( vtkPolyData poly,
int  state = 1,
vtkIdList idList = NULL 
)
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.

◆ Initialize() [2/2]

virtual void vtkContourWidget::Initialize ( )
inlinevirtual

Definition at line 226 of file vtkContourWidget.h.

◆ SelectAction()

static void vtkContourWidget::SelectAction ( vtkAbstractWidget )
staticprotected

◆ AddFinalPointAction()

static void vtkContourWidget::AddFinalPointAction ( vtkAbstractWidget )
staticprotected

◆ MoveAction()

static void vtkContourWidget::MoveAction ( vtkAbstractWidget )
staticprotected

◆ EndSelectAction()

static void vtkContourWidget::EndSelectAction ( vtkAbstractWidget )
staticprotected

◆ DeleteAction()

static void vtkContourWidget::DeleteAction ( vtkAbstractWidget )
staticprotected

◆ TranslateContourAction()

static void vtkContourWidget::TranslateContourAction ( vtkAbstractWidget )
staticprotected

◆ ScaleContourAction()

static void vtkContourWidget::ScaleContourAction ( vtkAbstractWidget )
staticprotected

◆ ResetAction()

static void vtkContourWidget::ResetAction ( vtkAbstractWidget )
staticprotected

◆ SelectNode()

void vtkContourWidget::SelectNode ( )
protected

◆ AddNode()

void vtkContourWidget::AddNode ( )
protected

Member Data Documentation

◆ WidgetState

int vtkContourWidget::WidgetState
protected

Definition at line 239 of file vtkContourWidget.h.

◆ CurrentHandle

int vtkContourWidget::CurrentHandle
protected

Definition at line 240 of file vtkContourWidget.h.

◆ AllowNodePicking

int vtkContourWidget::AllowNodePicking
protected

Definition at line 241 of file vtkContourWidget.h.

◆ FollowCursor

int vtkContourWidget::FollowCursor
protected

Definition at line 242 of file vtkContourWidget.h.

◆ ContinuousDraw

int vtkContourWidget::ContinuousDraw
protected

Definition at line 243 of file vtkContourWidget.h.

◆ ContinuousActive

int vtkContourWidget::ContinuousActive
protected

Definition at line 244 of file vtkContourWidget.h.


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