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) override;
148 
154  void SetEnabled(int) override;
155 
162  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
163 
168  {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
169 
173  void CreateDefaultRepresentation() override;
174 
178  void CloseLoop();
179 
181 
184  vtkSetMacro(WidgetState,int);
186 
188 
191  vtkGetMacro(WidgetState,int);
193 
195 
199  void SetAllowNodePicking(vtkTypeBool );
200  vtkGetMacro( AllowNodePicking, vtkTypeBool );
201  vtkBooleanMacro( AllowNodePicking, vtkTypeBool );
203 
205 
212  vtkSetMacro( FollowCursor, vtkTypeBool );
213  vtkGetMacro( FollowCursor, vtkTypeBool );
214  vtkBooleanMacro( FollowCursor, vtkTypeBool );
216 
218 
228  vtkSetMacro( ContinuousDraw, vtkTypeBool );
229  vtkGetMacro( ContinuousDraw, vtkTypeBool );
230  vtkBooleanMacro( ContinuousDraw, vtkTypeBool );
232 
241  virtual void Initialize( vtkPolyData * poly, int state = 1, vtkIdList *idList = nullptr );
242  virtual void Initialize()
243  {this->Initialize(nullptr);}
244 
245  // The state of the widget
246 
247  enum {Start,Define,Manipulate};
248 
249 protected:
251  ~vtkContourWidget() override;
252 
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&) = delete;
277  void operator=(const vtkContourWidget&) = delete;
278 };
279 
280 #endif
vtkContourWidget::CurrentHandle
int CurrentHandle
Definition: vtkContourWidget.h:254
vtkContourWidget::WidgetState
int WidgetState
Definition: vtkContourWidget.h:253
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkContourRepresentation
represent the vtkContourWidget
Definition: vtkContourRepresentation.h:117
vtkContourWidget
create a contour with a set of points
Definition: vtkContourWidget.h:133
vtkContourWidget::Initialize
virtual void Initialize()
Definition: vtkContourWidget.h:242
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:63
vtkContourWidget::Start
Definition: vtkContourWidget.h:247
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkContourWidget::ContinuousDraw
vtkTypeBool ContinuousDraw
Definition: vtkContourWidget.h:257
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkContourWidget::ContinuousActive
int ContinuousActive
Definition: vtkContourWidget.h:258
vtkContourWidget::SetRepresentation
void SetRepresentation(vtkContourRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkContourWidget.h:161
vtkContourWidget::AllowNodePicking
vtkTypeBool AllowNodePicking
Definition: vtkContourWidget.h:255
vtkContourWidget::GetContourRepresentation
vtkContourRepresentation * GetContourRepresentation()
Return the representation as a vtkContourRepresentation.
Definition: vtkContourWidget.h:167
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkContourWidget::FollowCursor
vtkTypeBool FollowCursor
Definition: vtkContourWidget.h:256