Convex polyhedron. More...
#include <BSPTreePoly.hpp>
Classes | |
struct | Edge |
struct | EdgeUse |
struct | Face |
struct | Vertex |
struct | VertexUse |
Public Member Functions | |
BSPTreePoly (const CartVect hex_corners[8]) | |
Initialize as a planar-faced hexahedron. More... | |
BSPTreePoly () | |
~BSPTreePoly () | |
ErrorCode | set (const CartVect hex_corners[8]) |
Initialize as a planar-faced hexahedron. More... | |
void | clear () |
void | get_faces (std::vector< const Face * > &face_list) const |
Get handles for faces. More... | |
void | get_vertices (const Face *face, std::vector< CartVect > &vertices) const |
Get corner coordinates for a face. More... | |
bool | cut_polyhedron (const CartVect &plane_normal, double plane_coeff) |
bool | is_point_contained (const CartVect &point) const |
double | volume () const |
Assumes planar faces. More... | |
bool | is_valid () const |
Static Public Member Functions | |
static void | reset_debug_ids () |
Private Member Functions | |
void | set_vertex_marks (int value) |
BSPTreePoly (const BSPTreePoly ©) | |
BSPTreePoly & | operator= (const BSPTreePoly ©) |
Private Attributes | |
Face * | faceList |
Convex polyhedron.
This class is used to represent the convex polyhedron that bounds a node in a general plane-based BSP-tree.
Definition at line 17 of file BSPTreePoly.hpp.
|
private |
|
inline |
Initialize as a planar-faced hexahedron.
hex_corners | Corner coordinates for a hexahedron, in Exodus/Patran order |
Definition at line 38 of file BSPTreePoly.hpp.
References hex_corners, and set().
|
inline |
Definition at line 42 of file BSPTreePoly.hpp.
|
inline |
void moab::BSPTreePoly::clear | ( | ) |
Definition at line 388 of file BSPTreePoly.cpp.
References faceList, and moab::BSPTreePoly::Face::nextPtr.
Referenced by set(), and ~BSPTreePoly().
bool moab::BSPTreePoly::cut_polyhedron | ( | const CartVect & | plane_normal, |
double | plane_coeff | ||
) |
Intersect a plane with a polyhedron, retaining the portion of the polyhedron below the plane. This will fail if polyhedron is not convex.
Definition at line 599 of file BSPTreePoly.cpp.
References moab::BSPTreePoly::VertexUse::edgePtr, moab::BSPTreePoly::EdgeUse::edgePtr, moab::BSPTreePoly::Edge::end(), EPSILON, faceList, moab::BSPTreePoly::Edge::forwardPtr, moab::BSPTreePoly::EdgeUse::insert_after(), moab::BSPTreePoly::Vertex::markVal, moab::BSPTreePoly::VertexUse::nextPtr, moab::BSPTreePoly::EdgeUse::nextPtr, moab::BSPTreePoly::Face::nextPtr, moab::BSPTreePoly::Edge::other(), moab::BSPTreePoly::Edge::reversePtr, set_vertex_marks(), moab::split_edge(), moab::split_face(), moab::BSPTreePoly::Edge::start(), and moab::BSPTreePoly::Edge::use().
Referenced by moab::BSPTreeIter::calculate_polyhedron().
void moab::BSPTreePoly::get_faces | ( | std::vector< const Face * > & | face_list | ) | const |
void moab::BSPTreePoly::get_vertices | ( | const Face * | face, |
std::vector< CartVect > & | vertices | ||
) | const |
Get corner coordinates for a face.
Definition at line 473 of file BSPTreePoly.cpp.
References moab::BSPTreePoly::EdgeUse::end(), and moab::BSPTreePoly::EdgeUse::nextPtr.
bool moab::BSPTreePoly::is_point_contained | ( | const CartVect & | point | ) | const |
Test if a point is contained in the polyhedron.
\NOTE algorithm assumes convex polyhedron.
Definition at line 877 of file BSPTreePoly.cpp.
bool moab::BSPTreePoly::is_valid | ( | ) | const |
Definition at line 805 of file BSPTreePoly.cpp.
References moab::BSPTreePoly::VertexUse::edgePtr, moab::BSPTreePoly::EdgeUse::edgePtr, moab::BSPTreePoly::EdgeUse::end(), faceList, moab::BSPTreePoly::EdgeUse::facePtr, moab::BSPTreePoly::VertexUse::nextPtr, moab::BSPTreePoly::EdgeUse::nextPtr, moab::BSPTreePoly::Face::nextPtr, moab::BSPTreePoly::VertexUse::prevPtr, moab::BSPTreePoly::EdgeUse::prevPtr, moab::BSPTreePoly::EdgeUse::start(), moab::BSPTreePoly::Vertex::usePtr, and moab::BSPTreePoly::VertexUse::vtxPtr.
|
private |
|
static |
For debugging, does nothing unless debug feature is enabled
Definition at line 189 of file BSPTreePoly.cpp.
Initialize as a planar-faced hexahedron.
hex_corners | Corner coordinates for a hexahedron, in Exodus/Patran order |
Definition at line 398 of file BSPTreePoly.cpp.
References clear(), faceList, moab::BSPTreePoly::Edge::forwardPtr, hex_corners, moab::BSPTreePoly::EdgeUse::insert_after(), MB_SUCCESS, and moab::BSPTreePoly::Edge::reversePtr.
Referenced by BSPTreePoly(), moab::BSPTreeIter::calculate_polyhedron(), and moab::BSPTreeBoxIter::calculate_polyhedron().
|
private |
Definition at line 508 of file BSPTreePoly.cpp.
References faceList.
Referenced by cut_polyhedron().
double moab::BSPTreePoly::volume | ( | ) | const |
Assumes planar faces.
Definition at line 500 of file BSPTreePoly.cpp.
References faceList, and moab::BSPTreePoly::Face::nextPtr.
Referenced by moab::BSPTreeIter::volume().
|
private |
Definition at line 27 of file BSPTreePoly.hpp.
Referenced by clear(), cut_polyhedron(), get_faces(), is_point_contained(), is_valid(), set(), set_vertex_marks(), and volume().