openscenegraph
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
osg::KdTree Class Reference
Inheritance diagram for osg::KdTree:
osg::Shape osg::Object osg::Referenced

Classes

struct  KdNode
 
struct  LineSegmentIntersection
 
struct  Triangle
 

Public Types

typedef std::vector< LineSegmentIntersectionLineSegmentIntersections
 
typedef int value_type
 
typedef std::vector< KdNodeKdNodeList
 
typedef std::vector< TriangleTriangleList
 
- Public Types inherited from osg::Object
enum  DataVariance { DYNAMIC, STATIC, UNSPECIFIED }
 

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::Vec3d &start, const osg::Vec3d &end, LineSegmentIntersections &intersections) const
 
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
 
- Public Member Functions inherited from osg::Shape
 Shape ()
 
 Shape (const Shape &sa, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
virtual ObjectcloneType () const =0
 
virtual Objectclone (const CopyOp &) const =0
 
virtual bool isSameKindAs (const Object *obj) const
 
virtual const char * libraryName () const
 
virtual const char * className () const
 
virtual void accept (ShapeVisitor &)=0
 
virtual void accept (ConstShapeVisitor &) const =0
 
- Public Member Functions inherited from osg::Object
 Object ()
 
 Object (bool threadSafeRefUnref)
 
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
std::string getCompoundClassName () const
 
virtual NodeasNode ()
 
virtual const NodeasNode () const
 
virtual NodeVisitorasNodeVisitor ()
 
virtual const NodeVisitorasNodeVisitor () const
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () const
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
virtual void setName (const std::string &name)
 
void setName (const char *name)
 
const std::string & getName () const
 
void setDataVariance (DataVariance dv)
 
DataVariance getDataVariance () const
 
virtual void computeDataVariance ()
 
void setUserDataContainer (osg::UserDataContainer *udc)
 
template<class T >
void setUserDataContainer (const ref_ptr< T > &udc)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
template<class T >
void setUserData (const ref_ptr< T > &ud)
 
virtual ReferencedgetUserData ()
 
virtual const ReferencedgetUserData () const
 
template<typename T >
bool getUserValue (const std::string &name, T &value) const
 
template<typename T >
void setUserValue (const std::string &name, const T &value)
 
virtual void resizeGLObjectBuffers (unsigned int)
 
virtual void releaseGLObjects (osg::State *=0) const
 
template<typename T >
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool getUserValue (const std::string &name, T &value) const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Protected Attributes

osg::ref_ptr< osg::Vec3Array_vertices
 
KdNodeList _kdNodes
 
TriangleList _triangles
 
- Protected Attributes inherited from osg::Object
std::string _name
 
DataVariance _dataVariance
 
osg::UserDataContainer_userDataContainer
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 
- Protected Member Functions inherited from osg::Shape
virtual ~Shape ()
 
- Protected Member Functions inherited from osg::Object
virtual ~Object ()
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

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
KdNodeList& osg::KdTree::getNodes ( )
inline
const KdNodeList& osg::KdTree::getNodes ( ) const
inline
Triangle& osg::KdTree::getTriangle ( unsigned int  i)
inline
const Triangle& osg::KdTree::getTriangle ( unsigned int  i) const
inline
TriangleList& osg::KdTree::getTriangles ( )
inline
const TriangleList& osg::KdTree::getTriangles ( ) const
inline
const osg::Vec3Array* osg::KdTree::getVertices ( ) const
inline
virtual bool osg::KdTree::intersect ( const osg::Vec3d start,
const osg::Vec3d 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

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

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