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 =========================================================================*/
123 #ifndef vtkContourWidget_h
124 #define vtkContourWidget_h
125 
126 #include "vtkInteractionWidgetsModule.h" // For export macro
127 #include "vtkAbstractWidget.h"
128 
130 class vtkPolyData;
131 class vtkIdList;
132 
133 class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
134 {
135 public:
139  static vtkContourWidget *New();
140 
142 
146  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
148 
154  void SetEnabled(int) VTK_OVERRIDE;
155 
162  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
163 
168  {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
169 
173  void CreateDefaultRepresentation() VTK_OVERRIDE;
174 
178  void CloseLoop();
179 
181 
184  vtkSetMacro(WidgetState,int);
186 
188 
191  vtkGetMacro(WidgetState,int);
193 
195 
199  void SetAllowNodePicking(int );
200  vtkGetMacro( AllowNodePicking, int );
201  vtkBooleanMacro( AllowNodePicking, int );
203 
205 
212  vtkSetMacro( FollowCursor, int );
213  vtkGetMacro( FollowCursor, int );
214  vtkBooleanMacro( FollowCursor, int );
216 
218 
228  vtkSetMacro( ContinuousDraw, int );
229  vtkGetMacro( ContinuousDraw, int );
230  vtkBooleanMacro( ContinuousDraw, int );
232 
241  virtual void Initialize( vtkPolyData * poly, int state = 1, vtkIdList *idList = NULL );
242  virtual void Initialize()
243  {this->Initialize(NULL);}
244 
245  // The state of the widget
246 
247  enum {Start,Define,Manipulate};
248 
249 protected:
251  ~vtkContourWidget() VTK_OVERRIDE;
252 
253  int WidgetState;
254  int CurrentHandle;
255  int AllowNodePicking;
256  int FollowCursor;
257  int ContinuousDraw;
258  int ContinuousActive;
259 
260  // Callback interface to capture events when
261  // placing the widget.
262  static void SelectAction(vtkAbstractWidget*);
263  static void AddFinalPointAction(vtkAbstractWidget*);
264  static void MoveAction(vtkAbstractWidget*);
265  static void EndSelectAction(vtkAbstractWidget*);
266  static void DeleteAction(vtkAbstractWidget*);
267  static void TranslateContourAction(vtkAbstractWidget*);
268  static void ScaleContourAction(vtkAbstractWidget*);
269  static void ResetAction(vtkAbstractWidget*);
270 
271  // Internal helper methods
272  void SelectNode();
273  void AddNode();
274 
275 private:
276  vtkContourWidget(const vtkContourWidget&) VTK_DELETE_FUNCTION;
277  void operator=(const vtkContourWidget&) VTK_DELETE_FUNCTION;
278 };
279 
280 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
void SetRepresentation(vtkContourRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
represent the vtkContourWidget
vtkWidgetRepresentation * WidgetRep
vtkContourRepresentation * GetContourRepresentation()
Return the representation as a vtkContourRepresentation.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
define the API for widget / widget representation
create a contour with a set of points
void SetEnabled(int) override
Methods for activating this widget.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...