VTK
vtkHandleWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHandleWidget.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 =========================================================================*/
67 #ifndef vtkHandleWidget_h
68 #define vtkHandleWidget_h
69 
70 #include "vtkInteractionWidgetsModule.h" // For export macro
71 #include "vtkAbstractWidget.h"
72 
74 
75 
76 class VTKINTERACTIONWIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget
77 {
78 public:
82  static vtkHandleWidget *New();
83 
85 
89  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
98  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
99 
104  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
105 
110  void CreateDefaultRepresentation() override;
111 
113 
118  vtkSetMacro( EnableAxisConstraint, int );
119  vtkGetMacro( EnableAxisConstraint, int );
120  vtkBooleanMacro( EnableAxisConstraint, int );
122 
124 
127  vtkSetMacro(EnableTranslation, int);
128  vtkGetMacro(EnableTranslation, int);
129  vtkBooleanMacro(EnableTranslation, int);
131 
133 
137  vtkSetMacro( AllowHandleResize, int );
138  vtkGetMacro( AllowHandleResize, int );
139  vtkBooleanMacro( AllowHandleResize, int );
141 
143 
146  vtkGetMacro( WidgetState, int );
148 
149  // Manage the state of the widget
150  enum _WidgetState {Start=0,Active};
151 
152 protected:
153  vtkHandleWidget();
154  ~vtkHandleWidget() override;
155 
156  // These are the callbacks for this widget
157  static void GenericAction(vtkHandleWidget*);
158  static void SelectAction(vtkAbstractWidget*);
159  static void EndSelectAction(vtkAbstractWidget*);
160  static void TranslateAction(vtkAbstractWidget*);
161  static void ScaleAction(vtkAbstractWidget*);
162  static void MoveAction(vtkAbstractWidget*);
163  static void SelectAction3D(vtkAbstractWidget*);
164  static void MoveAction3D(vtkAbstractWidget*);
165 
166  // helper methods for cursor management
167  void SetCursor(int state) override;
168 
172 
173  // Allow resizing of handles.
175 
176 private:
177  vtkHandleWidget(const vtkHandleWidget&) = delete;
178  void operator=(const vtkHandleWidget&) = delete;
179 };
180 
181 #endif
virtual void SetCursor(int vtkNotUsed(state))
abstract class for representing widget handles
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
void SetRepresentation(vtkHandleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkWidgetRepresentation * WidgetRep
vtkHandleRepresentation * GetHandleRepresentation()
Return the representation as a vtkHandleRepresentation.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
define the API for widget / widget representation
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...