VTK  9.3.0
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
114#ifndef vtkContourWidget_h
115#define vtkContourWidget_h
116
117#include "vtkAbstractWidget.h"
118#include "vtkInteractionWidgetsModule.h" // For export macro
119
120VTK_ABI_NAMESPACE_BEGIN
122class vtkPolyData;
123class vtkIdList;
124
125class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
126{
127public:
132
134
138 void PrintSelf(ostream& os, vtkIndent indent) override;
140
146 void SetEnabled(int) override;
147
154 {
155 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
156 }
157
162 {
163 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
164 }
165
170
174 void CloseLoop();
175
177
180 vtkSetMacro(WidgetState, int);
182
184
187 vtkGetMacro(WidgetState, int);
189
191
196 vtkGetMacro(AllowNodePicking, vtkTypeBool);
197 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
199
201
208 vtkSetMacro(FollowCursor, vtkTypeBool);
209 vtkGetMacro(FollowCursor, vtkTypeBool);
210 vtkBooleanMacro(FollowCursor, vtkTypeBool);
212
214
224 vtkSetMacro(ContinuousDraw, vtkTypeBool);
225 vtkGetMacro(ContinuousDraw, vtkTypeBool);
226 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
228
237 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
238 virtual void Initialize() { this->Initialize(nullptr); }
239
240 // The state of the widget
241
242 enum
243 {
246 Manipulate
247 };
248
249protected:
252
259
260 // Callback interface to capture events when
261 // placing the widget.
270
271 // Internal helper methods
273 void AddNode();
274
275private:
276 vtkContourWidget(const vtkContourWidget&) = delete;
277 void operator=(const vtkContourWidget&) = delete;
278};
279
280VTK_ABI_NAMESPACE_END
281#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 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:23
a simple class to control print indentation
Definition vtkIndent.h:29
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64