Classes | Public Types | Public Member Functions | Protected Attributes

osg::KdTree Class Reference

Inheritance diagram for osg::KdTree:
osg::Shape osg::Object osg::Referenced

List of all members.

Classes

struct  KdNode
struct  LineSegmentIntersection
struct  Triangle

Public Types

typedef std::vector
< LineSegmentIntersection > 
LineSegmentIntersections
typedef int value_type
typedef std::vector< KdNode > KdNodeList
typedef std::vector< Triangle > TriangleList

Public Member Functions

 KdTree ()
 KdTree (const KdTree &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Shape (osg, KdTree) struct OSG_EXPORT BuildOptions
virtual bool build (BuildOptions &buildOptions, osg::Geometry *geometry)
virtual bool intersect (const osg::Vec3 &start, const osg::Vec3 &end, LineSegmentIntersections &intersections) const
int addNode (const KdNode &node)
KdNode & getNode (int nodeNum)
const KdNode & getNode (int nodeNum) const
KdNodeList & getNodes ()
const KdNodeList & getNodes () const
void setVertices (osg::Vec3Array *vertices)
const osg::Vec3Array * getVertices () const
unsigned int addTriangle (const Triangle &tri)
Triangle & getTriangle (unsigned int i)
const Triangle & getTriangle (unsigned int i) const
TriangleList & getTriangles ()
const TriangleList & getTriangles () const

Protected Attributes

osg::ref_ptr< osg::Vec3Array > _vertices
KdNodeList _kdNodes
TriangleList _triangles

Detailed Description

Implementation of a kdtree for Geometry leaves, to enable fast intersection tests.


Member Typedef Documentation

typedef std::vector< KdNode > osg::KdTree::KdNodeList
typedef std::vector< Triangle > osg::KdTree::TriangleList

Constructor & Destructor Documentation

osg::KdTree::KdTree (  ) 
osg::KdTree::KdTree ( const KdTree &  rhs,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY 
)

Member Function Documentation

int osg::KdTree::addNode ( const KdNode &  node  )  [inline]
unsigned int osg::KdTree::addTriangle ( const Triangle &  tri  )  [inline]
virtual bool osg::KdTree::build ( BuildOptions &  buildOptions,
osg::Geometry *  geometry 
) [virtual]

Build the kdtree from the specified source geometry object. retun true on success.

KdNode& osg::KdTree::getNode ( int  nodeNum  )  [inline]
const KdNode& osg::KdTree::getNode ( int  nodeNum  )  const [inline]
const KdNodeList& osg::KdTree::getNodes (  )  const [inline]
KdNodeList& osg::KdTree::getNodes (  )  [inline]
const Triangle& osg::KdTree::getTriangle ( unsigned int  i  )  const [inline]
Triangle& osg::KdTree::getTriangle ( unsigned int  i  )  [inline]
const TriangleList& osg::KdTree::getTriangles (  )  const [inline]
TriangleList& osg::KdTree::getTriangles (  )  [inline]
const osg::Vec3Array* osg::KdTree::getVertices (  )  const [inline]
virtual bool osg::KdTree::intersect ( const osg::Vec3 &  start,
const osg::Vec3 &  end,
LineSegmentIntersections &  intersections 
) const [virtual]

compute the intersection of a line segment and the kdtree, return true if an intersection has been found.

osg::KdTree::META_Shape ( osg  ,
KdTree   
) [inline]
void osg::KdTree::setVertices ( osg::Vec3Array *  vertices  )  [inline]

Member Data Documentation


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