libmove3d  3.13.0
Public Member Functions
gpAABBTris Class Reference

#include <gpKdTree.h>

List of all members.

Public Member Functions

 gpAABBTris (gpKdTreeTris *tree, std::list< unsigned int > &inner_triangles)
 constructor for root AABB
 gpAABBTris (gpAABBTris *previous, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
 constructor for non root AABB
bool isTriangleOutside (p3d_vector3 p1, p3d_vector3 p2, p3d_vector3 p3)
bool isInsidePolyhedre ()
int divide ()
int draw (unsigned int level)
int sample (double step, std::list< gpVector3D > &points)

Detailed Description

A class for Axis-Aligned Bounding Box of a p3d_polyhedre (a set of triangles). It is used in an associated Kd tree class.


Constructor & Destructor Documentation

gpAABBTris::gpAABBTris ( gpKdTreeTris tree,
std::list< unsigned int > &  inner_triangles 
)

constructor for root AABB

Constructor for root gpAABBTris.

Parameters:
treepointer to the Kd tree, the AABB will belong to
inner_pointslist of the points the AABB must bound
gpAABBTris::gpAABBTris ( gpAABBTris previous,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax 
)

constructor for non root AABB

Constructor for non root gpAABBTris.

Parameters:
previouspointer to the previous AABB in the tree
xminminimal coordinate of the AABB along x axis
xmaxmaximal coordinate of the AABB along x axis
yminminimal coordinate of the AABB along y axis
ymaxmaximal coordinate of the AABB along y axis
zminminimal coordinate of the AABB along z axis
zmaxmaximal coordinate of the AABB along z axis
inner_pointslist of the points the AABB must bound

Member Function Documentation

int gpAABBTris::divide ( )

Divides an AABB along its larger dimension.

Returns:
GP_OK in case of success, GP_ERROR otherwise
int gpAABBTris::draw ( unsigned int  level)

Draws a gpAABBTris if its level is equal to the input value or if it is a leaf and if it is not ouside the polyhedron interior.

Parameters:
levelthe value to compare to the gpAABB level
Returns:
GP_OK in case of success, GP_ERROR otherwise
bool gpAABBTris::isInsidePolyhedre ( )

Tests if the AABB is entirely inside the p3d_polyhedre.

Returns:
true if the AABB is completely inside the triangle mesh, false otherwise
bool gpAABBTris::isTriangleOutside ( p3d_vector3  p1,
p3d_vector3  p2,
p3d_vector3  p3 
)

Tests if a triangle is completely outside the AABB.

Parameters:
p1first vertex of the triangle
p2second vertex of the triangle
p3third vertex of the triangle
Returns:
true if the triangle is completely outside the AABB, false otherwise

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines