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
86 #ifndef vtkImplicitPlaneWidget2_h
87 #define vtkImplicitPlaneWidget2_h
88 
89 #include "vtkAbstractWidget.h"
90 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
91 #include "vtkInteractionWidgetsModule.h" // For export macro
92 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
93 
94 VTK_ABI_NAMESPACE_BEGIN
96 class vtkImplicitPlaneWidget2InteractionCallback;
97 
98 class VTKINTERACTIONWIDGETS_EXPORT vtkImplicitPlaneWidget2 : public vtkAbstractWidget
99 {
100  friend class vtkImplicitPlaneWidget2InteractionCallback;
101 
102 public:
106  static vtkImplicitPlaneWidget2* New();
107 
109 
113  void PrintSelf(ostream& os, vtkIndent indent) override;
115 
121  void SetRepresentation(vtkImplicitPlaneRepresentation* rep);
122 
123  // Description:
124  // Disable/Enable the widget if needed.
125  // Unobserved the camera if the widget is disabled.
126  void SetEnabled(int enabling) override;
127 
132  void SetLockNormalToCamera(int lock);
133 
138  {
139  return reinterpret_cast<vtkImplicitPlaneRepresentation*>(this->WidgetRep);
140  }
141 
145  void CreateDefaultRepresentation() override;
146 
147 protected:
149  ~vtkImplicitPlaneWidget2() override;
150 
151  // Manage the state of the widget
154  {
155  Start = 0,
156  Active
157  };
158 #if !defined(VTK_LEGACY_REMOVE)
159  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
161 #endif
162 
163  // These methods handle events
164  static void SelectAction(vtkAbstractWidget*);
165  static void TranslateAction(vtkAbstractWidget*);
166  static void ScaleAction(vtkAbstractWidget*);
167  static void EndSelectAction(vtkAbstractWidget*);
168  static void MoveAction(vtkAbstractWidget*);
169  static void MovePlaneAction(vtkAbstractWidget*);
170  static void SelectAction3D(vtkAbstractWidget*);
171  static void EndSelectAction3D(vtkAbstractWidget*);
172  static void MoveAction3D(vtkAbstractWidget*);
173  static void TranslationAxisLock(vtkAbstractWidget*);
174  static void TranslationAxisUnLock(vtkAbstractWidget*);
175 
180  int UpdateCursorShape(int interactionState);
181 
183 
186  vtkImplicitPlaneWidget2InteractionCallback* InteractionCallback;
187  void InvokeInteractionCallback();
189 
190 private:
192  void operator=(const vtkImplicitPlaneWidget2&) = delete;
193 };
194 
195 VTK_ABI_NAMESPACE_END
196 #endif
3D widget for manipulating an infinite plane
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkWidgetRepresentation * WidgetRep
vtkImplicitPlaneRepresentation * GetImplicitPlaneRepresentation()
Return the representation as a vtkImplicitPlaneRepresentation.
a simple class to control print indentation
Definition: vtkIndent.h:28
a class defining the representation for a vtkImplicitPlaneWidget2
vtkImplicitPlaneWidget2InteractionCallback * InteractionCallback
Handle the interaction callback that may come from the representation.
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...