VTK
vtkBiDimensionalWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkBiDimensionalWidget.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=========================================================================*/
97#ifndef vtkBiDimensionalWidget_h
98#define vtkBiDimensionalWidget_h
99
100#include "vtkInteractionWidgetsModule.h" // For export macro
101#include "vtkAbstractWidget.h"
102
104class vtkHandleWidget;
105class vtkBiDimensionalWidgetCallback;
106
107
108class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
109{
110public:
115
117
121 void PrintSelf(ostream& os, vtkIndent indent);
123
129 virtual void SetEnabled(int);
130
137 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
138
143 {return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);}
144
149
155
159 enum
160 {
161 EndWidgetSelectEvent = 10050
162 };
163
168 virtual void SetProcessEvents(int);
169
176 enum {Start=0,Define,Manipulate};
177
179
189 virtual void SetWidgetStateToStart();
192
196 virtual int GetWidgetState()
197 {return this->WidgetState;}
198
199protected:
202
203 // The state of the widget
213
214 // Callback interface to capture events when
215 // placing the widget.
219
220 // The positioning handle widgets
225 vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback1;
226 vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback2;
227 vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback3;
228 vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback4;
229
230 // Methods invoked when the handles at the
231 // end points of the widget are manipulated
234
235 friend class vtkBiDimensionalWidgetCallback;
236
237private:
238 vtkBiDimensionalWidget(const vtkBiDimensionalWidget&) VTK_DELETE_FUNCTION;
239 void operator=(const vtkBiDimensionalWidget&) VTK_DELETE_FUNCTION;
240};
241
242#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkBiDimensionalWidget
measure the bi-dimensional lengths of an object
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()
Return the representation as a vtkBiDimensionalRepresentation.
void CreateDefaultRepresentation()
Create the default widget representation if one is not set.
virtual int GetWidgetState()
Return the current widget state.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
static vtkBiDimensionalWidget * New()
Instantiate this class.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
virtual void SetProcessEvents(int)
Methods to change the whether the widget responds to interaction.
static void EndSelectAction(vtkAbstractWidget *)
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
virtual void EndBiDimensionalInteraction()
virtual void SetWidgetStateToStart()
Set the state of the widget.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
int IsMeasureValid()
A flag indicates whether the bi-dimensional measure is valid.
void SetRepresentation(vtkBiDimensionalRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
virtual void SetEnabled(int)
The method for activating and deactivating this widget.
static void MoveAction(vtkAbstractWidget *)
virtual void SetWidgetStateToManipulate()
static void AddPointAction(vtkAbstractWidget *)
void StartBiDimensionalInteraction()
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