VTK: Interaction/Widgets/vtkImplicitPlaneWidget2.h Source File

| VTK 9.3.1

vtkImplicitPlaneWidget2.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
95 #ifndef vtkImplicitPlaneWidget2_h
96 #define vtkImplicitPlaneWidget2_h
97
98 #include "vtkAbstractWidget.h"
99 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
100 #include "vtkInteractionWidgetsModule.h" // For export macro
101 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
102
103 VTK_ABI_NAMESPACE_BEGIN
104 class vtkImplicitPlaneRepresentation;
105 class vtkImplicitPlaneWidget2InteractionCallback;
106
107 class VTKINTERACTIONWIDGETS_EXPORT vtkImplicitPlaneWidget2 : public vtkAbstractWidget
108 {
109 friend class vtkImplicitPlaneWidget2InteractionCallback;
110
111 public:
115 static vtkImplicitPlaneWidget2* New();
116
118
121 vtkTypeMacro(vtkImplicitPlaneWidget2, vtkAbstractWidget);
122 void PrintSelf(ostream& os, vtkIndent indent) override;
124
130 void SetRepresentation(vtkImplicitPlaneRepresentation* rep);
131
132 // Description:
133 // Disable/Enable the widget if needed.
134 // Unobserved the camera if the widget is disabled.
135 void SetEnabled(int enabling) override;
136
141 void SetLockNormalToCamera(int lock);
142
146 vtkImplicitPlaneRepresentation* GetImplicitPlaneRepresentation()
147 {
148 return reinterpret_cast<vtkImplicitPlaneRepresentation*>(this->WidgetRep);
149 }
150
154 void CreateDefaultRepresentation() override;
155
156 protected:
157 vtkImplicitPlaneWidget2();
158 ~vtkImplicitPlaneWidget2() override;
159
160 // Manage the state of the widget
161 int WidgetState;
162 enum WidgetStateType
163 {
164 Start = 0,
165 Active
166 };
167 #if !defined(VTK_LEGACY_REMOVE)
168 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
169 typedef WidgetStateType _WidgetState;
170 #endif
171
172 // These methods handle events
173 static void SelectAction(vtkAbstractWidget*);
174 static void TranslateAction(vtkAbstractWidget*);
175 static void ScaleAction(vtkAbstractWidget*);
176 static void EndSelectAction(vtkAbstractWidget*);
177 static void MoveAction(vtkAbstractWidget*);
178 static void MovePlaneAction(vtkAbstractWidget*);
179 static void SelectAction3D(vtkAbstractWidget*);
180 static void EndSelectAction3D(vtkAbstractWidget*);
181 static void MoveAction3D(vtkAbstractWidget*);
182 static void TranslationAxisLock(vtkAbstractWidget*);
183 static void TranslationAxisUnLock(vtkAbstractWidget*);
184
189 int UpdateCursorShape(int interactionState);
190
192
195 vtkImplicitPlaneWidget2InteractionCallback* InteractionCallback;
196 void InvokeInteractionCallback();
198
199 private:
200 vtkImplicitPlaneWidget2(const vtkImplicitPlaneWidget2&) = delete;
201 void operator=(const vtkImplicitPlaneWidget2&) = delete;
202 };
203
204 VTK_ABI_NAMESPACE_END
205 #endif
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:178
vtkImplicitPlaneRepresentation
a class defining the representation for a vtkImplicitPlaneWidget2
Definition: vtkImplicitPlaneRepresentation.h:68
vtkImplicitPlaneWidget2
3D widget for manipulating an infinite plane
Definition: vtkImplicitPlaneWidget2.h:108
vtkImplicitPlaneWidget2::UpdateCursorShape
int UpdateCursorShape(int interactionState)
Update the cursor shape based on the interaction state.
vtkImplicitPlaneWidget2::TranslationAxisLock
static void TranslationAxisLock(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::SetEnabled
void SetEnabled(int enabling) override
Methods for activating this widget.
vtkImplicitPlaneWidget2::MoveAction3D
static void MoveAction3D(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::InteractionCallback
vtkImplicitPlaneWidget2InteractionCallback * InteractionCallback
Handle the interaction callback that may come from the representation.
Definition: vtkImplicitPlaneWidget2.h:195
vtkImplicitPlaneWidget2::TranslationAxisUnLock
static void TranslationAxisUnLock(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::WidgetState
int WidgetState
Definition: vtkImplicitPlaneWidget2.h:161
vtkImplicitPlaneWidget2::TranslateAction
static void TranslateAction(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::SetLockNormalToCamera
void SetLockNormalToCamera(int lock)
Observe/Unobserve the camera if the widget is locked/unlocked to update the vtkImplicitePlaneRepresen...
vtkImplicitPlaneWidget2::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::EndSelectAction3D
static void EndSelectAction3D(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkImplicitPlaneWidget2::SelectAction3D
static void SelectAction3D(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard vtkObject methods.
vtkImplicitPlaneWidget2::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::New
static vtkImplicitPlaneWidget2 * New()
Instantiate the object.
vtkImplicitPlaneWidget2::MovePlaneAction
static void MovePlaneAction(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkImplicitPlaneWidget2::WidgetStateType
WidgetStateType
Definition: vtkImplicitPlaneWidget2.h:163
vtkImplicitPlaneWidget2::SetRepresentation
void SetRepresentation(vtkImplicitPlaneRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkImplicitPlaneWidget2::GetImplicitPlaneRepresentation
vtkImplicitPlaneRepresentation * GetImplicitPlaneRepresentation()
Return the representation as a vtkImplicitPlaneRepresentation.
Definition: vtkImplicitPlaneWidget2.h:146
vtkImplicitPlaneWidget2::~vtkImplicitPlaneWidget2
~vtkImplicitPlaneWidget2() override
vtkImplicitPlaneWidget2::InvokeInteractionCallback
void InvokeInteractionCallback()
Handle the interaction callback that may come from the representation.
vtkImplicitPlaneWidget2::vtkImplicitPlaneWidget2
vtkImplicitPlaneWidget2()
vtkImplicitPlaneWidget2::ScaleAction
static void ScaleAction(vtkAbstractWidget *)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkAbstractWidget.h
vtkDeprecation.h
VTK_DEPRECATED_IN_9_2_0
#define VTK_DEPRECATED_IN_9_2_0(reason)
Definition: vtkDeprecation.h:108