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 =========================================================================*/
69 #ifndef vtkHandleWidget_h
70 #define vtkHandleWidget_h
71 
72 #include "vtkInteractionWidgetsModule.h" // For export macro
73 #include "vtkAbstractWidget.h"
74 
76 
77 
79 {
80 public:
82  static vtkHandleWidget *New();
83 
85 
87  void PrintSelf(ostream& os, vtkIndent indent);
89 
91 
95  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
97 
99 
101  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
103 
107 
109 
112  vtkSetMacro( EnableAxisConstraint, int );
113  vtkGetMacro( EnableAxisConstraint, int );
114  vtkBooleanMacro( EnableAxisConstraint, int );
116 
118 
120  vtkSetMacro( AllowHandleResize, int );
121  vtkGetMacro( AllowHandleResize, int );
122  vtkBooleanMacro( AllowHandleResize, int );
124 
126 
127  vtkGetMacro( WidgetState, int );
129 
130  //BTX - manage the state of the widget
131  enum _WidgetState {Start=0,Active};
132  //ETX
133 
134 protected:
135  vtkHandleWidget();
136  ~vtkHandleWidget();
137 
138  // These are the callbacks for this widget
139  static void GenericAction(vtkHandleWidget*);
140  static void SelectAction(vtkAbstractWidget*);
141  static void EndSelectAction(vtkAbstractWidget*);
142  static void TranslateAction(vtkAbstractWidget*);
143  static void ScaleAction(vtkAbstractWidget*);
144  static void MoveAction(vtkAbstractWidget*);
145 
146  // helper methods for cursor management
147  void SetCursor(int state);
148 
151 
152  // Allow resizing of handles.
154 
155 private:
156  vtkHandleWidget(const vtkHandleWidget&); //Not implemented
157  void operator=(const vtkHandleWidget&); //Not implemented
158 };
159 
160 #endif
void PrintSelf(ostream &os, vtkIndent indent)
virtual void SetCursor(int vtkNotUsed(state))
abstract class for representing widget handles
a general widget for moving handles
void SetRepresentation(vtkHandleRepresentation *r)
virtual void CreateDefaultRepresentation()=0
vtkWidgetRepresentation * WidgetRep
vtkHandleRepresentation * GetHandleRepresentation()
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
define the API for widget / widget representation
static vtkObject * New()