VTK  9.0.20201019
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 
34 class vtkPlane;
35 class vtkPlaneCollection;
36 class vtkPlanes;
37 class vtkRenderer;
38 
39 class VTKINTERACTIONWIDGETS_EXPORT vtkClosedSurfacePointPlacer : public vtkPointPlacer
40 {
41 public:
46 
48 
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
64  void AddBoundingPlane(vtkPlane* plane);
65  void RemoveBoundingPlane(vtkPlane* plane);
66  void RemoveAllBoundingPlanes();
67  virtual void SetBoundingPlanes(vtkPlaneCollection*);
68  vtkGetObjectMacro(BoundingPlanes, vtkPlaneCollection);
69  void SetBoundingPlanes(vtkPlanes* planes);
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 
121 protected:
123  ~vtkClosedSurfacePointPlacer() override;
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 
134  void BuildPlanes();
135 
138 
139 private:
141  void operator=(const vtkClosedSurfacePointPlacer&) = delete;
142 };
143 
144 #endif
vtkPlane
perform various plane computations
Definition: vtkPlane.h:33
vtkPointPlacer
Abstract interface to translate 2D display positions to world coordinates.
Definition: vtkPointPlacer.h:49
vtkClosedSurfacePointPlacer::BoundingPlanes
vtkPlaneCollection * BoundingPlanes
Definition: vtkClosedSurfacePointPlacer.h:127
vtkPlanes
implicit function for convex set of planes
Definition: vtkPlanes.h:49
vtkPointPlacer::New
static vtkPointPlacer * New()
Instantiate this class.
vtkClosedSurfacePointPlacer::MinimumDistance
double MinimumDistance
Definition: vtkClosedSurfacePointPlacer.h:136
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkClosedSurfacePointPlacer::InnerBoundingPlanes
vtkPlaneCollection * InnerBoundingPlanes
Definition: vtkClosedSurfacePointPlacer.h:137
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkPointPlacer::ComputeWorldPosition
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...
vtkClosedSurfacePointPlacer
PointPlacer to constrain validity within a set of convex planes.
Definition: vtkClosedSurfacePointPlacer.h:39
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:33
vtkPointPlacer.h
vtkPointPlacer::ValidateWorldPosition
virtual int ValidateWorldPosition(double worldPos[3])
Given a world position check the validity of this position according to the constraints of the placer...
vtkPointPlacer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:157