VTK  9.1.0
vtkClosedSurfacePointPlacer.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkClosedSurfacePointPlacer.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#ifndef vtkClosedSurfacePointPlacer_h
29#define vtkClosedSurfacePointPlacer_h
30
31#include "vtkInteractionWidgetsModule.h" // For export macro
32#include "vtkPointPlacer.h"
33
34class vtkPlane;
36class vtkPlanes;
37class vtkRenderer;
38
39class VTKINTERACTIONWIDGETS_EXPORT vtkClosedSurfacePointPlacer : public vtkPointPlacer
40{
41public:
46
48
52 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56
68 vtkGetObjectMacro(BoundingPlanes, vtkPlaneCollection);
71
87 vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
88
100 int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[2],
101 double worldPos[3], double worldOrient[9]) override;
102
108 int ValidateWorldPosition(double worldPos[3]) override;
109
110 // Descrption:
111 // Orientationation is ignored, and the above method
112 // is called instead.
113 int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
114
115 // Descrption:
116 // The minimum distance the object should be from the faces of the object.
117 // Must be greater than 0. Default is 0.
118 vtkSetClampMacro(MinimumDistance, double, 0.0, VTK_DOUBLE_MAX);
119 vtkGetMacro(MinimumDistance, double);
120
121protected:
124
125 // A collection of planes used to bound the projection
126 // plane
128
129 // Calculate the distance of a point from the Object. Negative
130 // values imply that the point is outside. Positive values imply that it is
131 // inside. The closest point to the object is returned in closestPt.
132 static double GetDistanceFromObject(double pos[3], vtkPlaneCollection* pc, double closestPt[3]);
133
135
138
139private:
141 void operator=(const vtkClosedSurfacePointPlacer&) = delete;
142};
143
144#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])
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double refWorldPos[2], double worldPos[3], double worldOrient[9]) override
Given a renderer, a display position and a reference position, "worldPos" is calculated as : Consider...
static vtkClosedSurfacePointPlacer * New()
Instantiate this class.
~vtkClosedSurfacePointPlacer() override
a simple class to control print indentation
Definition: vtkIndent.h:113
maintain a list of planes
perform various plane computations
Definition: vtkPlane.h:143
implicit function for convex set of planes
Definition: vtkPlanes.h:159
Abstract interface to translate 2D display positions to world coordinates.
abstract specification for renderers
Definition: vtkRenderer.h:182
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165