VTK  9.3.20240422
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
22VTK_ABI_NAMESPACE_BEGIN
23class vtkPlane;
25class vtkPlanes;
26class vtkRenderer;
27
28class VTKINTERACTIONWIDGETS_EXPORT vtkClosedSurfacePointPlacer : public vtkPointPlacer
29{
30public:
35
37
41 void PrintSelf(ostream& os, vtkIndent indent) override;
43
45
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
110protected:
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
124
127
128private:
130 void operator=(const vtkClosedSurfacePointPlacer&) = delete;
131};
132
133VTK_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...
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])
static vtkClosedSurfacePointPlacer * New()
Instantiate this class.
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:108
maintain a list of planes
perform various plane computations
Definition vtkPlane.h:135
implicit function for convex set of planes
Definition vtkPlanes.h:151
Abstract interface to translate 2D display positions to world coordinates.
abstract specification for renderers
#define VTK_DOUBLE_MAX
Definition vtkType.h:154