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 =========================================================================*/
74 #ifndef __vtkDistanceWidget_h
75 #define __vtkDistanceWidget_h
76 
77 #include "vtkAbstractWidget.h"
78 
80 class vtkHandleWidget;
81 class vtkDistanceWidgetCallback;
82 
83 
85 {
86 public:
88  static vtkDistanceWidget *New();
89 
91 
93  void PrintSelf(ostream& os, vtkIndent indent);
95 
99  virtual void SetEnabled(int);
100 
102 
105  void SetRepresentation(vtkDistanceRepresentation *r)
106  {this->Superclass::SetWidgetRepresentation(
107  reinterpret_cast<vtkWidgetRepresentation*>(r));}
109 
111 
112  vtkDistanceRepresentation *GetDistanceRepresentation()
113  {return reinterpret_cast<vtkDistanceRepresentation*>(this->WidgetRep);}
115 
118 
121  virtual void SetProcessEvents(int);
122 
124 
128  enum {Start=0,Define,Manipulate};
129  //ETX
131 
133 
141  virtual void SetWidgetStateToStart();
142  virtual void SetWidgetStateToManipulate();
144 
146 
147  virtual int GetWidgetState()
148  {return this->WidgetState;}
150 
151 protected:
154 
155  // The state of the widget
158 
159  // Callback interface to capture events when
160  // placing the widget.
161  static void AddPointAction(vtkAbstractWidget*);
162  static void MoveAction(vtkAbstractWidget*);
163  static void EndSelectAction(vtkAbstractWidget*);
164 
165  // The positioning handle widgets
168  vtkDistanceWidgetCallback *DistanceWidgetCallback1;
169  vtkDistanceWidgetCallback *DistanceWidgetCallback2;
170 
171  // Methods invoked when the handles at the
172  // end points of the widget are manipulated
173  void StartDistanceInteraction(int handleNum);
174  void DistanceInteraction(int handleNum);
175  void EndDistanceInteraction(int handleNum);
176 
177 //BTX
178  friend class vtkDistanceWidgetCallback;
179 //ETX
180 
181 private:
182  vtkDistanceWidget(const vtkDistanceWidget&); //Not implemented
183  void operator=(const vtkDistanceWidget&); //Not implemented
184 };
185 
186 #endif