VTK  9.3.20240425
vtk3DWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
47#ifndef vtk3DWidget_h
48#define vtk3DWidget_h
49
50#include "vtkInteractionWidgetsModule.h" // For export macro
52
53VTK_ABI_NAMESPACE_BEGIN
54class vtk3DWidgetConnection;
56class vtkDataSet;
57class vtkProp3D;
58
59class VTKINTERACTIONWIDGETS_EXPORT vtk3DWidget : public vtkInteractorObserver
60{
61public:
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
66
75 virtual void PlaceWidget(double bounds[6]) = 0;
76 virtual void PlaceWidget();
77 virtual void PlaceWidget(
78 double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
80
82
87 virtual void SetProp3D(vtkProp3D*);
88 vtkGetObjectMacro(Prop3D, vtkProp3D);
90
92
97 virtual void SetInputData(vtkDataSet*);
99 virtual vtkDataSet* GetInput();
101
103
110 vtkSetClampMacro(PlaceFactor, double, 0.01, VTK_DOUBLE_MAX);
111 vtkGetMacro(PlaceFactor, double);
113
115
121 vtkSetClampMacro(HandleSize, double, 0.001, 0.5);
122 vtkGetMacro(HandleSize, double);
124
125protected:
127 ~vtk3DWidget() override;
128
129 // Used to position and scale the widget initially
131
132 vtk3DWidgetConnection* ConnectionHolder;
133
134 // has the widget ever been placed
137 void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
138
139 // control the size of handles (if there are any)
140 double InitialBounds[6];
143 double SizeHandles(double factor);
144 virtual void SizeHandles() {} // subclass in turn invokes parent's SizeHandles()
145
146 // used to track the depth of the last pick; also interacts with handle sizing
148 double LastPickPosition[3];
149
151
152private:
153 vtk3DWidget(const vtk3DWidget&) = delete;
154 void operator=(const vtk3DWidget&) = delete;
155};
156
157VTK_ABI_NAMESPACE_END
158#endif
an abstract superclass for 3D widgets
Definition vtk3DWidget.h:60
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:166
a simple class to control print indentation
Definition vtkIndent.h:108
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:89
#define VTK_DOUBLE_MAX
Definition vtkType.h:154