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);
91 
98  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
99 
104  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
105 
111 
113 
118  vtkSetMacro( EnableAxisConstraint, int );
119  vtkGetMacro( EnableAxisConstraint, int );
120  vtkBooleanMacro( EnableAxisConstraint, int );
122 
124 
128  vtkSetMacro( AllowHandleResize, int );
129  vtkGetMacro( AllowHandleResize, int );
130  vtkBooleanMacro( AllowHandleResize, int );
132 
134 
137  vtkGetMacro( WidgetState, int );
139 
140  // Manage the state of the widget
141  enum _WidgetState {Start=0,Active};
142 
143 protected:
144  vtkHandleWidget();
145  ~vtkHandleWidget();
146 
147  // These are the callbacks for this widget
148  static void GenericAction(vtkHandleWidget*);
149  static void SelectAction(vtkAbstractWidget*);
150  static void EndSelectAction(vtkAbstractWidget*);
151  static void TranslateAction(vtkAbstractWidget*);
152  static void ScaleAction(vtkAbstractWidget*);
153  static void MoveAction(vtkAbstractWidget*);
154 
155  // helper methods for cursor management
156  void SetCursor(int state);
157 
160 
161  // Allow resizing of handles.
163 
164 private:
165  vtkHandleWidget(const vtkHandleWidget&) VTK_DELETE_FUNCTION;
166  void operator=(const vtkHandleWidget&) VTK_DELETE_FUNCTION;
167 };
168 
169 #endif
vtkHandleWidget::WidgetState
int WidgetState
Definition: vtkHandleWidget.h:158
vtkAbstractWidget::SetCursor
virtual void SetCursor(int vtkNotUsed(state))
Definition: vtkAbstractWidget.h:178
vtkHandleWidget::_WidgetState
_WidgetState
Definition: vtkHandleWidget.h:141
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:76
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkHandleWidget::SetRepresentation
void SetRepresentation(vtkHandleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkHandleWidget.h:97
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:63
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkHandleWidget::EnableAxisConstraint
int EnableAxisConstraint
Definition: vtkHandleWidget.h:159
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkHandleWidget::AllowHandleResize
int AllowHandleResize
Definition: vtkHandleWidget.h:162
vtkHandleWidget::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation()
Return the representation as a vtkHandleRepresentation.
Definition: vtkHandleWidget.h:103