VTK  9.5.2
vtkDistanceWidget.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
62
63#ifndef vtkDistanceWidget_h
64#define vtkDistanceWidget_h
65
66#include "vtkAbstractWidget.h"
67#include "vtkInteractionWidgetsModule.h" // For export macro
68#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
69
70VTK_ABI_NAMESPACE_BEGIN
72class vtkHandleWidget;
73class vtkDistanceWidgetCallback;
74
75class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkDistanceWidget : public vtkAbstractWidget
76{
77public:
82
84
88 void PrintSelf(ostream& os, vtkIndent indent) override;
90
96 void SetEnabled(int) override;
97
107
115
120
126
133
134 enum
135 {
136 Start = 0,
139 };
140
142
152 virtual void SetWidgetStateToStart();
155
159 virtual int GetWidgetState() { return this->WidgetState; }
160
161protected:
164
165 // The state of the widget
168
169 // Callback interface to capture events when
170 // placing the widget.
177
178 // The positioning handle widgets
183
184 // Methods invoked when the handles at the
185 // end points of the widget are manipulated
186 void StartDistanceInteraction(int handleNum);
187 void DistanceInteraction(int handleNum);
188 void EndDistanceInteraction(int handleNum);
189
191
192private:
193 vtkDistanceWidget(const vtkDistanceWidget&) = delete;
194 void operator=(const vtkDistanceWidget&) = delete;
195};
196
197VTK_ABI_NAMESPACE_END
198#endif
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
vtkWidgetRepresentation * WidgetRep
represent the vtkDistanceWidget
friend class vtkDistanceWidgetCallback
virtual void SetWidgetStateToStart()
Set the state of the widget.
virtual int GetWidgetState()
Return the current widget state.
static void MoveAction3D(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
virtual void SetWidgetStateToManipulate()
Set the state of the widget.
vtkDistanceRepresentation * GetDistanceRepresentation()
Return the representation as a vtkDistanceRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
void SetRepresentation(vtkDistanceRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void EndDistanceInteraction(int handleNum)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
static void AddPointAction3D(vtkAbstractWidget *)
~vtkDistanceWidget() override
vtkHandleWidget * Point2Widget
void StartDistanceInteraction(int handleNum)
vtkHandleWidget * Point1Widget
vtkDistanceWidgetCallback * DistanceWidgetCallback1
void DistanceInteraction(int handleNum)
vtkDistanceWidgetCallback * DistanceWidgetCallback2
static vtkDistanceWidget * New()
Instantiate this class.
static void MoveAction(vtkAbstractWidget *)
void SetEnabled(int) override
The method for activating and deactivating this widget.
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
static void AddPointAction(vtkAbstractWidget *)
static void EndSelectAction3D(vtkAbstractWidget *)
a general widget for moving handles
a simple class to control print indentation
Definition vtkIndent.h:29
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO