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  // Manage the state of the widget
131  enum _WidgetState {Start=0,Active};
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
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()