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 
74  vtkGetObjectMacro( ObliquePlane, vtkPlane );
76 
78 
83  vtkGetMacro(ProjectionPosition, double);
85 
87 
93  void AddBoundingPlane(vtkPlane *plane);
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 
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
vtkPlane
perform various plane computations
Definition: vtkPlane.h:37
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkBoundedPlanePointPlacer
a placer that constrains a handle to a finite plane
Definition: vtkBoundedPlanePointPlacer.h:41
vtkBoundedPlanePointPlacer::XAxis
@ XAxis
Definition: vtkBoundedPlanePointPlacer.h:104
vtkBoundedPlanePointPlacer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkBoundedPlanePointPlacer::ProjectionPosition
double ProjectionPosition
Definition: vtkBoundedPlanePointPlacer.h:171
vtkBoundedPlanePointPlacer::BoundingPlanes
vtkPlaneCollection * BoundingPlanes
Definition: vtkBoundedPlanePointPlacer.h:179
vtkPointPlacer
Abstract interface to translate 2D display positions to world coordinates.
Definition: vtkPointPlacer.h:49
vtkBoundedPlanePointPlacer::~vtkBoundedPlanePointPlacer
~vtkBoundedPlanePointPlacer()
vtkBoundedPlanePointPlacer::RemoveBoundingPlane
void RemoveBoundingPlane(vtkPlane *plane)
vtkBoundedPlanePointPlacer::vtkBoundedPlanePointPlacer
vtkBoundedPlanePointPlacer()
vtkBoundedPlanePointPlacer::SetProjectionNormalToOblique
void SetProjectionNormalToOblique()
Definition: vtkBoundedPlanePointPlacer.h:66
vtkBoundedPlanePointPlacer::ValidateWorldPosition
int ValidateWorldPosition(double worldPos[3], double worldOrient[9])
vtkBoundedPlanePointPlacer::GetDistanceFromObject
static double GetDistanceFromObject(double pos[3], vtkPlaneCollection *pc, double closestPt[3])
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkInteractionWidgetsModule.h
vtkPlanes
implicit function for convex set of planes
Definition: vtkPlanes.h:54
vtkBoundedPlanePointPlacer::SetBoundingPlanes
void SetBoundingPlanes(vtkPlanes *planes)
vtkBoundedPlanePointPlacer::RemoveAllBoundingPlanes
void RemoveAllBoundingPlanes()
vtkX3D::position
@ position
Definition: vtkX3D.h:261
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkBoundedPlanePointPlacer::ObliquePlane
vtkPlane * ObliquePlane
Definition: vtkBoundedPlanePointPlacer.h:175
vtkBoundedPlanePointPlacer::ZAxis
@ ZAxis
Definition: vtkBoundedPlanePointPlacer.h:106
vtkBoundedPlanePointPlacer::SetProjectionPosition
void SetProjectionPosition(double position)
vtkBoundedPlanePointPlacer::YAxis
@ YAxis
Definition: vtkBoundedPlanePointPlacer.h:105
vtkBoundedPlanePointPlacer::SetBoundingPlanes
virtual void SetBoundingPlanes(vtkPlaneCollection *)
vtkBoundedPlanePointPlacer::SetProjectionNormalToXAxis
void SetProjectionNormalToXAxis()
Definition: vtkBoundedPlanePointPlacer.h:60
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBoundedPlanePointPlacer::GetProjectionOrigin
void GetProjectionOrigin(double origin[3])
vtkBoundedPlanePointPlacer::UpdateWorldPosition
virtual int UpdateWorldPosition(vtkRenderer *ren, double worldPos[3], double worldOrient[9])
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkBoundedPlanePointPlacer::New
static vtkBoundedPlanePointPlacer * New()
vtkBoundedPlanePointPlacer::ComputeWorldPosition
virtual int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double refWorldPos[3], double worldPos[3], double worldOrient[9])
vtkBoundedPlanePointPlacer::GetCurrentOrientation
void GetCurrentOrientation(double worldOrient[9])
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkBoundedPlanePointPlacer::ProjectionNormal
int ProjectionNormal
Definition: vtkBoundedPlanePointPlacer.h:167
vtkBoundedPlanePointPlacer::SetObliquePlane
void SetObliquePlane(vtkPlane *)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkBoundedPlanePointPlacer::GetProjectionNormal
void GetProjectionNormal(double normal[3])
vtkBoundedPlanePointPlacer::SetProjectionNormalToZAxis
void SetProjectionNormalToZAxis()
Definition: vtkBoundedPlanePointPlacer.h:64
vtkBoundedPlanePointPlacer::SetProjectionNormalToYAxis
void SetProjectionNormalToYAxis()
Definition: vtkBoundedPlanePointPlacer.h:62
vtkBoundedPlanePointPlacer::AddBoundingPlane
void AddBoundingPlane(vtkPlane *plane)
vtkBoundedPlanePointPlacer::ComputeWorldPosition
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9])
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:36
vtkPointPlacer.h
vtkBoundedPlanePointPlacer::Oblique
@ Oblique
Definition: vtkBoundedPlanePointPlacer.h:107
vtkBoundedPlanePointPlacer::ValidateWorldPosition
int ValidateWorldPosition(double worldPos[3])