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 "vtkAbstractWidget.h"
73 
75 
76 
78 {
79 public:
81  static vtkHandleWidget *New();
82 
84 
86  void PrintSelf(ostream& os, vtkIndent indent);
88 
90 
93  void SetRepresentation(vtkHandleRepresentation *r)
94  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
96 
98 
99  vtkHandleRepresentation *GetHandleRepresentation()
100  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
102 
106 
108 
111  vtkSetMacro( EnableAxisConstraint, int );
112  vtkGetMacro( EnableAxisConstraint, int );
113  vtkBooleanMacro( EnableAxisConstraint, int );
115 
117 
119  vtkSetMacro( AllowHandleResize, int );
120  vtkGetMacro( AllowHandleResize, int );
121  vtkBooleanMacro( AllowHandleResize, int );
123 
125 
126  vtkGetMacro( WidgetState, int );
128 
129  //BTX - manage the state of the widget
130  enum _WidgetState {Start=0,Active};
131  //ETX
132 
133 protected:
134  vtkHandleWidget();
135  ~vtkHandleWidget();
136 
137  // These are the callbacks for this widget
138  static void GenericAction(vtkHandleWidget*);
139  static void SelectAction(vtkAbstractWidget*);
140  static void EndSelectAction(vtkAbstractWidget*);
141  static void TranslateAction(vtkAbstractWidget*);
142  static void ScaleAction(vtkAbstractWidget*);
143  static void MoveAction(vtkAbstractWidget*);
144 
145  // helper methods for cursor management
146  void SetCursor(int state);
147 
150 
151  // Allow resizing of handles.
153 
154 private:
155  vtkHandleWidget(const vtkHandleWidget&); //Not implemented
156  void operator=(const vtkHandleWidget&); //Not implemented
157 };
158 
159 #endif