VTK  9.3.0
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
63#ifndef vtkDistanceWidget_h
64#define vtkDistanceWidget_h
65
66#include "vtkAbstractWidget.h"
67#include "vtkInteractionWidgetsModule.h" // For export macro
68
69VTK_ABI_NAMESPACE_BEGIN
71class vtkHandleWidget;
72class vtkDistanceWidgetCallback;
73
74class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceWidget : public vtkAbstractWidget
75{
76public:
81
83
87 void PrintSelf(ostream& os, vtkIndent indent) override;
89
95 void SetEnabled(int) override;
96
103 {
104 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
105 }
106
111 {
112 return reinterpret_cast<vtkDistanceRepresentation*>(this->WidgetRep);
113 }
114
119
125
133 enum
134 {
135 Start = 0,
137 Manipulate
138 };
139
141
151 virtual void SetWidgetStateToStart();
154
158 virtual int GetWidgetState() { return this->WidgetState; }
159
160protected:
163
164 // The state of the widget
167
168 // Callback interface to capture events when
169 // placing the widget.
176
177 // The positioning handle widgets
180 vtkDistanceWidgetCallback* DistanceWidgetCallback1;
181 vtkDistanceWidgetCallback* DistanceWidgetCallback2;
182
183 // Methods invoked when the handles at the
184 // end points of the widget are manipulated
185 void StartDistanceInteraction(int handleNum);
186 void DistanceInteraction(int handleNum);
187 void EndDistanceInteraction(int handleNum);
188
189 friend class vtkDistanceWidgetCallback;
190
191private:
192 vtkDistanceWidget(const vtkDistanceWidget&) = delete;
193 void operator=(const vtkDistanceWidget&) = delete;
194};
195
196VTK_ABI_NAMESPACE_END
197#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkDistanceWidget
measure the distance between two points
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