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 =========================================================================*/
128 #ifndef vtkContourWidget_h
129 #define vtkContourWidget_h
130 
131 #include "vtkInteractionWidgetsModule.h" // For export macro
132 #include "vtkAbstractWidget.h"
133 
135 class vtkPolyData;
136 class vtkIdList;
137 
139 {
140 public:
142  static vtkContourWidget *New();
143 
145 
147  void PrintSelf(ostream& os, vtkIndent indent);
149 
153  virtual void SetEnabled(int);
154 
156 
160  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
162 
164 
166  {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
168 
171 
173  void CloseLoop();
174 
176 
177  vtkSetMacro(WidgetState,int);
179 
181 
182  vtkGetMacro(WidgetState,int);
184 
186 
189  void SetAllowNodePicking(int );
190  vtkGetMacro( AllowNodePicking, int );
191  vtkBooleanMacro( AllowNodePicking, int );
193 
195 
200  vtkSetMacro( FollowCursor, int );
201  vtkGetMacro( FollowCursor, int );
202  vtkBooleanMacro( FollowCursor, int );
204 
206 
214  vtkSetMacro( ContinuousDraw, int );
215  vtkGetMacro( ContinuousDraw, int );
216  vtkBooleanMacro( ContinuousDraw, int );
218 
220 
225  virtual void Initialize( vtkPolyData * poly, int state = 1, vtkIdList *idList = NULL );
226  virtual void Initialize()
227  {this->Initialize(NULL);}
229 
230  // The state of the widget
231  //BTX
232  enum {Start,Define,Manipulate};
233  //ETX
234 
235 protected:
237  ~vtkContourWidget();
238 
245 
246  // Callback interface to capture events when
247  // placing the widget.
248  static void SelectAction(vtkAbstractWidget*);
249  static void AddFinalPointAction(vtkAbstractWidget*);
250  static void MoveAction(vtkAbstractWidget*);
251  static void EndSelectAction(vtkAbstractWidget*);
252  static void DeleteAction(vtkAbstractWidget*);
253  static void TranslateContourAction(vtkAbstractWidget*);
254  static void ScaleContourAction(vtkAbstractWidget*);
255  static void ResetAction(vtkAbstractWidget*);
256 
257  // Internal helper methods
258  void SelectNode();
259  void AddNode();
260 
261 private:
262  vtkContourWidget(const vtkContourWidget&); //Not implemented
263  void operator=(const vtkContourWidget&); //Not implemented
264 };
265 
266 #endif
void PrintSelf(ostream &os, vtkIndent indent)
void SetRepresentation(vtkContourRepresentation *r)
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
virtual void CreateDefaultRepresentation()=0
represent the vtkContourWidget
vtkWidgetRepresentation * WidgetRep
#define VTKINTERACTIONWIDGETS_EXPORT
vtkContourRepresentation * GetContourRepresentation()
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
define the API for widget / widget representation
create a contour with a set of points
static vtkObject * New()
virtual void Initialize()
virtual void SetEnabled(int)