55 #ifndef __vtkOBBTree_h
56 #define __vtkOBBTree_h
58 #include "vtkFiltersGeneralModule.h"
59 #include "vtkAbstractCellLocator.h"
77 void DebugPrintTree(
int level,
double *leaf_vol,
int *minCells,
83 class VTKFILTERSGENERAL_EXPORT
vtkOBBTree :
public vtkAbstractCellLocator
87 void PrintSelf(ostream& os, vtkIndent indent);
106 double a0[3],
double a1[3],
double tol,
107 double& t,
double x[3],
double pcoords[3],
111 IntersectWithLine(a0, a1, tol,t, x, pcoords, subId);
118 double a0[3],
double a1[3],
double tol,
119 double& t,
double x[3],
double pcoords[3],
120 int &subId, vtkIdType &cellId)
123 IntersectWithLine(a0, a1, tol,t, x, pcoords, subId, cellId);
136 int IntersectWithLine(
const double a0[3],
const double a1[3],
137 vtkPoints *points, vtkIdList *cellIds);
144 int IntersectWithLine(
double a0[3],
double a1[3],
double tol,
145 double& t,
double x[3],
double pcoords[3],
146 int &subId, vtkIdType &cellId, vtkGenericCell *cell);
160 double x[3],
double closestPoint[3],
161 vtkIdType &cellId,
int &subId,
double& dist2)
164 FindClosestPoint(x, closestPoint, cellId, subId, dist2);
171 double x[3],
double closestPoint[3],
172 vtkGenericCell *cell, vtkIdType &cellId,
173 int &subId,
double& dist2)
176 FindClosestPoint(x, closestPoint, cell, cellId, subId, dist2);
183 double x[3],
double radius,
184 double closestPoint[3], vtkIdType &cellId,
185 int &subId,
double& dist2)
187 return Superclass::FindClosestPointWithinRadius
188 (x, radius, closestPoint, cellId, subId, dist2);
195 double x[3],
double radius,
196 double closestPoint[3],
197 vtkGenericCell *cell, vtkIdType &cellId,
198 int &subId,
double& dist2)
200 return Superclass::FindClosestPointWithinRadius
201 (x, radius, closestPoint, cell, cellId, subId, dist2);
208 double x[3],
double radius,
double closestPoint[3],
209 vtkGenericCell *cell, vtkIdType &cellId,
210 int &subId,
double& dist2,
int &inside)
212 return Superclass::FindClosestPointWithinRadius
213 (x, radius, closestPoint, cell, cellId, subId, dist2, inside);
221 static void ComputeOBB(vtkPoints *pts,
double corner[3],
double max[3],
222 double mid[3],
double min[3],
double size[3]);
230 void ComputeOBB(vtkDataSet *input,
double corner[3],
double max[3],
231 double mid[3],
double min[3],
double size[3]);
238 int InsideOrOutside(
const double point[3]);
246 vtkMatrix4x4 *XformBtoA );
250 int LineIntersectsNode(
vtkOBBNode *pA,
double b0[3],
double b1[3] );
255 double p0[3],
double p1[3],
256 double p2[3], vtkMatrix4x4 *XformBtoA );
262 int IntersectWithOBBTree(
vtkOBBTree *OBBTreeB, vtkMatrix4x4 *XformBtoA,
273 void FreeSearchStructure();
285 void GenerateRepresentation(
int level, vtkPolyData *pd);
295 void ComputeOBB(vtkIdList *cells,
double corner[3],
double max[3],
296 double mid[3],
double min[3],
double size[3]);
299 void BuildTree(vtkIdList *cells,
vtkOBBNode *parent,
int level);
305 void GeneratePolygons(
vtkOBBNode *OBBptr,
int level,
int repLevel,
306 vtkPoints* pts, vtkCellArray *polys);
virtual void FindClosestPoint(double x[3], double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2, int &inside)
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
generate oriented bounding box (OBB) tree
virtual int IntersectWithLine(double a0[3], double a1[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId)
virtual void FindClosestPoint(double x[3], double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2)
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2)
virtual int IntersectWithLine(double a0[3], double a1[3], double tol, double &t, double x[3], double pcoords[3], int &subId)