17#ifndef OSGSHADOW_CONVEXPOLYHEDRON
18#define OSGSHADOW_CONVEXPOLYHEDRON 1
58 void clear() { _faces.clear(); }
71 const double & plane_distance_tolerance = 0.0 );
78 const double & edge_normal_dot_tolerance = 0.0,
79 const double & null_edge_length_tolerance = 0.0 );
84 (
bool checkForNonConvexPolys =
false,
const char * errorPrefix =
NULL );
91 void cut(
const osg::Plane& plane,
const std::string& name=std::string());
110 const char * filename =
"convexpolyhedron.osg",
Definition ConvexPolyhedron:36
Faces _faces
Definition ConvexPolyhedron:50
void translate(const osg::Vec3d &offset)
static int isFacePolygonConvex(Face &face, bool ignoreCollinearVertices=true)
bool checkCoherency(bool checkForNonConvexPolys=false, const char *errorPrefix=NULL)
void getPoints(Vertices &vertices) const
void cut(const ConvexPolyhedron &polytope)
void removeDuplicateVertices(void)
ConvexPolyhedron(const osg::Matrix &matrix, const osg::Matrix &inverse, const osg::BoundingBox &bb=osg::BoundingBox(-1,-1,-1, 1, 1, 1))
Face & createFace()
Definition ConvexPolyhedron:57
static const osg::Matrix & defaultMatrix
Definition ConvexPolyhedron:40
static int pointsColinear(const osg::Vec3d &va, const osg::Vec3d &vb, const osg::Vec3d &vc, const double &edge_normal_dot_tolerance=0.0, const double &null_edge_length_tolerance=0.0)
osg::Geometry * buildGeometry(const osg::Vec4d &colorOutline, const osg::Vec4d &colorInside, osg::Geometry *useGeometry=NULL) const
bool mergeFaces(const Face &face0, const Face &face1, Face &face)
void mergeCoplanarFaces(const double &plane_normal_dot_tolerance=0.0, const double &plane_distance_tolerance=0.0)
void transform(const osg::Matrix &matrix, const osg::Matrix &inverse)
void clear()
Definition ConvexPolyhedron:58
osg::BoundingBox computeBoundingBox(const osg::Matrix &m=osgShadow::ConvexPolyhedron::defaultMatrix) const
void transformClip(const osg::Matrix &matrix, const osg::Matrix &inverse)
void setToBoundingBox(const osg::BoundingBox &bb)
void getPolytope(osg::Polytope &polytope) const
std::list< Face > Faces
Definition ConvexPolyhedron:49
std::vector< osg::Vec3d > Vertices
Definition ConvexPolyhedron:38
void setToUnitFrustum(bool withNear=true, bool withFar=true)
bool dumpGeometry(const Face *face=NULL, const osg::Plane *plane=NULL, ConvexPolyhedron *basehull=NULL, const char *filename="convexpolyhedron.osg", const osg::Vec4d &colorOutline=osg::Vec4(0, 1, 0, 0.5), const osg::Vec4d &colorInside=osg::Vec4(0, 1, 0, 0.25), const osg::Vec4d &faceColorOutline=osg::Vec4(0, 0, 1, 0.5), const osg::Vec4d &faceColorInside=osg::Vec4(0, 0, 1, 0.25), const osg::Vec4d &planeColorOutline=osg::Vec4(1, 0, 0, 0.5), const osg::Vec4d &planeColorInside=osg::Vec4(1, 0, 0, 0.25), const osg::Vec4d &baseColorOutline=osg::Vec4(0, 0, 0, 0.5), const osg::Vec4d &baseColorInside=osg::Vec4(0, 0, 0, 0.25)) const
void extrude(const osg::Vec3d &offset)
void cut(const osg::Polytope &polytope)
ConvexPolyhedron(void)
Definition ConvexPolyhedron:52
void cut(const osg::Plane &plane, const std::string &name=std::string())
Definition BoundingBox:34
A plane class. It can be used to represent an infinite plane.
Definition Plane:34
Definition ConvexPolyhedron:33
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39
#define NULL
Definition osg/Export:55
Definition ConvexPolyhedron:43
osg::Plane plane
Definition ConvexPolyhedron:45
std::string name
Definition ConvexPolyhedron:44
Vertices vertices
Definition ConvexPolyhedron:46