VTK
vtkBoundedPlanePointPlacer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBoundedPlanePointPlacer.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 =========================================================================*/
28 #ifndef vtkBoundedPlanePointPlacer_h
29 #define vtkBoundedPlanePointPlacer_h
30 
31 #include "vtkInteractionWidgetsModule.h" // For export macro
32 #include "vtkPointPlacer.h"
33 
34 class vtkPlane;
35 class vtkPlaneCollection;
36 class vtkPlanes;
37 class vtkRenderer;
38 
39 
41 {
42 public:
45 
47 
49  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
56  vtkSetClampMacro(ProjectionNormal,int,
59  vtkGetMacro(ProjectionNormal,int);
61  { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::XAxis); }
63  { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::YAxis); }
65  { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::ZAxis); }
67  { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::Oblique); }
69 
71 
73  void SetObliquePlane(vtkPlane *);
74  vtkGetObjectMacro( ObliquePlane, vtkPlane );
76 
78 
82  void SetProjectionPosition(double position);
83  vtkGetMacro(ProjectionPosition, double);
85 
87 
93  void AddBoundingPlane(vtkPlane *plane);
94  void RemoveBoundingPlane(vtkPlane *plane);
95  void RemoveAllBoundingPlanes();
96  virtual void SetBoundingPlanes(vtkPlaneCollection*);
97  vtkGetObjectMacro(BoundingPlanes,vtkPlaneCollection);
98  void SetBoundingPlanes(vtkPlanes *planes);
100 
101 //BTX
102  enum
103  {
104  XAxis=0,
107  Oblique
108  };
109 //ETX
110 
112 
122  double displayPos[2],
123  double worldPos[3],
124  double worldOrient[9] );
126 
128 
131  virtual int ComputeWorldPosition( vtkRenderer *ren,
132  double displayPos[2],
133  double refWorldPos[3],
134  double worldPos[3],
135  double worldOrient[9] );
137 
140  int ValidateWorldPosition( double worldPos[3] );
141 
142  // Descrption:
143  // Orientationation is ignored, and the above method
144  // is called instead.
145  int ValidateWorldPosition( double worldPos[3],
146  double worldOrient[9]);
147 
149 
153  virtual int UpdateWorldPosition( vtkRenderer *ren,
154  double worldPos[3],
155  double worldOrient[9] );
157 
158 
159 protected:
162 
163  // Indicates the projection normal as laying along the
164  // XAxis, YAxis, ZAxis, or Oblique. For X, Y, and Z axes,
165  // the projection normal is assumed to be anchored at
166  // (0,0,0)
168 
169  // Indicates a distance from the origin of the projection
170  // normal where the project plane will be placed
172 
173  // If the ProjectionNormal is oblique, this is the oblique
174  // plane
176 
177  // A collection of planes used to bound the projection
178  // plane
180 
181  // Internal method for getting the project normal as a vector
182  void GetProjectionNormal( double normal[3] );
183 
184  // Internal method for getting the origin of the
185  // constraining plane as a 3-tuple
186  void GetProjectionOrigin( double origin[3] );
187 
188  // Internal method for getting the orientation of
189  // the projection plane
190  void GetCurrentOrientation( double worldOrient[9] );
191 
192  // Calculate the distance of a point from the Object. Negative
193  // values imply that the point is outside. Positive values imply that it is
194  // inside. The closest point to the object is returned in closestPt.
195  static double GetDistanceFromObject( double pos[3],
196  vtkPlaneCollection * pc,
197  double closestPt[3]);
198 
199 private:
200  vtkBoundedPlanePointPlacer(const vtkBoundedPlanePointPlacer&); //Not implemented
201  void operator=(const vtkBoundedPlanePointPlacer&); //Not implemented
202 };
203 
204 #endif
virtual int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9])
maintain a list of planes
implicit function for convex set of planes
Definition: vtkPlanes.h:53
abstract specification for renderers
Definition: vtkRenderer.h:63
void PrintSelf(ostream &os, vtkIndent indent)
a placer that constrains a handle to a finite plane
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
Abstract interface to translate 2D display positions to world coordinates.
perform various plane computations
Definition: vtkPlane.h:36
virtual int UpdateWorldPosition(vtkRenderer *ren, double worldPos[3], double worldOrient[9])
virtual int ValidateWorldPosition(double worldPos[3])
static vtkPointPlacer * New()