VTK  9.3.0
vtkClosedSurfacePointPlacer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkClosedSurfacePointPlacer_h
17 #define vtkClosedSurfacePointPlacer_h
18 
19 #include "vtkInteractionWidgetsModule.h" // For export macro
20 #include "vtkPointPlacer.h"
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkPlane;
24 class vtkPlaneCollection;
25 class vtkPlanes;
26 class vtkRenderer;
27 
28 class VTKINTERACTIONWIDGETS_EXPORT vtkClosedSurfacePointPlacer : public vtkPointPlacer
29 {
30 public:
35 
37 
41  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
53  void AddBoundingPlane(vtkPlane* plane);
57  vtkGetObjectMacro(BoundingPlanes, vtkPlaneCollection);
60 
76  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
77 
89  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
90  double worldPos[3], double worldOrient[9]) override;
91 
97  int ValidateWorldPosition(double worldPos[3]) override;
98 
99  // Description:
100  // Orientationation is ignored, and the above method
101  // is called instead.
102  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
103 
104  // Description:
105  // The minimum distance the object should be from the faces of the object.
106  // Must be greater than 0. Default is 0.
107  vtkSetClampMacro(MinimumDistance, double, 0.0, VTK_DOUBLE_MAX);
108  vtkGetMacro(MinimumDistance, double);
109 
110 protected:
113 
114  // A collection of planes used to bound the projection
115  // plane
117 
118  // Calculate the distance of a point from the Object. Negative
119  // values imply that the point is outside. Positive values imply that it is
120  // inside. The closest point to the object is returned in closestPt.
121  static double GetDistanceFromObject(double pos[3], vtkPlaneCollection* pc, double closestPt[3]);
122 
123  void BuildPlanes();
124 
127 
128 private:
130  void operator=(const vtkClosedSurfacePointPlacer&) = delete;
131 };
132 
133 VTK_ABI_NAMESPACE_END
134 #endif
PointPlacer to constrain validity within a set of convex planes.
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...
static vtkClosedSurfacePointPlacer * New()
Instantiate this class.
void AddBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
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...
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?...
void RemoveBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
void RemoveAllBoundingPlanes()
A collection of plane equations used to bound the position of the point.
virtual void SetBoundingPlanes(vtkPlaneCollection *)
A collection of plane equations used to bound the position of the point.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void SetBoundingPlanes(vtkPlanes *planes)
A collection of plane equations used to bound the position of the point.
static double GetDistanceFromObject(double pos[3], vtkPlaneCollection *pc, double closestPt[3])
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 position, "worldPos" is calculated as : Consider...
~vtkClosedSurfacePointPlacer() override
a simple class to control print indentation
Definition: vtkIndent.h:29
maintain a list of planes
perform various plane computations
Definition: vtkPlane.h:26
implicit function for convex set of planes
Definition: vtkPlanes.h:42
Abstract interface to translate 2D display positions to world coordinates.
abstract specification for renderers
Definition: vtkRenderer.h:62
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154