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
63 #include "vtkInteractorObserver.h"
64 
65 class vtk3DWidgetConnection;
66 class vtkAlgorithmOutput;
67 class vtkDataSet;
68 class vtkProp3D;
69 
70 class VTKINTERACTIONWIDGETS_EXPORT vtk3DWidget : public vtkInteractorObserver
71 {
72 public:
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*);
109  virtual void SetInputConnection(vtkAlgorithmOutput*);
110  virtual vtkDataSet* GetInput();
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 
136 protected:
137  vtk3DWidget();
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
146  double PlaceFactor;
147  int 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];
153  double HandleSize;
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 
161  void UpdateInput();
162 
163 private:
164  vtk3DWidget(const vtk3DWidget&) = delete;
165  void operator=(const vtk3DWidget&) = delete;
166 };
167 
168 #endif
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkProp3D * Prop3D
Definition: vtk3DWidget.h:141
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtk3DWidgetConnection * ConnectionHolder
Definition: vtk3DWidget.h:143
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:49
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Proxy object to connect input/output ports.
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
double HandleSize
Definition: vtk3DWidget.h:153
a simple class to control print indentation
Definition: vtkIndent.h:39
double InitialLength
Definition: vtk3DWidget.h:152
double PlaceFactor
Definition: vtk3DWidget.h:146
an abstract superclass for 3D widgets
Definition: vtk3DWidget.h:70
virtual void SizeHandles()
Definition: vtk3DWidget.h:155