VTK  9.2.6
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=========================================================================*/
59#ifndef vtk3DWidget_h
60#define vtk3DWidget_h
61
62#include "vtkInteractionWidgetsModule.h" // For export macro
64
65class vtk3DWidgetConnection;
67class vtkDataSet;
68class vtkProp3D;
69
70class VTKINTERACTIONWIDGETS_EXPORT vtk3DWidget : public vtkInteractorObserver
71{
72public:
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
77
86 virtual void PlaceWidget(double bounds[6]) = 0;
87 virtual void PlaceWidget();
88 virtual void PlaceWidget(
89 double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
91
93
98 virtual void SetProp3D(vtkProp3D*);
99 vtkGetObjectMacro(Prop3D, vtkProp3D);
101
103
108 virtual void SetInputData(vtkDataSet*);
112
114
121 vtkSetClampMacro(PlaceFactor, double, 0.01, VTK_DOUBLE_MAX);
122 vtkGetMacro(PlaceFactor, double);
124
126
132 vtkSetClampMacro(HandleSize, double, 0.001, 0.5);
133 vtkGetMacro(HandleSize, double);
135
136protected:
138 ~vtk3DWidget() override;
139
140 // Used to position and scale the widget initially
142
143 vtk3DWidgetConnection* ConnectionHolder;
144
145 // has the widget ever been placed
148 void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
149
150 // control the size of handles (if there are any)
151 double InitialBounds[6];
154 double SizeHandles(double factor);
155 virtual void SizeHandles() {} // subclass in turn invokes parent's SizeHandles()
156
157 // used to track the depth of the last pick; also interacts with handle sizing
159 double LastPickPosition[3];
160
162
163private:
164 vtk3DWidget(const vtk3DWidget&) = delete;
165 void operator=(const vtk3DWidget&) = delete;
166};
167
168#endif
an abstract superclass for 3D widgets
Definition vtk3DWidget.h:71
virtual void PlaceWidget(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
This method is used to initially place the widget.
double PlaceFactor
double SizeHandles(double factor)
void AdjustBounds(double bounds[6], double newBounds[6], double center[3])
virtual void SetInputConnection(vtkAlgorithmOutput *)
Specify the input dataset.
void UpdateInput()
virtual void SetProp3D(vtkProp3D *)
Specify a vtkProp3D around which to place the widget.
virtual vtkDataSet * GetInput()
Specify the input dataset.
vtk3DWidgetConnection * ConnectionHolder
double InitialLength
virtual void PlaceWidget()
This method is used to initially place the widget.
virtual void SetInputData(vtkDataSet *)
Specify the input dataset.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double HandleSize
virtual void PlaceWidget(double bounds[6])=0
This method is used to initially place the widget.
virtual void SizeHandles()
~vtk3DWidget() override
vtkProp3D * Prop3D
Proxy object to connect input/output ports.
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
a simple class to control print indentation
Definition vtkIndent.h:34
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:47
#define VTK_DOUBLE_MAX
Definition vtkType.h:165