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 =========================================================================*/
64 #ifndef vtkHandleWidget_h
65 #define vtkHandleWidget_h
66 
67 #include "vtkInteractionWidgetsModule.h" // For export macro
68 #include "vtkAbstractWidget.h"
69 
71 
72 
73 class VTKINTERACTIONWIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget
74 {
75 public:
79  static vtkHandleWidget *New();
80 
82 
86  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
95  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
96 
101  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
102 
107  void CreateDefaultRepresentation() override;
108 
110 
115  vtkSetMacro( EnableAxisConstraint, vtkTypeBool );
116  vtkGetMacro( EnableAxisConstraint, vtkTypeBool );
117  vtkBooleanMacro( EnableAxisConstraint, vtkTypeBool );
119 
121 
124  vtkSetMacro(EnableTranslation, vtkTypeBool);
125  vtkGetMacro(EnableTranslation, vtkTypeBool);
126  vtkBooleanMacro(EnableTranslation, vtkTypeBool);
128 
130 
134  vtkSetMacro( AllowHandleResize, vtkTypeBool );
135  vtkGetMacro( AllowHandleResize, vtkTypeBool );
136  vtkBooleanMacro( AllowHandleResize, vtkTypeBool );
138 
140 
143  vtkGetMacro( WidgetState, int );
145 
146  // Manage the state of the widget
147  enum _WidgetState {Start=0,Active};
148 
149 protected:
150  vtkHandleWidget();
151  ~vtkHandleWidget() override;
152 
153  // These are the callbacks for this widget
154  static void GenericAction(vtkHandleWidget*);
155  static void SelectAction(vtkAbstractWidget*);
156  static void EndSelectAction(vtkAbstractWidget*);
157  static void TranslateAction(vtkAbstractWidget*);
158  static void ScaleAction(vtkAbstractWidget*);
159  static void MoveAction(vtkAbstractWidget*);
160  static void SelectAction3D(vtkAbstractWidget*);
161  static void MoveAction3D(vtkAbstractWidget*);
162 
163  // helper methods for cursor management
164  void SetCursor(int state) override;
165 
169 
170  // Allow resizing of handles.
172 
173 private:
174  vtkHandleWidget(const vtkHandleWidget&) = delete;
175  void operator=(const vtkHandleWidget&) = delete;
176 };
177 
178 #endif
vtkTypeBool AllowHandleResize
virtual void SetCursor(int vtkNotUsed(state))
abstract class for representing widget handles
vtkTypeBool EnableTranslation
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
int vtkTypeBool
Definition: vtkABI.h:69
vtkHandleRepresentation * GetHandleRepresentation()
Return the representation as a vtkHandleRepresentation.
a simple class to control print indentation
Definition: vtkIndent.h:33
define the API for widget / widget representation
vtkTypeBool EnableAxisConstraint
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...