VTK  9.3.1
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);
54  void RemoveBoundingPlane(vtkPlane* plane);
55  void RemoveAllBoundingPlanes();
56  virtual void SetBoundingPlanes(vtkPlaneCollection*);
57  vtkGetObjectMacro(BoundingPlanes, vtkPlaneCollection);
58  void SetBoundingPlanes(vtkPlanes* planes);
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:
112  ~vtkClosedSurfacePointPlacer() override;
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
virtual int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9])
Given a renderer and a display position in pixel coordinates, compute the world position and orientat...
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
maintain a list of planes
implicit function for convex set of planes
Definition: vtkPlanes.h:41
abstract specification for renderers
Definition: vtkRenderer.h:61
a simple class to control print indentation
Definition: vtkIndent.h:28
Abstract interface to translate 2D display positions to world coordinates.
perform various plane computations
Definition: vtkPlane.h:25
virtual int ValidateWorldPosition(double worldPos[3])
Given a world position check the validity of this position according to the constraints of the placer...
static vtkPointPlacer * New()
Instantiate this class.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
PointPlacer to constrain validity within a set of convex planes.