VTK  9.7.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
89 #ifndef vtkImplicitPlaneWidget2_h
90 #define vtkImplicitPlaneWidget2_h
91 
92 #include "vtkAbstractWidget.h"
93 #include "vtkInteractionWidgetsModule.h" // For export macro
94 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
95 
96 VTK_ABI_NAMESPACE_BEGIN
98 class vtkImplicitPlaneWidget2InteractionCallback;
99 
100 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkImplicitPlaneWidget2
101  : public vtkAbstractWidget
102 {
103  friend class vtkImplicitPlaneWidget2InteractionCallback;
104 
105 public:
109  static vtkImplicitPlaneWidget2* New();
110 
112 
116  void PrintSelf(ostream& os, vtkIndent indent) override;
118 
124  void SetRepresentation(vtkImplicitPlaneRepresentation* rep);
125 
126  // Description:
127  // Disable/Enable the widget if needed.
128  // Unobserved the camera if the widget is disabled.
129  void SetEnabled(int enabling) override;
130 
135  void SetLockNormalToCamera(int lock);
136 
141  {
142  return reinterpret_cast<vtkImplicitPlaneRepresentation*>(this->WidgetRep);
143  }
144 
148  void CreateDefaultRepresentation() override;
149 
150 protected:
152  ~vtkImplicitPlaneWidget2() override;
153 
154  // Manage the state of the widget
157  {
158  Start = 0,
159  Active
160  };
161 
162  // These methods handle events
163  static void SelectAction(vtkAbstractWidget*);
164  static void TranslateAction(vtkAbstractWidget*);
165  static void ScaleAction(vtkAbstractWidget*);
166  static void EndSelectAction(vtkAbstractWidget*);
167  static void MoveAction(vtkAbstractWidget*);
168  static void MovePlaneAction(vtkAbstractWidget*);
169  static void SelectAction3D(vtkAbstractWidget*);
170  static void EndSelectAction3D(vtkAbstractWidget*);
171  static void MoveAction3D(vtkAbstractWidget*);
172  static void TranslationAxisLock(vtkAbstractWidget*);
173  static void TranslationAxisUnLock(vtkAbstractWidget*);
174 
179  int UpdateCursorShape(int interactionState);
180 
182 
185  vtkImplicitPlaneWidget2InteractionCallback* InteractionCallback;
186  void InvokeInteractionCallback();
188 
189 private:
191  void operator=(const vtkImplicitPlaneWidget2&) = delete;
192 };
193 
194 VTK_ABI_NAMESPACE_END
195 #endif
3D widget for manipulating an infinite plane
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.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...