VTK  9.1.0
vtkContourWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkContourWidget.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
129#ifndef vtkContourWidget_h
130#define vtkContourWidget_h
131
132#include "vtkAbstractWidget.h"
133#include "vtkInteractionWidgetsModule.h" // For export macro
134
136class vtkPolyData;
137class vtkIdList;
138
139class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
140{
141public:
146
148
152 void PrintSelf(ostream& os, vtkIndent indent) override;
154
160 void SetEnabled(int) override;
161
168 {
169 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
170 }
171
176 {
177 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
178 }
179
184
188 void CloseLoop();
189
191
194 vtkSetMacro(WidgetState, int);
196
198
201 vtkGetMacro(WidgetState, int);
203
205
210 vtkGetMacro(AllowNodePicking, vtkTypeBool);
211 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
213
215
222 vtkSetMacro(FollowCursor, vtkTypeBool);
223 vtkGetMacro(FollowCursor, vtkTypeBool);
224 vtkBooleanMacro(FollowCursor, vtkTypeBool);
226
228
238 vtkSetMacro(ContinuousDraw, vtkTypeBool);
239 vtkGetMacro(ContinuousDraw, vtkTypeBool);
240 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
242
251 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
252 virtual void Initialize() { this->Initialize(nullptr); }
253
254 // The state of the widget
255
256 enum
257 {
260 Manipulate
261 };
262
263protected:
266
273
274 // Callback interface to capture events when
275 // placing the widget.
284
285 // Internal helper methods
287 void AddNode();
288
289private:
290 vtkContourWidget(const vtkContourWidget&) = delete;
291 void operator=(const vtkContourWidget&) = delete;
292};
293
294#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:31
a simple class to control print indentation
Definition: vtkIndent.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69