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 "vtkInteractionWidgetsModule.h" // For export macro
81 #include "vtkAbstractWidget.h"
82 
84 class vtkHandleWidget;
85 class vtkDistanceWidgetCallback;
86 
87 
89 {
90 public:
92  static vtkDistanceWidget *New();
93 
95 
97  void PrintSelf(ostream& os, vtkIndent indent);
99 
103  virtual void SetEnabled(int);
104 
106 
110  {this->Superclass::SetWidgetRepresentation(
111  reinterpret_cast<vtkWidgetRepresentation*>(r));}
113 
115 
117  {return reinterpret_cast<vtkDistanceRepresentation*>(this->WidgetRep);}
119 
122 
125  virtual void SetProcessEvents(int);
126 
128 
132  enum {Start=0,Define,Manipulate};
133  //ETX
135 
137 
145  virtual void SetWidgetStateToStart();
146  virtual void SetWidgetStateToManipulate();
148 
150 
151  virtual int GetWidgetState()
152  {return this->WidgetState;}
154 
155 protected:
158 
159  // The state of the widget
162 
163  // Callback interface to capture events when
164  // placing the widget.
165  static void AddPointAction(vtkAbstractWidget*);
166  static void MoveAction(vtkAbstractWidget*);
167  static void EndSelectAction(vtkAbstractWidget*);
168 
169  // The positioning handle widgets
172  vtkDistanceWidgetCallback *DistanceWidgetCallback1;
173  vtkDistanceWidgetCallback *DistanceWidgetCallback2;
174 
175  // Methods invoked when the handles at the
176  // end points of the widget are manipulated
177  void StartDistanceInteraction(int handleNum);
178  void DistanceInteraction(int handleNum);
179  void EndDistanceInteraction(int handleNum);
180 
181 //BTX
182  friend class vtkDistanceWidgetCallback;
183 //ETX
184 
185 private:
186  vtkDistanceWidget(const vtkDistanceWidget&); //Not implemented
187  void operator=(const vtkDistanceWidget&); //Not implemented
188 };
189 
190 #endif
void PrintSelf(ostream &os, vtkIndent indent)
vtkHandleWidget * Point1Widget
virtual void SetProcessEvents(int)
represent the vtkDistanceWidget
measure the distance between two points
a general widget for moving handles
virtual void CreateDefaultRepresentation()=0
virtual int GetWidgetState()
vtkHandleWidget * Point2Widget
void SetRepresentation(vtkDistanceRepresentation *r)
vtkWidgetRepresentation * WidgetRep
vtkDistanceRepresentation * GetDistanceRepresentation()
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
define the API for widget / widget representation
vtkDistanceWidgetCallback * DistanceWidgetCallback1
static vtkObject * New()
virtual void SetEnabled(int)
vtkDistanceWidgetCallback * DistanceWidgetCallback2