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
152
153#ifndef vtkContourWidget_h
154#define vtkContourWidget_h
155
156#include "vtkAbstractWidget.h"
157#include "vtkInteractionWidgetsModule.h" // For export macro
158#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
159
160VTK_ABI_NAMESPACE_BEGIN
162class vtkPolyData;
163class vtkIdList;
164
165class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkContourWidget : public vtkAbstractWidget
166{
167public:
172
174
178 void PrintSelf(ostream& os, vtkIndent indent) override;
180
186 void SetEnabled(int) override;
187
197
202 {
203 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
204 }
205
210
214 void CloseLoop();
215
217
220 vtkSetMacro(WidgetState, int);
222
224
227 vtkGetMacro(WidgetState, int);
229
231
237 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
239
241
250 vtkBooleanMacro(FollowCursor, vtkTypeBool);
252
254
266 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
268
277 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
278 virtual void Initialize() { this->Initialize(nullptr); }
279
280 // The state of the widget
281
282 enum
283 {
287 };
288
289protected:
292
299
300 // Callback interface to capture events when
301 // placing the widget.
310
311 // Internal helper methods
313 void AddNode();
314
315private:
316 vtkContourWidget(const vtkContourWidget&) = delete;
317 void operator=(const vtkContourWidget&) = delete;
318};
319
320VTK_ABI_NAMESPACE_END
321#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:133
a simple class to control print indentation
Definition vtkIndent.h:108
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO