VTK
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 =========================================================================*/
95 #ifndef vtkImplicitPlaneWidget2_h
96 #define vtkImplicitPlaneWidget2_h
97 
98 #include "vtkInteractionWidgetsModule.h" // For export macro
99 #include "vtkAbstractWidget.h"
100 
102 class vtkInteractionCallback;
103 
104 class VTKINTERACTIONWIDGETS_EXPORT vtkImplicitPlaneWidget2 : public vtkAbstractWidget
105 {
106  friend class vtkInteractionCallback;
107 
108 public:
112  static vtkImplicitPlaneWidget2 *New();
113 
115 
119  void PrintSelf(ostream& os, vtkIndent indent) override;
121 
127  void SetRepresentation( vtkImplicitPlaneRepresentation *rep );
128 
129  // Description:
130  // Disable/Enable the widget if needed.
131  // Unobserved the camera if the widget is disabled.
132  void SetEnabled(int enabling) override;
133 
138  void SetLockNormalToCamera(int lock);
139 
144  {return reinterpret_cast<vtkImplicitPlaneRepresentation*>(this->WidgetRep);}
145 
149  void CreateDefaultRepresentation() override;
150 
151 protected:
153  ~vtkImplicitPlaneWidget2() override;
154 
155  // Manage the state of the widget
157  enum _WidgetState {Start=0,Active};
158 
159  // These methods handle events
160  static void SelectAction(vtkAbstractWidget*);
161  static void TranslateAction(vtkAbstractWidget*);
162  static void ScaleAction(vtkAbstractWidget*);
163  static void EndSelectAction(vtkAbstractWidget*);
164  static void MoveAction(vtkAbstractWidget*);
165  static void MovePlaneAction(vtkAbstractWidget*);
166  static void SelectAction3D(vtkAbstractWidget*);
167  static void EndSelectAction3D(vtkAbstractWidget*);
168  static void MoveAction3D(vtkAbstractWidget*);
169 
174  int UpdateCursorShape( int interactionState );
175 
177 
180  vtkInteractionCallback *InteractionCallback;
181  void InvokeInteractionCallback();
183 
184 private:
186  void operator=(const vtkImplicitPlaneWidget2&) = delete;
187 };
188 
189 #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:39
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...