VTK  9.3.0
vtkBiDimensionalWidget.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
94#ifndef vtkBiDimensionalWidget_h
95#define vtkBiDimensionalWidget_h
96
97#include "vtkAbstractWidget.h"
98#include "vtkInteractionWidgetsModule.h" // For export macro
99
100VTK_ABI_NAMESPACE_BEGIN
102class vtkHandleWidget;
103class vtkBiDimensionalWidgetCallback;
104
105class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
106{
107public:
112
114
118 void PrintSelf(ostream& os, vtkIndent indent) override;
120
126 void SetEnabled(int) override;
127
134 {
135 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
136 }
137
142 {
143 return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
144 }
145
150
156
160 enum
161 {
162 EndWidgetSelectEvent = 10050
163 };
164
170
177 enum
178 {
179 Start = 0,
181 Manipulate
182 };
183
185
195 virtual void SetWidgetStateToStart();
198
202 virtual int GetWidgetState() { return this->WidgetState; }
203
204protected:
207
208 // The state of the widget
218
219 // Callback interface to capture events when
220 // placing the widget.
224
225 // The positioning handle widgets
230 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
231 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
232 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
233 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
234
235 // Methods invoked when the handles at the
236 // end points of the widget are manipulated
239
240 friend class vtkBiDimensionalWidgetCallback;
241
242private:
244 void operator=(const vtkBiDimensionalWidget&) = delete;
245};
246
247VTK_ABI_NAMESPACE_END
248#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkBiDimensionalWidget
measure the bi-dimensional lengths of an object
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()
Return the representation as a vtkBiDimensionalRepresentation.
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
virtual int GetWidgetState()
Return the current widget state.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
static vtkBiDimensionalWidget * New()
Instantiate this class.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
static void EndSelectAction(vtkAbstractWidget *)
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
virtual void EndBiDimensionalInteraction()
virtual void SetWidgetStateToStart()
Set the state of the widget.
~vtkBiDimensionalWidget() override
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
int IsMeasureValid()
A flag indicates whether the bi-dimensional measure is valid.
void SetRepresentation(vtkBiDimensionalRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void SetEnabled(int) override
The method for activating and deactivating this widget.
static void MoveAction(vtkAbstractWidget *)
virtual void SetWidgetStateToManipulate()
Set the state of the widget.
static void AddPointAction(vtkAbstractWidget *)
void StartBiDimensionalInteraction()
a general widget for moving handles
a simple class to control print indentation
Definition vtkIndent.h:38
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64