VTK
vtk3DWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtk3DWidget.h
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=========================================================================*/
56#ifndef vtk3DWidget_h
57#define vtk3DWidget_h
58
59#include "vtkInteractionWidgetsModule.h" // For export macro
61
62class vtk3DWidgetConnection;
64class vtkDataSet;
65class vtkProp3D;
66
67class VTKINTERACTIONWIDGETS_EXPORT vtk3DWidget : public vtkInteractorObserver
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent);
72
74
83 virtual void PlaceWidget(double bounds[6]) = 0;
84 virtual void PlaceWidget();
85 virtual void PlaceWidget(double xmin, double xmax, double ymin, double ymax,
86 double zmin, double zmax);
88
90
95 virtual void SetProp3D(vtkProp3D*);
96 vtkGetObjectMacro(Prop3D,vtkProp3D);
98
100
105 virtual void SetInputData(vtkDataSet*);
109
111
118 vtkSetClampMacro(PlaceFactor,double,0.01,VTK_DOUBLE_MAX);
119 vtkGetMacro(PlaceFactor,double);
121
123
129 vtkSetClampMacro(HandleSize,double,0.001,0.5);
130 vtkGetMacro(HandleSize,double);
132
133protected:
136
137 // Used to position and scale the widget initially
139
140 vtk3DWidgetConnection *ConnectionHolder;
141
142 //has the widget ever been placed
145 void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
146
147 //control the size of handles (if there are any)
148 double InitialBounds[6];
151 double SizeHandles(double factor);
152 virtual void SizeHandles() {}//subclass in turn invokes parent's SizeHandles()
153
154 //used to track the depth of the last pick; also interacts with handle sizing
156 double LastPickPosition[3];
157
159
160private:
161 vtk3DWidget(const vtk3DWidget&) VTK_DELETE_FUNCTION;
162 void operator=(const vtk3DWidget&) VTK_DELETE_FUNCTION;
163
164};
165
166#endif
an abstract superclass for 3D widgets
Definition: vtk3DWidget.h:68
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void PlaceWidget(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
double PlaceFactor
Definition: vtk3DWidget.h:143
double SizeHandles(double factor)
void AdjustBounds(double bounds[6], double newBounds[6], double center[3])
virtual void SetInputConnection(vtkAlgorithmOutput *)
void UpdateInput()
virtual void SetProp3D(vtkProp3D *)
Specify a vtkProp3D around which to place the widget.
virtual vtkDataSet * GetInput()
vtk3DWidgetConnection * ConnectionHolder
Definition: vtk3DWidget.h:140
double InitialLength
Definition: vtk3DWidget.h:149
virtual void PlaceWidget()
virtual void SetInputData(vtkDataSet *)
Specify the input dataset.
double HandleSize
Definition: vtk3DWidget.h:150
virtual void PlaceWidget(double bounds[6])=0
This method is used to initially place the widget.
virtual void SizeHandles()
Definition: vtk3DWidget.h:152
vtkProp3D * Prop3D
Definition: vtk3DWidget.h:138
Proxy object to connect input/output ports.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
a simple class to control print indentation
Definition: vtkIndent.h:40
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
@ center
Definition: vtkX3D.h:230
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163