Commit 5cc190f5 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added get bounds method.

parent 03a8797f
......@@ -123,6 +123,7 @@ public:
virtual int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
float x[3], float pcoords[3], int& subId) = 0;
void GetBounds(float bounds[6]);
float *GetBounds();
float GetLength2();
......
......@@ -118,7 +118,8 @@ char vlCell::HitBBox (float bounds[6], float origin[3], float dir[3],
}
// Description:
// Compute cell bounding box (xmin,xmax,ymin,ymax,zmin,zmax).
// Compute cell bounding box (xmin,xmax,ymin,ymax,zmin,zmax). Return pointer
// to array of six float values.
float *vlCell::GetBounds ()
{
float *x;
......@@ -140,6 +141,15 @@ float *vlCell::GetBounds ()
return bounds;
}
// Description:
// Compute cell bounding box (xmin,xmax,ymin,ymax,zmin,zmax). Copy result into
// user provided array.
void vlCell::GetBounds(float bounds[6])
{
float *b=this->GetBounds();
for (int i=0; i < 6; i++) bounds[i] = b[i];
}
// Description:
// Compute Length squared of cell (i.e., bounding box diagonal squared)
float vlCell::GetLength2 ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment