VTK: Interaction/Widgets/vtkClosedSurfacePointPlacer.h Source File

| 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:
34 static vtkClosedSurfacePointPlacer* New();
35
37
40 vtkTypeMacro(vtkClosedSurfacePointPlacer, vtkPointPlacer);
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
75 int ComputeWorldPosition(
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:
111 vtkClosedSurfacePointPlacer();
112 ~vtkClosedSurfacePointPlacer() override;
113
114 // A collection of planes used to bound the projection
115 // plane
116 vtkPlaneCollection* BoundingPlanes;
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
125 double MinimumDistance;
126 vtkPlaneCollection* InnerBoundingPlanes;
127
128 private:
129 vtkClosedSurfacePointPlacer(const vtkClosedSurfacePointPlacer&) = delete;
130 void operator=(const vtkClosedSurfacePointPlacer&) = delete;
131 };
132
133 VTK_ABI_NAMESPACE_END
134 #endif
vtkClosedSurfacePointPlacer
PointPlacer to constrain validity within a set of convex planes.
Definition: vtkClosedSurfacePointPlacer.h:29
vtkClosedSurfacePointPlacer::ValidateWorldPosition
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...
vtkClosedSurfacePointPlacer::New
static vtkClosedSurfacePointPlacer * New()
Instantiate this class.
vtkClosedSurfacePointPlacer::AddBoundingPlane
void AddBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
vtkClosedSurfacePointPlacer::ComputeWorldPosition
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...
vtkClosedSurfacePointPlacer::ValidateWorldPosition
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?...
vtkClosedSurfacePointPlacer::InnerBoundingPlanes
vtkPlaneCollection * InnerBoundingPlanes
Definition: vtkClosedSurfacePointPlacer.h:126
vtkClosedSurfacePointPlacer::MinimumDistance
double MinimumDistance
Definition: vtkClosedSurfacePointPlacer.h:125
vtkClosedSurfacePointPlacer::RemoveBoundingPlane
void RemoveBoundingPlane(vtkPlane *plane)
A collection of plane equations used to bound the position of the point.
vtkClosedSurfacePointPlacer::RemoveAllBoundingPlanes
void RemoveAllBoundingPlanes()
A collection of plane equations used to bound the position of the point.
vtkClosedSurfacePointPlacer::SetBoundingPlanes
virtual void SetBoundingPlanes(vtkPlaneCollection *)
A collection of plane equations used to bound the position of the point.
vtkClosedSurfacePointPlacer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkClosedSurfacePointPlacer::SetBoundingPlanes
void SetBoundingPlanes(vtkPlanes *planes)
A collection of plane equations used to bound the position of the point.
vtkClosedSurfacePointPlacer::BoundingPlanes
vtkPlaneCollection * BoundingPlanes
Definition: vtkClosedSurfacePointPlacer.h:116
vtkClosedSurfacePointPlacer::GetDistanceFromObject
static double GetDistanceFromObject(double pos[3], vtkPlaneCollection *pc, double closestPt[3])
vtkClosedSurfacePointPlacer::ComputeWorldPosition
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::vtkClosedSurfacePointPlacer
vtkClosedSurfacePointPlacer()
vtkClosedSurfacePointPlacer::~vtkClosedSurfacePointPlacer
~vtkClosedSurfacePointPlacer() override
vtkClosedSurfacePointPlacer::BuildPlanes
void BuildPlanes()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:35
vtkPlane
perform various plane computations
Definition: vtkPlane.h:35
vtkPlanes
implicit function for convex set of planes
Definition: vtkPlanes.h:51
vtkPointPlacer
Abstract interface to translate 2D display positions to world coordinates.
Definition: vtkPointPlacer.h:39
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkPointPlacer.h
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154