VTK
vtkDistanceWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDistanceWidget.h,v
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 =========================================================================*/
77 #ifndef __vtkDistanceWidget_h
78 #define __vtkDistanceWidget_h
79 
80 #include "vtkAbstractWidget.h"
81 
83 class vtkHandleWidget;
84 class vtkDistanceWidgetCallback;
85 
86 
88 {
89 public:
91  static vtkDistanceWidget *New();
92 
94 
96  void PrintSelf(ostream& os, vtkIndent indent);
98 
102  virtual void SetEnabled(int);
103 
105 
108  void SetRepresentation(vtkDistanceRepresentation *r)
109  {this->Superclass::SetWidgetRepresentation(
110  reinterpret_cast<vtkWidgetRepresentation*>(r));}
112 
114 
115  vtkDistanceRepresentation *GetDistanceRepresentation()
116  {return reinterpret_cast<vtkDistanceRepresentation*>(this->WidgetRep);}
118 
121 
124  virtual void SetProcessEvents(int);
125 
127 
131  enum {Start=0,Define,Manipulate};
132  //ETX
134 
136 
144  virtual void SetWidgetStateToStart();
145  virtual void SetWidgetStateToManipulate();
147 
149 
150  virtual int GetWidgetState()
151  {return this->WidgetState;}
153 
154 protected:
157 
158  // The state of the widget
161 
162  // Callback interface to capture events when
163  // placing the widget.
164  static void AddPointAction(vtkAbstractWidget*);
165  static void MoveAction(vtkAbstractWidget*);
166  static void EndSelectAction(vtkAbstractWidget*);
167 
168  // The positioning handle widgets
171  vtkDistanceWidgetCallback *DistanceWidgetCallback1;
172  vtkDistanceWidgetCallback *DistanceWidgetCallback2;
173 
174  // Methods invoked when the handles at the
175  // end points of the widget are manipulated
176  void StartDistanceInteraction(int handleNum);
177  void DistanceInteraction(int handleNum);
178  void EndDistanceInteraction(int handleNum);
179 
180 //BTX
181  friend class vtkDistanceWidgetCallback;
182 //ETX
183 
184 private:
185  vtkDistanceWidget(const vtkDistanceWidget&); //Not implemented
186  void operator=(const vtkDistanceWidget&); //Not implemented
187 };
188 
189 #endif