VTK
vtkContourWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContourWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
126 #ifndef vtkContourWidget_h
127 #define vtkContourWidget_h
128 
129 #include "vtkInteractionWidgetsModule.h" // For export macro
130 #include "vtkAbstractWidget.h"
131 
133 class vtkPolyData;
134 class vtkIdList;
135 
136 class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
137 {
138 public:
143 
145 
149  void PrintSelf(ostream& os, vtkIndent indent);
151 
157  virtual void SetEnabled(int);
158 
165  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
166 
171  {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
172 
177 
181  void CloseLoop();
182 
184 
187  vtkSetMacro(WidgetState,int);
189 
191 
194  vtkGetMacro(WidgetState,int);
196 
198 
203  vtkGetMacro( AllowNodePicking, int );
204  vtkBooleanMacro( AllowNodePicking, int );
206 
208 
215  vtkSetMacro( FollowCursor, int );
216  vtkGetMacro( FollowCursor, int );
217  vtkBooleanMacro( FollowCursor, int );
219 
221 
231  vtkSetMacro( ContinuousDraw, int );
232  vtkGetMacro( ContinuousDraw, int );
233  vtkBooleanMacro( ContinuousDraw, int );
235 
244  virtual void Initialize( vtkPolyData * poly, int state = 1, vtkIdList *idList = NULL );
245  virtual void Initialize()
246  {this->Initialize(NULL);}
247 
248  // The state of the widget
249 
250  enum {Start,Define,Manipulate};
251 
252 protected:
255 
262 
263  // Callback interface to capture events when
264  // placing the widget.
273 
274  // Internal helper methods
275  void SelectNode();
276  void AddNode();
277 
278 private:
279  vtkContourWidget(const vtkContourWidget&) VTK_DELETE_FUNCTION;
280  void operator=(const vtkContourWidget&) VTK_DELETE_FUNCTION;
281 };
282 
283 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkContourWidget
create a contour with a set of points
static void TranslateContourAction(vtkAbstractWidget *)
void CloseLoop()
Convenient method to close the contour loop.
virtual void SetEnabled(int)
The method for activating and deactivating this widget.
static void MoveAction(vtkAbstractWidget *)
static void ResetAction(vtkAbstractWidget *)
void SetRepresentation(vtkContourRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
virtual void Initialize(vtkPolyData *poly, int state=1, vtkIdList *idList=NULL)
Initialize the contour widget from a user supplied set of points.
static vtkContourWidget * New()
Instantiate this class.
vtkContourRepresentation * GetContourRepresentation()
Return the representation as a vtkContourRepresentation.
static void SelectAction(vtkAbstractWidget *)
static void AddFinalPointAction(vtkAbstractWidget *)
static void DeleteAction(vtkAbstractWidget *)
void CreateDefaultRepresentation()
Create the default widget representation if one is not set.
static void EndSelectAction(vtkAbstractWidget *)
static void ScaleContourAction(vtkAbstractWidget *)
virtual void Initialize()
void SetAllowNodePicking(int)
Set / Get the AllowNodePicking value.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract class defines interface between the widget and widget representation classes
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.