VTK  9.3.20240425
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
156#ifndef vtkContourWidget_h
157#define vtkContourWidget_h
158
159#include "vtkAbstractWidget.h"
160#include "vtkInteractionWidgetsModule.h" // For export macro
161#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
162
163VTK_ABI_NAMESPACE_BEGIN
165class vtkPolyData;
166class vtkIdList;
167
168class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkContourWidget : public vtkAbstractWidget
169{
170public:
175
177
181 void PrintSelf(ostream& os, vtkIndent indent) override;
183
189 void SetEnabled(int) override;
190
197 {
198 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
199 }
200
205 {
206 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
207 }
208
213
217 void CloseLoop();
218
220
223 vtkSetMacro(WidgetState, int);
225
227
230 vtkGetMacro(WidgetState, int);
232
234
239 vtkGetMacro(AllowNodePicking, vtkTypeBool);
240 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
242
244
251 vtkSetMacro(FollowCursor, vtkTypeBool);
252 vtkGetMacro(FollowCursor, vtkTypeBool);
253 vtkBooleanMacro(FollowCursor, vtkTypeBool);
255
257
267 vtkSetMacro(ContinuousDraw, vtkTypeBool);
268 vtkGetMacro(ContinuousDraw, vtkTypeBool);
269 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
271
280 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
281 virtual void Initialize() { this->Initialize(nullptr); }
282
283 // The state of the widget
284
285 enum
286 {
289 Manipulate
290 };
291
292protected:
295
302
303 // Callback interface to capture events when
304 // placing the widget.
313
314 // Internal helper methods
316 void AddNode();
317
318private:
319 vtkContourWidget(const vtkContourWidget&) = delete;
320 void operator=(const vtkContourWidget&) = delete;
321};
322
323VTK_ABI_NAMESPACE_END
324#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: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