OpenSceneGraph 2.8.4
Classes | Public Types | Public Member Functions | Protected Attributes
osg::KdTree Class Reference

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

Inheritance diagram for osg::KdTree:
Inheritance graph
[legend]

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< KdNodeKdNodeList
typedef std::vector< TriangleTriangleList

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)
 Build the kdtree from the specified source geometry object.
virtual bool intersect (const osg::Vec3 &start, const osg::Vec3 &end, LineSegmentIntersections &intersections) const
 compute the intersection of a line segment and the kdtree, return true if an intersection has been found.
int addNode (const KdNode &node)
KdNodegetNode (int nodeNum)
const KdNodegetNode (int nodeNum) const
KdNodeListgetNodes ()
const KdNodeListgetNodes () const
void setVertices (osg::Vec3Array *vertices)
const osg::Vec3ArraygetVertices () const
unsigned int addTriangle (const Triangle &tri)
TrianglegetTriangle (unsigned int i)
const TrianglegetTriangle (unsigned int i) const
TriangleListgetTriangles ()
const TriangleListgetTriangles () 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:

osg logo
Generated at Sun Jan 8 2012 13:16:12 for the OpenSceneGraph by doxygen 1.7.4.