VTK  9.2.6
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=========================================================================*/
165#ifndef vtkContourWidget_h
166#define vtkContourWidget_h
167
168#include "vtkAbstractWidget.h"
169#include "vtkInteractionWidgetsModule.h" // For export macro
170
172class vtkPolyData;
173class vtkIdList;
174
175class VTKINTERACTIONWIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
176{
177public:
182
184
188 void PrintSelf(ostream& os, vtkIndent indent) override;
190
196 void SetEnabled(int) override;
197
204 {
205 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
206 }
207
212 {
213 return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);
214 }
215
220
224 void CloseLoop();
225
227
230 vtkSetMacro(WidgetState, int);
232
234
237 vtkGetMacro(WidgetState, int);
239
241
246 vtkGetMacro(AllowNodePicking, vtkTypeBool);
247 vtkBooleanMacro(AllowNodePicking, vtkTypeBool);
249
251
258 vtkSetMacro(FollowCursor, vtkTypeBool);
259 vtkGetMacro(FollowCursor, vtkTypeBool);
260 vtkBooleanMacro(FollowCursor, vtkTypeBool);
262
264
274 vtkSetMacro(ContinuousDraw, vtkTypeBool);
275 vtkGetMacro(ContinuousDraw, vtkTypeBool);
276 vtkBooleanMacro(ContinuousDraw, vtkTypeBool);
278
287 virtual void Initialize(vtkPolyData* poly, int state = 1, vtkIdList* idList = nullptr);
288 virtual void Initialize() { this->Initialize(nullptr); }
289
290 // The state of the widget
291
292 enum
293 {
296 Manipulate
297 };
298
299protected:
302
309
310 // Callback interface to capture events when
311 // placing the widget.
320
321 // Internal helper methods
323 void AddNode();
324
325private:
326 vtkContourWidget(const vtkContourWidget&) = delete;
327 void operator=(const vtkContourWidget&) = delete;
328};
329
330#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:143
a simple class to control print indentation
Definition: vtkIndent.h:119
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69