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 =========================================================================*/
75 #ifndef vtkDistanceWidget_h
76 #define vtkDistanceWidget_h
77 
78 #include "vtkInteractionWidgetsModule.h" // For export macro
79 #include "vtkAbstractWidget.h"
80 
82 class vtkHandleWidget;
83 class vtkDistanceWidgetCallback;
84 
85 
86 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceWidget : public vtkAbstractWidget
87 {
88 public:
93 
95 
99  void PrintSelf(ostream& os, vtkIndent indent);
101 
107  virtual void SetEnabled(int);
108 
115  {this->Superclass::SetWidgetRepresentation(
116  reinterpret_cast<vtkWidgetRepresentation*>(r));}
117 
122  {return reinterpret_cast<vtkDistanceRepresentation*>(this->WidgetRep);}
123 
128 
133  virtual void SetProcessEvents(int);
134 
142  enum {Start=0,Define,Manipulate};
143 
145 
155  virtual void SetWidgetStateToStart();
158 
162  virtual int GetWidgetState()
163  {return this->WidgetState;}
164 
165 protected:
168 
169  // The state of the widget
172 
173  // Callback interface to capture events when
174  // placing the widget.
178 
179  // The positioning handle widgets
182  vtkDistanceWidgetCallback *DistanceWidgetCallback1;
183  vtkDistanceWidgetCallback *DistanceWidgetCallback2;
184 
185  // Methods invoked when the handles at the
186  // end points of the widget are manipulated
187  void StartDistanceInteraction(int handleNum);
188  void DistanceInteraction(int handleNum);
189  void EndDistanceInteraction(int handleNum);
190 
191  friend class vtkDistanceWidgetCallback;
192 
193 private:
194  vtkDistanceWidget(const vtkDistanceWidget&) VTK_DELETE_FUNCTION;
195  void operator=(const vtkDistanceWidget&) VTK_DELETE_FUNCTION;
196 };
197 
198 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkDistanceWidget
measure the distance between two points
virtual void SetWidgetStateToStart()
Set the state of the widget.
virtual int GetWidgetState()
Return the current widget state.
vtkDistanceRepresentation * GetDistanceRepresentation()
Return the representation as a vtkDistanceRepresentation.
virtual void SetWidgetStateToManipulate()
static void EndSelectAction(vtkAbstractWidget *)
void SetRepresentation(vtkDistanceRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void EndDistanceInteraction(int handleNum)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetEnabled(int)
The method for activating and deactivating this widget.
vtkHandleWidget * Point2Widget
void StartDistanceInteraction(int handleNum)
vtkHandleWidget * Point1Widget
vtkDistanceWidgetCallback * DistanceWidgetCallback1
void DistanceInteraction(int handleNum)
vtkDistanceWidgetCallback * DistanceWidgetCallback2
static vtkDistanceWidget * New()
Instantiate this class.
static void MoveAction(vtkAbstractWidget *)
static void AddPointAction(vtkAbstractWidget *)
virtual void SetProcessEvents(int)
Methods to change the whether the widget responds to interaction.
void CreateDefaultRepresentation()
Create the default widget representation if one is not set.
a general widget for moving handles
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class defines interface between the widget and widget representation classes