VTK  9.5.2
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
113
114#ifndef vtkContourWidget_h
115#define vtkContourWidget_h
116
117#include "vtkAbstractWidget.h"
118#include "vtkInteractionWidgetsModule.h" // For export macro
119#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
120
121VTK_ABI_NAMESPACE_BEGIN
123class vtkPolyData;
124class vtkIdList;
125
126class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkContourWidget : public vtkAbstractWidget
127{
128public:
133
135
139 void PrintSelf(ostream& os, vtkIndent indent) override;
141
147 void SetEnabled(int) override;
148
158
163 {
164 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
165 }
166
171
175 void CloseLoop();
176
178
181 vtkSetMacro(WidgetState, int);
183
185
188 vtkGetMacro(WidgetState, int);
190
192
198 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
200
202
211 vtkBooleanMacro(FollowCursor, vtkTypeBool);
213
215
227 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
229
238 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
239 virtual void Initialize() { this->Initialize(nullptr); }
240
241 // The state of the widget
242
243 enum
244 {
248 };
249
250protected:
253
260
261 // Callback interface to capture events when
262 // placing the widget.
271
272 // Internal helper methods
274 void AddNode();
275
276private:
277 vtkContourWidget(const vtkContourWidget&) = delete;
278 void operator=(const vtkContourWidget&) = delete;
279};
280
281VTK_ABI_NAMESPACE_END
282#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