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 =========================================================================*/
58 #ifndef vtk3DWidget_h
59 #define vtk3DWidget_h
60 
61 #include "vtkInteractionWidgetsModule.h" // For export macro
62 #include "vtkInteractorObserver.h"
63 
64 class vtk3DWidgetConnection;
65 class vtkAlgorithmOutput;
66 class vtkDataSet;
67 class vtkProp3D;
68 
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent);
74 
76 
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 
93  virtual void SetProp3D(vtkProp3D*);
94  vtkGetObjectMacro(Prop3D,vtkProp3D);
96 
98 
101  virtual void SetInputData(vtkDataSet*);
102  virtual void SetInputConnection(vtkAlgorithmOutput*);
103  virtual vtkDataSet *GetInput();
105 
107 
113  vtkSetClampMacro(PlaceFactor,double,0.01,VTK_DOUBLE_MAX);
114  vtkGetMacro(PlaceFactor,double);
116 
118 
122  vtkSetClampMacro(HandleSize,double,0.001,0.5);
123  vtkGetMacro(HandleSize,double);
125 
126 protected:
127  vtk3DWidget();
128  ~vtk3DWidget();
129 
130  // Used to position and scale the widget initially
132 
133  vtk3DWidgetConnection *ConnectionHolder;
134 
135  //has the widget ever been placed
136  double PlaceFactor;
137  int Placed;
138  void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
139 
140  //control the size of handles (if there are any)
141  double InitialBounds[6];
143  double HandleSize;
144  double SizeHandles(double factor);
145  virtual void SizeHandles() {}//subclass in turn invokes parent's SizeHandles()
146 
147  //used to track the depth of the last pick; also interacts with handle sizing
149  double LastPickPosition[3];
150 
151  void UpdateInput();
152 
153 private:
154  vtk3DWidget(const vtk3DWidget&); // Not implemented.
155  void operator=(const vtk3DWidget&); // Not implemented.
156 
157 };
158 
159 #endif
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
vtkProp3D * Prop3D
Definition: vtk3DWidget.h:131
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
vtk3DWidgetConnection * ConnectionHolder
Definition: vtk3DWidget.h:133
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:42
Proxy object to connect input/output ports.
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
double HandleSize
Definition: vtk3DWidget.h:143
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
double InitialLength
Definition: vtk3DWidget.h:142
void PrintSelf(ostream &os, vtkIndent indent)
double PlaceFactor
Definition: vtk3DWidget.h:136
an abstract superclass for 3D widgets
Definition: vtk3DWidget.h:69
virtual void SizeHandles()
Definition: vtk3DWidget.h:145