VTK  9.0.1
vtkImplicitPlaneWidget2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitPlaneWidget2.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
98 #ifndef vtkImplicitPlaneWidget2_h
99 #define vtkImplicitPlaneWidget2_h
100 
101 #include "vtkAbstractWidget.h"
102 #include "vtkInteractionWidgetsModule.h" // For export macro
103 
105 class vtkInteractionCallback;
106 
107 class VTKINTERACTIONWIDGETS_EXPORT vtkImplicitPlaneWidget2 : public vtkAbstractWidget
108 {
109  friend class vtkInteractionCallback;
110 
111 public:
115  static vtkImplicitPlaneWidget2* New();
116 
118 
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 
147  {
148  return reinterpret_cast<vtkImplicitPlaneRepresentation*>(this->WidgetRep);
149  }
150 
154  void CreateDefaultRepresentation() override;
155 
156 protected:
158  ~vtkImplicitPlaneWidget2() override;
159 
160  // Manage the state of the widget
163  {
164  Start = 0,
165  Active
166  };
167 
168  // These methods handle events
169  static void SelectAction(vtkAbstractWidget*);
170  static void TranslateAction(vtkAbstractWidget*);
171  static void ScaleAction(vtkAbstractWidget*);
172  static void EndSelectAction(vtkAbstractWidget*);
173  static void MoveAction(vtkAbstractWidget*);
174  static void MovePlaneAction(vtkAbstractWidget*);
175  static void SelectAction3D(vtkAbstractWidget*);
176  static void EndSelectAction3D(vtkAbstractWidget*);
177  static void MoveAction3D(vtkAbstractWidget*);
178  static void TranslationAxisLock(vtkAbstractWidget*);
179  static void TranslationAxisUnLock(vtkAbstractWidget*);
180 
185  int UpdateCursorShape(int interactionState);
186 
188 
191  vtkInteractionCallback* InteractionCallback;
192  void InvokeInteractionCallback();
194 
195 private:
197  void operator=(const vtkImplicitPlaneWidget2&) = delete;
198 };
199 
200 #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:33
a class defining the representation for a vtkImplicitPlaneWidget2
vtkInteractionCallback * 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...