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=========================================================================*/
162#ifndef vtkContourWidget_h
163#define vtkContourWidget_h
164
165#include "vtkAbstractWidget.h"
166#include "vtkInteractionWidgetsModule.h" // For export macro
167
169class vtkPolyData;
170class vtkIdList;
171
172class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
173{
174public:
179
181
185 void PrintSelf(ostream& os, vtkIndent indent) override;
187
193 void SetEnabled(int) override;
194
201 {
202 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
203 }
204
209 {
210 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
211 }
212
217
221 void CloseLoop();
222
224
227 vtkSetMacro(WidgetState, int);
229
231
234 vtkGetMacro(WidgetState, int);
236
238
243 vtkGetMacro(AllowNodePicking, vtkTypeBool);
244 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
246
248
255 vtkSetMacro(FollowCursor, vtkTypeBool);
256 vtkGetMacro(FollowCursor, vtkTypeBool);
257 vtkBooleanMacro(FollowCursor, vtkTypeBool);
259
261
271 vtkSetMacro(ContinuousDraw, vtkTypeBool);
272 vtkGetMacro(ContinuousDraw, vtkTypeBool);
273 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
275
284 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
285 virtual void Initialize() { this->Initialize(nullptr); }
286
287 // The state of the widget
288
289 enum
290 {
293 Manipulate
294 };
295
296protected:
299
306
307 // Callback interface to capture events when
308 // placing the widget.
317
318 // Internal helper methods
320 void AddNode();
321
322private:
323 vtkContourWidget(const vtkContourWidget&) = delete;
324 void operator=(const vtkContourWidget&) = delete;
325};
326
327#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:140
a simple class to control print indentation
Definition: vtkIndent.h:113
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69