VTK  9.2.6
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
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
40class VTKINTERACTIONWIDGETS_EXPORT vtkBoundedPlanePointPlacer : public vtkPointPlacer
41{
42public:
47
49
53 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
62 vtkSetClampMacro(
64 vtkGetMacro(ProjectionNormal, int);
81
82
84
89 vtkGetObjectMacro(ObliquePlane, vtkPlane);
91
93
100 void SetProjectionPosition(double position);
101 vtkGetMacro(ProjectionPosition, double);
103
105
120
121 enum
122 {
123 XAxis = 0,
127 };
128
144 vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
145
152 int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
153 double worldPos[3], double worldOrient[9]) override;
154
160 int ValidateWorldPosition(double worldPos[3]) override;
161
162 // Descrption:
163 // Orientationation is ignored, and the above method
164 // is called instead.
165 int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
166
175 int UpdateWorldPosition(vtkRenderer* ren, double worldPos[3], double worldOrient[9]) override;
176
177protected:
180
181 // Indicates the projection normal as laying along the
182 // XAxis, YAxis, ZAxis, or Oblique. For X, Y, and Z axes,
183 // the projection normal is assumed to be anchored at
184 // (0,0,0)
186
187 // Indicates a distance from the origin of the projection
188 // normal where the project plane will be placed
190
191 // If the ProjectionNormal is oblique, this is the oblique
192 // plane
194
195 // A collection of planes used to bound the projection
196 // plane
198
199 // Internal method for getting the project normal as a vector
200 void GetProjectionNormal(double normal[3]);
201
202 // Internal method for getting the origin of the
203 // constraining plane as a 3-tuple
204 void GetProjectionOrigin(double origin[3]);
205
206 // Internal method for getting the orientation of
207 // the projection plane
208 void GetCurrentOrientation(double worldOrient[9]);
209
210 // Calculate the distance of a point from the Object. Negative
211 // values imply that the point is outside. Positive values imply that it is
212 // inside. The closest point to the object is returned in closestPt.
213 static double GetDistanceFromObject(double pos[3], vtkPlaneCollection* pc, double closestPt[3]);
214
215private:
217 void operator=(const vtkBoundedPlanePointPlacer&) = delete;
218};
219
220#endif
void SetProjectionPosition(double position)
The position of the bounding plane from the origin along the normal.
void GetProjectionOrigin(double origin[3])
void SetBoundingPlanes(vtkPlanes *planes)
A collection of plane equations used to bound the position of the point.
void SetObliquePlane(vtkPlane *)
If the ProjectionNormal is set to Oblique, then this is the oblique plane used to constrain the handl...
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override
Given a renderer and a display position, compute the world position and world orientation for this po...
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual void SetBoundingPlanes(vtkPlaneCollection *)
A collection of plane equations used to bound the position of the point.
void SetProjectionNormalToYAxis()
Set the projection normal to lie along the x, y, or z axis, or to be oblique.
void GetCurrentOrientation(double worldOrient[9])
void SetProjectionNormalToZAxis()
Set the projection normal to lie along the x, y, or z axis, or to be oblique.
void RemoveBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
void GetProjectionNormal(double normal[3])
static double GetDistanceFromObject(double pos[3], vtkPlaneCollection *pc, double closestPt[3])
static vtkBoundedPlanePointPlacer * New()
Instantiate this class.
int UpdateWorldPosition(vtkRenderer *ren, double worldPos[3], double worldOrient[9]) override
If the constraints on this placer are changed, then this method will be called by the representation ...
void AddBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
void SetProjectionNormalToXAxis()
Set the projection normal to lie along the x, y, or z axis, or to be oblique.
virtual void SetProjectionNormal(int)
Set the projection normal to lie along the x, y, or z axis, or to be oblique.
int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override
Given a world position and a world orientation, validate it according to the constraints of the place...
void SetProjectionNormalToOblique()
Set the projection normal to lie along the x, y, or z axis, or to be oblique.
~vtkBoundedPlanePointPlacer() override
int ValidateWorldPosition(double worldPos[3]) override
Give a world position check if it is valid - does it lie on the plane and within the bounds?
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double refWorldPos[3], double worldPos[3], double worldOrient[9]) override
Given a renderer, a display position, and a reference world position, compute the new world position ...
void RemoveAllBoundingPlanes()
A collection of plane equations used to bound the position of the point.
a simple class to control print indentation
Definition vtkIndent.h:40
maintain a list of planes
perform various plane computations
Definition vtkPlane.h:37
implicit function for convex set of planes
Definition vtkPlanes.h:53
abstract specification for renderers
Definition vtkRenderer.h:73