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) VTK_OVERRIDE;
88 
95  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
96 
101  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
102 
107  void CreateDefaultRepresentation() VTK_OVERRIDE;
108 
110 
115  vtkSetMacro( EnableAxisConstraint, int );
116  vtkGetMacro( EnableAxisConstraint, int );
117  vtkBooleanMacro( EnableAxisConstraint, int );
119 
121 
125  vtkSetMacro( AllowHandleResize, int );
126  vtkGetMacro( AllowHandleResize, int );
127  vtkBooleanMacro( AllowHandleResize, int );
129 
131 
134  vtkGetMacro( WidgetState, int );
136 
137  // Manage the state of the widget
138  enum _WidgetState {Start=0,Active};
139 
140 protected:
141  vtkHandleWidget();
142  ~vtkHandleWidget() VTK_OVERRIDE;
143 
144  // These are the callbacks for this widget
145  static void GenericAction(vtkHandleWidget*);
146  static void SelectAction(vtkAbstractWidget*);
147  static void EndSelectAction(vtkAbstractWidget*);
148  static void TranslateAction(vtkAbstractWidget*);
149  static void ScaleAction(vtkAbstractWidget*);
150  static void MoveAction(vtkAbstractWidget*);
151 
152  // helper methods for cursor management
153  void SetCursor(int state) VTK_OVERRIDE;
154 
155  int WidgetState;
156  int EnableAxisConstraint;
157 
158  // Allow resizing of handles.
159  int AllowHandleResize;
160 
161 private:
162  vtkHandleWidget(const vtkHandleWidget&) VTK_DELETE_FUNCTION;
163  void operator=(const vtkHandleWidget&) VTK_DELETE_FUNCTION;
164 };
165 
166 #endif
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:33
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...