VTK  9.2.6
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 =========================================================================*/
138 #ifndef vtkContourWidget_h
139 #define vtkContourWidget_h
140 
141 #include "vtkAbstractWidget.h"
142 #include "vtkInteractionWidgetsModule.h" // For export macro
143 
145 class vtkPolyData;
146 class vtkIdList;
147 
148 class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
149 {
150 public:
155 
157 
161  void PrintSelf(ostream& os, vtkIndent indent) override;
163 
169  void SetEnabled(int) override;
170 
177  {
178  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
179  }
180 
185  {
186  return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
187  }
188 
193 
197  void CloseLoop();
198 
200 
203  vtkSetMacro(WidgetState, int);
205 
207 
210  vtkGetMacro(WidgetState, int);
212 
214 
219  vtkGetMacro(AllowNodePicking, vtkTypeBool);
220  vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
222 
224 
231  vtkSetMacro(FollowCursor, vtkTypeBool);
232  vtkGetMacro(FollowCursor, vtkTypeBool);
233  vtkBooleanMacro(FollowCursor, vtkTypeBool);
235 
237 
247  vtkSetMacro(ContinuousDraw, vtkTypeBool);
248  vtkGetMacro(ContinuousDraw, vtkTypeBool);
249  vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
251 
260  virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
261  virtual void Initialize() { this->Initialize(nullptr); }
262 
263  // The state of the widget
264 
265  enum
266  {
269  Manipulate
270  };
271 
272 protected:
274  ~vtkContourWidget() override;
275 
282 
283  // Callback interface to capture events when
284  // placing the widget.
293 
294  // Internal helper methods
295  void SelectNode();
296  void AddNode();
297 
298 private:
299  vtkContourWidget(const vtkContourWidget&) = delete;
300  void operator=(const vtkContourWidget&) = delete;
301 };
302 
303 #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 CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
void CloseLoop()
Convenient method to close the contour loop.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
vtkTypeBool FollowCursor
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.
~vtkContourWidget() override
static vtkContourWidget * New()
Instantiate this class.
vtkContourRepresentation * GetContourRepresentation()
Return the representation as a vtkContourRepresentation.
static void SelectAction(vtkAbstractWidget *)
virtual void Initialize(vtkPolyData *poly, int state=1, vtkIdList *idList=nullptr)
Initialize the contour widget from a user supplied set of points.
static void AddFinalPointAction(vtkAbstractWidget *)
static void DeleteAction(vtkAbstractWidget *)
vtkTypeBool AllowNodePicking
vtkTypeBool ContinuousDraw
static void EndSelectAction(vtkAbstractWidget *)
static void ScaleContourAction(vtkAbstractWidget *)
virtual void Initialize()
void SetAllowNodePicking(vtkTypeBool)
Set / Get the AllowNodePicking value.
void SetEnabled(int) override
The method for activating and deactivating this widget.
list of point or cell ids
Definition: vtkIdList.h:43
a simple class to control print indentation
Definition: vtkIndent.h:49
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:100
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69