VTK
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);
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  double displayPos[2],
88  double worldPos[3],
89  double worldOrient[9] );
90 
103  double displayPos[2],
104  double refWorldPos[2],
105  double worldPos[3],
106  double worldOrient[9] );
107 
113  int ValidateWorldPosition( double worldPos[3] );
114 
115  // Descrption:
116  // Orientationation is ignored, and the above method
117  // is called instead.
118  int ValidateWorldPosition( double worldPos[3],
119  double worldOrient[9]);
120 
121  // Descrption:
122  // The minimum distance the object should be from the faces of the object.
123  // Must be greater than 0. Default is 0.
124  vtkSetClampMacro( MinimumDistance, double, 0.0, VTK_DOUBLE_MAX );
125  vtkGetMacro( MinimumDistance, double );
126 
127 protected:
130 
131  // A collection of planes used to bound the projection
132  // plane
134 
135  // Calculate the distance of a point from the Object. Negative
136  // values imply that the point is outside. Positive values imply that it is
137  // inside. The closest point to the object is returned in closestPt.
138  static double GetDistanceFromObject( double pos[3],
139  vtkPlaneCollection * pc,
140  double closestPt[3]);
141 
142  void BuildPlanes();
143 
146 
147 private:
148  vtkClosedSurfacePointPlacer(const vtkClosedSurfacePointPlacer&) VTK_DELETE_FUNCTION;
149  void operator=(const vtkClosedSurfacePointPlacer&) VTK_DELETE_FUNCTION;
150 };
151 
152 #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:163
maintain a list of planes
implicit function for convex set of planes
Definition: vtkPlanes.h:54
abstract specification for renderers
Definition: vtkRenderer.h:63
void PrintSelf(ostream &os, vtkIndent indent)
Standard methods for instances of this class.
a simple class to control print indentation
Definition: vtkIndent.h:39
Abstract interface to translate 2D display positions to world coordinates.
perform various plane computations
Definition: vtkPlane.h:37
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.
PointPlacer to constrain validity within a set of convex planes.