VTK  9.6.1
vtkContourWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
116
117#ifndef vtkContourWidget_h
118#define vtkContourWidget_h
119
120#include "vtkAbstractWidget.h"
121#include "vtkInteractionWidgetsModule.h" // For export macro
122#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
123
124VTK_ABI_NAMESPACE_BEGIN
126class vtkPolyData;
127class vtkIdList;
128
129class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkContourWidget : public vtkAbstractWidget
130{
131public:
136
138
142 void PrintSelf(ostream& os, vtkIndent indent) override;
144
150 void SetEnabled(int) override;
151
161
166 {
167 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
168 }
169
174
178 void CloseLoop();
179
181
184 vtkSetMacro(WidgetState, int);
186
188
191 vtkGetMacro(WidgetState, int);
193
195
201 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
203
205
214 vtkBooleanMacro(FollowCursor, vtkTypeBool);
216
218
230 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
232
241 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
242 virtual void Initialize() { this->Initialize(nullptr); }
243
244 // The state of the widget
245
246 enum
247 {
251 };
252
253protected:
256
263
264 // Callback interface to capture events when
265 // placing the widget.
274
275 // Internal helper methods
277 void AddNode();
278
279private:
280 vtkContourWidget(const vtkContourWidget&) = delete;
281 void operator=(const vtkContourWidget&) = delete;
282};
283
284VTK_ABI_NAMESPACE_END
285#endif
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
vtkWidgetRepresentation * WidgetRep
represent the vtkContourWidget
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 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
vtkContourRepresentation * GetContourRepresentation()
Return the representation as a vtkContourRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
static vtkContourWidget * New()
Instantiate this class.
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:24
a simple class to control print indentation
Definition vtkIndent.h:29
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO