VTK: Interaction/Widgets/vtkBiDimensionalWidget.h Source File

| VTK 9.3.1

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
97 #ifndef vtkBiDimensionalWidget_h
98 #define vtkBiDimensionalWidget_h
99
100 #include "vtkAbstractWidget.h"
101 #include "vtkInteractionWidgetsModule.h" // For export macro
102
103 VTK_ABI_NAMESPACE_BEGIN
104 class vtkBiDimensionalRepresentation;
105 class vtkHandleWidget;
106 class vtkBiDimensionalWidgetCallback;
107
108 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
109 {
110 public:
114 static vtkBiDimensionalWidget* New();
115
117
120 vtkTypeMacro(vtkBiDimensionalWidget, vtkAbstractWidget);
121 void PrintSelf(ostream& os, vtkIndent indent) override;
123
129 void SetEnabled(int) override;
130
136 void SetRepresentation(vtkBiDimensionalRepresentation* r)
137 {
138 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
139 }
140
144 vtkBiDimensionalRepresentation* GetBiDimensionalRepresentation()
145 {
146 return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
147 }
148
152 void CreateDefaultRepresentation() override;
153
158 int IsMeasureValid();
159
163 enum
164 {
165 EndWidgetSelectEvent = 10050
166 };
167
172 void SetProcessEvents(vtkTypeBool) override;
173
180 enum
181 {
182 Start = 0,
183 Define,
184 Manipulate
185 };
186
188
198 virtual void SetWidgetStateToStart();
199 virtual void SetWidgetStateToManipulate();
201
205 virtual int GetWidgetState() { return this->WidgetState; }
206
207 protected:
208 vtkBiDimensionalWidget();
209 ~vtkBiDimensionalWidget() override;
210
211 // The state of the widget
212 int WidgetState;
213 int CurrentHandle;
214 int HandleLine1Selected;
215 int HandleLine2Selected;
216 int Line1InnerSelected;
217 int Line1OuterSelected;
218 int Line2InnerSelected;
219 int Line2OuterSelected;
220 int CenterSelected;
221
222 // Callback interface to capture events when
223 // placing the widget.
224 static void AddPointAction(vtkAbstractWidget*);
225 static void MoveAction(vtkAbstractWidget*);
226 static void EndSelectAction(vtkAbstractWidget*);
227
228 // The positioning handle widgets
229 vtkHandleWidget* Point1Widget;
230 vtkHandleWidget* Point2Widget;
231 vtkHandleWidget* Point3Widget;
232 vtkHandleWidget* Point4Widget;
233 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
234 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
235 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
236 vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
237
238 // Methods invoked when the handles at the
239 // end points of the widget are manipulated
240 void StartBiDimensionalInteraction();
241 virtual void EndBiDimensionalInteraction();
242
243 friend class vtkBiDimensionalWidgetCallback;
244
245 private:
246 vtkBiDimensionalWidget(const vtkBiDimensionalWidget&) = delete;
247 void operator=(const vtkBiDimensionalWidget&) = delete;
248 };
249
250 VTK_ABI_NAMESPACE_END
251 #endif
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:178
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:41
vtkBiDimensionalWidget
measure the bi-dimensional lengths of an object
Definition: vtkBiDimensionalWidget.h:109
vtkBiDimensionalWidget::HandleLine2Selected
int HandleLine2Selected
Definition: vtkBiDimensionalWidget.h:215
vtkBiDimensionalWidget::Point2Widget
vtkHandleWidget * Point2Widget
Definition: vtkBiDimensionalWidget.h:230
vtkBiDimensionalWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkBiDimensionalWidget::GetWidgetState
virtual int GetWidgetState()
Return the current widget state.
Definition: vtkBiDimensionalWidget.h:205
vtkBiDimensionalWidget::CenterSelected
int CenterSelected
Definition: vtkBiDimensionalWidget.h:220
vtkBiDimensionalWidget::Line1OuterSelected
int Line1OuterSelected
Definition: vtkBiDimensionalWidget.h:217
vtkBiDimensionalWidget::Point1Widget
vtkHandleWidget * Point1Widget
Definition: vtkBiDimensionalWidget.h:229
vtkBiDimensionalWidget::BiDimensionalWidgetCallback1
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
Definition: vtkBiDimensionalWidget.h:233
vtkBiDimensionalWidget::GetBiDimensionalRepresentation
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()
Return the representation as a vtkBiDimensionalRepresentation.
Definition: vtkBiDimensionalWidget.h:144
vtkBiDimensionalWidget::WidgetState
int WidgetState
Definition: vtkBiDimensionalWidget.h:212
vtkBiDimensionalWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
vtkBiDimensionalWidget::SetProcessEvents
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkBiDimensionalWidget::Define
@ Define
Definition: vtkBiDimensionalWidget.h:183
vtkBiDimensionalWidget::vtkBiDimensionalWidget
vtkBiDimensionalWidget()
vtkBiDimensionalWidget::BiDimensionalWidgetCallback3
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
Definition: vtkBiDimensionalWidget.h:235
vtkBiDimensionalWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkBiDimensionalWidget::BiDimensionalWidgetCallback4
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
Definition: vtkBiDimensionalWidget.h:236
vtkBiDimensionalWidget::EndBiDimensionalInteraction
virtual void EndBiDimensionalInteraction()
vtkBiDimensionalWidget::SetWidgetStateToStart
virtual void SetWidgetStateToStart()
Set the state of the widget.
vtkBiDimensionalWidget::CurrentHandle
int CurrentHandle
Definition: vtkBiDimensionalWidget.h:213
vtkBiDimensionalWidget::~vtkBiDimensionalWidget
~vtkBiDimensionalWidget() override
vtkBiDimensionalWidget::Line1InnerSelected
int Line1InnerSelected
Definition: vtkBiDimensionalWidget.h:216
vtkBiDimensionalWidget::BiDimensionalWidgetCallback2
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
Definition: vtkBiDimensionalWidget.h:234
vtkBiDimensionalWidget::IsMeasureValid
int IsMeasureValid()
A flag indicates whether the bi-dimensional measure is valid.
vtkBiDimensionalWidget::SetRepresentation
void SetRepresentation(vtkBiDimensionalRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkBiDimensionalWidget.h:136
vtkBiDimensionalWidget::Line2InnerSelected
int Line2InnerSelected
Definition: vtkBiDimensionalWidget.h:218
vtkBiDimensionalWidget::SetEnabled
void SetEnabled(int) override
The method for activating and deactivating this widget.
vtkBiDimensionalWidget::Line2OuterSelected
int Line2OuterSelected
Definition: vtkBiDimensionalWidget.h:219
vtkBiDimensionalWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkBiDimensionalWidget::SetWidgetStateToManipulate
virtual void SetWidgetStateToManipulate()
Set the state of the widget.
vtkBiDimensionalWidget::Point4Widget
vtkHandleWidget * Point4Widget
Definition: vtkBiDimensionalWidget.h:232
vtkBiDimensionalWidget::New
static vtkBiDimensionalWidget * New()
Instantiate this class.
vtkBiDimensionalWidget::HandleLine1Selected
int HandleLine1Selected
Definition: vtkBiDimensionalWidget.h:214
vtkBiDimensionalWidget::AddPointAction
static void AddPointAction(vtkAbstractWidget *)
vtkBiDimensionalWidget::StartBiDimensionalInteraction
void StartBiDimensionalInteraction()
vtkBiDimensionalWidget::Point3Widget
vtkHandleWidget * Point3Widget
Definition: vtkBiDimensionalWidget.h:231
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:70
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:65
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkAbstractWidget.h