VTK  9.0.1
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 "vtkAbstractWidget.h"
127 #include "vtkInteractionWidgetsModule.h" // For export macro
128 
130 class vtkPolyData;
131 class vtkIdList;
132 
133 class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
134 {
135 public:
140 
142 
146  void PrintSelf(ostream& os, vtkIndent indent) override;
148 
154  void SetEnabled(int) override;
155 
162  {
163  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
164  }
165 
170  {
171  return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
172  }
173 
178 
182  void CloseLoop();
183 
185 
188  vtkSetMacro(WidgetState, int);
190 
192 
195  vtkGetMacro(WidgetState, int);
197 
199 
204  vtkGetMacro(AllowNodePicking, vtkTypeBool);
205  vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
207 
209 
216  vtkSetMacro(FollowCursor, vtkTypeBool);
217  vtkGetMacro(FollowCursor, vtkTypeBool);
218  vtkBooleanMacro(FollowCursor, vtkTypeBool);
220 
222 
232  vtkSetMacro(ContinuousDraw, vtkTypeBool);
233  vtkGetMacro(ContinuousDraw, vtkTypeBool);
234  vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
236 
245  virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
246  virtual void Initialize() { this->Initialize(nullptr); }
247 
248  // The state of the widget
249 
250  enum
251  {
254  Manipulate
255  };
256 
257 protected:
259  ~vtkContourWidget() override;
260 
267 
268  // Callback interface to capture events when
269  // placing the widget.
278 
279  // Internal helper methods
280  void SelectNode();
281  void AddNode();
282 
283 private:
284  vtkContourWidget(const vtkContourWidget&) = delete;
285  void operator=(const vtkContourWidget&) = delete;
286 };
287 
288 #endif
vtkContourWidget::DeleteAction
static void DeleteAction(vtkAbstractWidget *)
vtkContourWidget::~vtkContourWidget
~vtkContourWidget() override
vtkContourWidget::CurrentHandle
int CurrentHandle
Definition: vtkContourWidget.h:262
vtkContourWidget::SetEnabled
void SetEnabled(int) override
The method for activating and deactivating this widget.
vtkContourWidget::WidgetState
int WidgetState
Definition: vtkContourWidget.h:261
vtkAbstractWidget.h
vtkContourWidget::AddFinalPointAction
static void AddFinalPointAction(vtkAbstractWidget *)
vtkContourWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkContourWidget::CloseLoop
void CloseLoop()
Convenient method to close the contour loop.
vtkContourRepresentation
represent the vtkContourWidget
Definition: vtkContourRepresentation.h:118
vtkContourWidget::TranslateContourAction
static void TranslateContourAction(vtkAbstractWidget *)
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:60
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:172
vtkContourWidget
create a contour with a set of points
Definition: vtkContourWidget.h:134
vtkContourWidget::Initialize
virtual void Initialize()
Definition: vtkContourWidget.h:246
vtkContourWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:63
vtkContourWidget::ScaleContourAction
static void ScaleContourAction(vtkAbstractWidget *)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:31
vtkContourWidget::SetAllowNodePicking
void SetAllowNodePicking(vtkTypeBool)
Set / Get the AllowNodePicking value.
vtkContourWidget::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkContourWidget::SelectNode
void SelectNode()
vtkContourWidget::Initialize
virtual void Initialize(vtkPolyData *poly, int state=1, vtkIdList *idList=nullptr)
Initialize the contour widget from a user supplied set of points.
vtkContourWidget::ResetAction
static void ResetAction(vtkAbstractWidget *)
vtkContourWidget::ContinuousDraw
vtkTypeBool ContinuousDraw
Definition: vtkContourWidget.h:265
vtkContourWidget::AddNode
void AddNode()
vtkContourWidget::vtkContourWidget
vtkContourWidget()
vtkContourWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkContourWidget::New
static vtkContourWidget * New()
Instantiate this class.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkContourWidget::ContinuousActive
int ContinuousActive
Definition: vtkContourWidget.h:266
vtkContourWidget::Start
@ Start
Definition: vtkContourWidget.h:252
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:263
vtkContourWidget::GetContourRepresentation
vtkContourRepresentation * GetContourRepresentation()
Return the representation as a vtkContourRepresentation.
Definition: vtkContourWidget.h:169
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkContourWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourWidget::Define
@ Define
Definition: vtkContourWidget.h:253
vtkContourWidget::FollowCursor
vtkTypeBool FollowCursor
Definition: vtkContourWidget.h:264