VTK  9.3.0
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
44#ifndef vtk3DWidget_h
45#define vtk3DWidget_h
46
47#include "vtkInteractionWidgetsModule.h" // For export macro
49
50VTK_ABI_NAMESPACE_BEGIN
51class vtk3DWidgetConnection;
53class vtkDataSet;
54class vtkProp3D;
55
56class VTKINTERACTIONWIDGETS_EXPORT vtk3DWidget : public vtkInteractorObserver
57{
58public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
63
72 virtual void PlaceWidget(double bounds[6]) = 0;
73 virtual void PlaceWidget();
74 virtual void PlaceWidget(
75 double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
77
79
84 virtual void SetProp3D(vtkProp3D*);
85 vtkGetObjectMacro(Prop3D, vtkProp3D);
87
89
94 virtual void SetInputData(vtkDataSet*);
96 virtual vtkDataSet* GetInput();
98
100
107 vtkSetClampMacro(PlaceFactor, double, 0.01, VTK_DOUBLE_MAX);
108 vtkGetMacro(PlaceFactor, double);
110
112
118 vtkSetClampMacro(HandleSize, double, 0.001, 0.5);
119 vtkGetMacro(HandleSize, double);
121
122protected:
124 ~vtk3DWidget() override;
125
126 // Used to position and scale the widget initially
128
129 vtk3DWidgetConnection* ConnectionHolder;
130
131 // has the widget ever been placed
134 void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
135
136 // control the size of handles (if there are any)
137 double InitialBounds[6];
140 double SizeHandles(double factor);
141 virtual void SizeHandles() {} // subclass in turn invokes parent's SizeHandles()
142
143 // used to track the depth of the last pick; also interacts with handle sizing
145 double LastPickPosition[3];
146
148
149private:
150 vtk3DWidget(const vtk3DWidget&) = delete;
151 void operator=(const vtk3DWidget&) = delete;
152};
153
154VTK_ABI_NAMESPACE_END
155#endif
an abstract superclass for 3D widgets
Definition vtk3DWidget.h:57
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:53
a simple class to control print indentation
Definition vtkIndent.h:29
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:39
#define VTK_DOUBLE_MAX
Definition vtkType.h:154