OpenSceneGraph 3.6.5
osgShadow::ConvexPolyhedron Class Reference

#include <ConvexPolyhedron>

Classes

struct  Face

Public Types

typedef std::vector< osg::Vec3dVertices
typedef std::list< FaceFaces

Public Member Functions

 ConvexPolyhedron (void)
 ConvexPolyhedron (const osg::Matrix &matrix, const osg::Matrix &inverse, const osg::BoundingBox &bb=osg::BoundingBox(-1,-1,-1, 1, 1, 1))
FacecreateFace ()
void clear ()
void setToUnitFrustum (bool withNear=true, bool withFar=true)
void setToBoundingBox (const osg::BoundingBox &bb)
void transform (const osg::Matrix &matrix, const osg::Matrix &inverse)
void transformClip (const osg::Matrix &matrix, const osg::Matrix &inverse)
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 removeDuplicateVertices (void)
bool checkCoherency (bool checkForNonConvexPolys=false, const char *errorPrefix=NULL)
void cut (const osg::Polytope &polytope)
void cut (const ConvexPolyhedron &polytope)
void cut (const osg::Plane &plane, const std::string &name=std::string())
void extrude (const osg::Vec3d &offset)
void translate (const osg::Vec3d &offset)
void getPolytope (osg::Polytope &polytope) const
void getPoints (Vertices &vertices) const
osg::BoundingBox computeBoundingBox (const osg::Matrix &m=osgShadow::ConvexPolyhedron::defaultMatrix) const
osg::GeometrybuildGeometry (const osg::Vec4d &colorOutline, const osg::Vec4d &colorInside, osg::Geometry *useGeometry=NULL) const
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

Static Public Member Functions

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)
static int isFacePolygonConvex (Face &face, bool ignoreCollinearVertices=true)

Public Attributes

Faces _faces

Static Public Attributes

static const osg::MatrixdefaultMatrix

Member Typedef Documentation

◆ Faces

◆ Vertices

Constructor & Destructor Documentation

◆ ConvexPolyhedron() [1/2]

osgShadow::ConvexPolyhedron::ConvexPolyhedron ( void )
inline

Referenced by cut(), and dumpGeometry().

◆ ConvexPolyhedron() [2/2]

osgShadow::ConvexPolyhedron::ConvexPolyhedron ( const osg::Matrix & matrix,
const osg::Matrix & inverse,
const osg::BoundingBox & bb = osg::BoundingBox(-1,-1,-1, 1, 1, 1) )

Member Function Documentation

◆ buildGeometry()

osg::Geometry * osgShadow::ConvexPolyhedron::buildGeometry ( const osg::Vec4d & colorOutline,
const osg::Vec4d & colorInside,
osg::Geometry * useGeometry = NULL ) const

References NULL.

◆ checkCoherency()

bool osgShadow::ConvexPolyhedron::checkCoherency ( bool checkForNonConvexPolys = false,
const char * errorPrefix = NULL )

References NULL.

◆ clear()

void osgShadow::ConvexPolyhedron::clear ( )
inline

References _faces.

◆ computeBoundingBox()

osg::BoundingBox osgShadow::ConvexPolyhedron::computeBoundingBox ( const osg::Matrix & m = osgShadow::ConvexPolyhedron::defaultMatrix) const

References defaultMatrix.

◆ createFace()

Face & osgShadow::ConvexPolyhedron::createFace ( )
inline

References _faces.

◆ cut() [1/3]

void osgShadow::ConvexPolyhedron::cut ( const ConvexPolyhedron & polytope)

References ConvexPolyhedron().

◆ cut() [2/3]

void osgShadow::ConvexPolyhedron::cut ( const osg::Plane & plane,
const std::string & name = std::string() )

◆ cut() [3/3]

void osgShadow::ConvexPolyhedron::cut ( const osg::Polytope & polytope)

◆ dumpGeometry()

bool osgShadow::ConvexPolyhedron::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

References ConvexPolyhedron(), and NULL.

◆ extrude()

void osgShadow::ConvexPolyhedron::extrude ( const osg::Vec3d & offset)

◆ getPoints()

void osgShadow::ConvexPolyhedron::getPoints ( Vertices & vertices) const

◆ getPolytope()

void osgShadow::ConvexPolyhedron::getPolytope ( osg::Polytope & polytope) const

◆ isFacePolygonConvex()

int osgShadow::ConvexPolyhedron::isFacePolygonConvex ( Face & face,
bool ignoreCollinearVertices = true )
static

◆ mergeCoplanarFaces()

void osgShadow::ConvexPolyhedron::mergeCoplanarFaces ( const double & plane_normal_dot_tolerance = 0.0,
const double & plane_distance_tolerance = 0.0 )

◆ mergeFaces()

bool osgShadow::ConvexPolyhedron::mergeFaces ( const Face & face0,
const Face & face1,
Face & face )

◆ pointsColinear()

int osgShadow::ConvexPolyhedron::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 )
static

◆ removeDuplicateVertices()

void osgShadow::ConvexPolyhedron::removeDuplicateVertices ( void )

◆ setToBoundingBox()

void osgShadow::ConvexPolyhedron::setToBoundingBox ( const osg::BoundingBox & bb)

◆ setToUnitFrustum()

void osgShadow::ConvexPolyhedron::setToUnitFrustum ( bool withNear = true,
bool withFar = true )

◆ transform()

void osgShadow::ConvexPolyhedron::transform ( const osg::Matrix & matrix,
const osg::Matrix & inverse )

◆ transformClip()

void osgShadow::ConvexPolyhedron::transformClip ( const osg::Matrix & matrix,
const osg::Matrix & inverse )

◆ translate()

void osgShadow::ConvexPolyhedron::translate ( const osg::Vec3d & offset)

Member Data Documentation

◆ _faces

Faces osgShadow::ConvexPolyhedron::_faces

Referenced by clear(), and createFace().

◆ defaultMatrix

const osg::Matrix& osgShadow::ConvexPolyhedron::defaultMatrix
static

Referenced by computeBoundingBox().


The documentation for this class was generated from the following file:

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.