VTK  9.4.20241108
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
107#ifndef vtkBiDimensionalWidget_h
108#define vtkBiDimensionalWidget_h
109
110#include "vtkAbstractWidget.h"
111#include "vtkInteractionWidgetsModule.h" // For export macro
112#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
113
114VTK_ABI_NAMESPACE_BEGIN
116class vtkHandleWidget;
117class vtkBiDimensionalWidgetCallback;
118
119class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBiDimensionalWidget : public vtkAbstractWidget
120{
121public:
126
128
132 void PrintSelf(ostream& os, vtkIndent indent) override;
134
140 void SetEnabled(int) override;
141
148 {
149 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
150 }
151
156 {
157 return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
158 }
159
164
170
174 enum
175 {
176 EndWidgetSelectEvent = 10050
177 };
178
184
191 enum
192 {
193 Start = 0,
195 Manipulate
196 };
197
199
209 virtual void SetWidgetStateToStart();
212
216 virtual int GetWidgetState() { return this->WidgetState; }
217
218protected:
221
222 // The state of the widget
232
233 // Callback interface to capture events when
234 // placing the widget.
238
239 // The positioning handle widgets
244 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
245 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
246 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
247 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
248
249 // Methods invoked when the handles at the
250 // end points of the widget are manipulated
253
254 friend class vtkBiDimensionalWidgetCallback;
255
256private:
258 void operator=(const vtkBiDimensionalWidget&) = delete;
259};
260
261VTK_ABI_NAMESPACE_END
262#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:108
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO