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 =========================================================================*/
168 #ifndef vtkContourWidget_h
169 #define vtkContourWidget_h
170 
171 #include "vtkAbstractWidget.h"
172 #include "vtkInteractionWidgetsModule.h" // For export macro
173 
175 class vtkPolyData;
176 class vtkIdList;
177 
178 class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
179 {
180 public:
185 
187 
191  void PrintSelf(ostream& os, vtkIndent indent) override;
193 
199  void SetEnabled(int) override;
200 
207  {
208  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
209  }
210 
215  {
216  return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
217  }
218 
223 
227  void CloseLoop();
228 
230 
233  vtkSetMacro(WidgetState, int);
235 
237 
240  vtkGetMacro(WidgetState, int);
242 
244 
249  vtkGetMacro(AllowNodePicking, vtkTypeBool);
250  vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
252 
254 
261  vtkSetMacro(FollowCursor, vtkTypeBool);
262  vtkGetMacro(FollowCursor, vtkTypeBool);
263  vtkBooleanMacro(FollowCursor, vtkTypeBool);
265 
267 
277  vtkSetMacro(ContinuousDraw, vtkTypeBool);
278  vtkGetMacro(ContinuousDraw, vtkTypeBool);
279  vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
281 
290  virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
291  virtual void Initialize() { this->Initialize(nullptr); }
292 
293  // The state of the widget
294 
295  enum
296  {
299  Manipulate
300  };
301 
302 protected:
304  ~vtkContourWidget() override;
305 
312 
313  // Callback interface to capture events when
314  // placing the widget.
323 
324  // Internal helper methods
325  void SelectNode();
326  void AddNode();
327 
328 private:
329  vtkContourWidget(const vtkContourWidget&) = delete;
330  void operator=(const vtkContourWidget&) = delete;
331 };
332 
333 #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:143
a simple class to control print indentation
Definition: vtkIndent.h:119
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69