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=========================================================================*/
29#ifndef vtkBoundedPlanePointPlacer_h
30#define vtkBoundedPlanePointPlacer_h
31
32#include "vtkInteractionWidgetsModule.h" // For export macro
33#include "vtkPointPlacer.h"
34
35class vtkPlane;
37class vtkPlanes;
38class vtkRenderer;
39
40
41class VTKINTERACTIONWIDGETS_EXPORT vtkBoundedPlanePointPlacer : public vtkPointPlacer
42{
43public:
48
50
54 void PrintSelf(ostream& os, vtkIndent indent);
56
58
63 vtkSetClampMacro(ProjectionNormal,int,
66 vtkGetMacro(ProjectionNormal,int);
68 { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::XAxis); }
70 { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::YAxis); }
72 { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::ZAxis); }
74 { this->SetProjectionNormal(vtkBoundedPlanePointPlacer::Oblique); }
76
78
83 vtkGetObjectMacro( ObliquePlane, vtkPlane );
85
87
95 vtkGetMacro(ProjectionPosition, double);
97
99
111 vtkGetObjectMacro(BoundingPlanes,vtkPlaneCollection);
114
115 enum
116 {
117 XAxis=0,
120 Oblique
121 };
122
138 double displayPos[2],
139 double worldPos[3],
140 double worldOrient[9] );
141
149 double displayPos[2],
150 double refWorldPos[3],
151 double worldPos[3],
152 double worldOrient[9] );
153
159 int ValidateWorldPosition( double worldPos[3] );
160
161 // Descrption:
162 // Orientationation is ignored, and the above method
163 // is called instead.
164 int ValidateWorldPosition( double worldPos[3],
165 double worldOrient[9]);
166
176 double worldPos[3],
177 double worldOrient[9] );
178
179
180protected:
183
184 // Indicates the projection normal as laying along the
185 // XAxis, YAxis, ZAxis, or Oblique. For X, Y, and Z axes,
186 // the projection normal is assumed to be anchored at
187 // (0,0,0)
189
190 // Indicates a distance from the origin of the projection
191 // normal where the project plane will be placed
193
194 // If the ProjectionNormal is oblique, this is the oblique
195 // plane
197
198 // A collection of planes used to bound the projection
199 // plane
201
202 // Internal method for getting the project normal as a vector
203 void GetProjectionNormal( double normal[3] );
204
205 // Internal method for getting the origin of the
206 // constraining plane as a 3-tuple
207 void GetProjectionOrigin( double origin[3] );
208
209 // Internal method for getting the orientation of
210 // the projection plane
211 void GetCurrentOrientation( double worldOrient[9] );
212
213 // Calculate the distance of a point from the Object. Negative
214 // values imply that the point is outside. Positive values imply that it is
215 // inside. The closest point to the object is returned in closestPt.
216 static double GetDistanceFromObject( double pos[3],
218 double closestPt[3]);
219
220private:
221 vtkBoundedPlanePointPlacer(const vtkBoundedPlanePointPlacer&) VTK_DELETE_FUNCTION;
222 void operator=(const vtkBoundedPlanePointPlacer&) VTK_DELETE_FUNCTION;
223};
224
225#endif
a placer that constrains a handle to a finite plane
void SetProjectionPosition(double position)
The position of the bounding plane from the origin along the normal.
int ValidateWorldPosition(double worldPos[3])
Give a world position check if it is valid - does it lie on the plane and within the bounds?...
void GetProjectionOrigin(double origin[3])
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9])
Given a renderer and a display position, compute the world position and world orientation for this po...
void SetBoundingPlanes(vtkPlanes *planes)
void SetObliquePlane(vtkPlane *)
If the ProjectionNormal is set to Oblique, then this is the oblique plane used to constrain the handl...
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetBoundingPlanes(vtkPlaneCollection *)
void GetCurrentOrientation(double worldOrient[9])
void RemoveBoundingPlane(vtkPlane *plane)
void GetProjectionNormal(double normal[3])
static double GetDistanceFromObject(double pos[3], vtkPlaneCollection *pc, double closestPt[3])
static vtkBoundedPlanePointPlacer * New()
Instantiate this class.
virtual int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double refWorldPos[3], double worldPos[3], double worldOrient[9])
Given a renderer, a display position, and a reference world position, compute the new world position ...
void AddBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
virtual int UpdateWorldPosition(vtkRenderer *ren, double worldPos[3], double worldOrient[9])
If the constraints on this placer are changed, then this method will be called by the representation ...
int ValidateWorldPosition(double worldPos[3], double worldOrient[9])
Given a world position and a world orientation, validate it according to the constraints of the place...
a simple class to control print indentation
Definition: vtkIndent.h:40
maintain a list of planes
perform various plane computations
Definition: vtkPlane.h:38
implicit function for convex set of planes
Definition: vtkPlanes.h:55
Abstract interface to translate 2D display positions to world coordinates.
abstract specification for renderers
Definition: vtkRenderer.h:64
@ position
Definition: vtkX3D.h:261