VTK  9.1.0
vtkDistanceWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDistanceWidget.h,v
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=========================================================================*/
88#ifndef vtkDistanceWidget_h
89#define vtkDistanceWidget_h
90
91#include "vtkAbstractWidget.h"
92#include "vtkInteractionWidgetsModule.h" // For export macro
93
95class vtkHandleWidget;
96class vtkDistanceWidgetCallback;
97
98class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceWidget : public vtkAbstractWidget
99{
100public:
105
107
111 void PrintSelf(ostream& os, vtkIndent indent) override;
113
119 void SetEnabled(int) override;
120
127 {
128 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
129 }
130
135 {
136 return reinterpret_cast<vtkDistanceRepresentation*>(this->WidgetRep);
137 }
138
143
149
157 enum
158 {
159 Start = 0,
161 Manipulate
162 };
163
165
175 virtual void SetWidgetStateToStart();
178
182 virtual int GetWidgetState() { return this->WidgetState; }
183
184protected:
187
188 // The state of the widget
191
192 // Callback interface to capture events when
193 // placing the widget.
200
201 // The positioning handle widgets
204 vtkDistanceWidgetCallback* DistanceWidgetCallback1;
205 vtkDistanceWidgetCallback* DistanceWidgetCallback2;
206
207 // Methods invoked when the handles at the
208 // end points of the widget are manipulated
209 void StartDistanceInteraction(int handleNum);
210 void DistanceInteraction(int handleNum);
211 void EndDistanceInteraction(int handleNum);
212
213 friend class vtkDistanceWidgetCallback;
214
215private:
216 vtkDistanceWidget(const vtkDistanceWidget&) = delete;
217 void operator=(const vtkDistanceWidget&) = delete;
218};
219
220#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:113
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69