openscenegraph
osg::KdTree Class Reference

#include <KdTree>

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

Classes

struct  KdNode

Public Types

typedef std::vector< unsigned int > Indices
typedef int value_type
typedef std::vector< KdNodeKdNodeList
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)
void setVertices (osg::Vec3Array *vertices)
const osg::Vec3ArraygetVertices () const
void setPrimitiveIndices (const Indices &indices)
IndicesgetPrimitiveIndices ()
const IndicesgetPrimitiveIndices () const
void setVertexIndices (const Indices &indices)
IndicesgetVertexIndices ()
const IndicesgetVertexIndices () const
unsigned int addPoint (unsigned int p0)
unsigned int addLine (unsigned int p0, unsigned int p1)
unsigned int addTriangle (unsigned int p0, unsigned int p1, unsigned int p2)
unsigned int addQuad (unsigned int p0, unsigned int p1, unsigned int p2, unsigned int p3)
int addNode (const KdNode &node)
KdNodegetNode (int nodeNum)
const KdNodegetNode (int nodeNum) const
KdNodeListgetNodes ()
const KdNodeListgetNodes () const
template<class IntersectFunctor>
void intersect (IntersectFunctor &functor, const KdNode &node) 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 StateSetasStateSet ()
virtual const StateSetasStateSet () const
virtual StateAttributeasStateAttribute ()
virtual const StateAttributeasStateAttribute () const
virtual UniformasUniform ()
virtual const UniformasUniform () const
virtual CameraasCamera ()
virtual const CameraasCamera () const
virtual DrawableasDrawable ()
virtual const DrawableasDrawable () const
virtual CallbackasCallback ()
virtual const CallbackasCallback () const
virtual CallbackObjectasCallbackObject ()
virtual const CallbackObjectasCallbackObject () const
virtual UserDataContainerasUserDataContainer ()
virtual const UserDataContainerasUserDataContainer () const
virtual ValueObjectasValueObject ()
virtual const ValueObjectasValueObject () const
virtual ImageasImage ()
virtual const ImageasImage () 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

Public Attributes

unsigned int _degenerateCount

Protected Attributes

osg::ref_ptr< osg::Vec3Array_vertices
Indices _primitiveIndices
Indices _vertexIndices
KdNodeList _kdNodes
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 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

◆ Indices

typedef std::vector< unsigned int > osg::KdTree::Indices

◆ KdNodeList

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

◆ value_type

Constructor & Destructor Documentation

◆ KdTree() [1/2]

osg::KdTree::KdTree ( )

Referenced by KdTree(), and META_Shape().

◆ KdTree() [2/2]

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

Member Function Documentation

◆ addLine()

unsigned int osg::KdTree::addLine ( unsigned int p0,
unsigned int p1 )
inline

◆ addNode()

int osg::KdTree::addNode ( const KdNode & node)
inline

References _kdNodes.

◆ addPoint()

unsigned int osg::KdTree::addPoint ( unsigned int p0)
inline

◆ addQuad()

unsigned int osg::KdTree::addQuad ( unsigned int p0,
unsigned int p1,
unsigned int p2,
unsigned int p3 )
inline

◆ addTriangle()

unsigned int osg::KdTree::addTriangle ( unsigned int p0,
unsigned int p1,
unsigned int p2 )
inline

◆ build()

virtual bool osg::KdTree::build ( BuildOptions & buildOptions,
osg::Geometry * geometry )
virtual

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

◆ getNode() [1/2]

KdNode & osg::KdTree::getNode ( int nodeNum)
inline

References _kdNodes.

◆ getNode() [2/2]

const KdNode & osg::KdTree::getNode ( int nodeNum) const
inline

References _kdNodes.

◆ getNodes() [1/2]

KdNodeList & osg::KdTree::getNodes ( )
inline

References _kdNodes.

◆ getNodes() [2/2]

const KdNodeList & osg::KdTree::getNodes ( ) const
inline

References _kdNodes.

◆ getPrimitiveIndices() [1/2]

Indices & osg::KdTree::getPrimitiveIndices ( )
inline

References _primitiveIndices.

◆ getPrimitiveIndices() [2/2]

const Indices & osg::KdTree::getPrimitiveIndices ( ) const
inline

References _primitiveIndices.

◆ getVertexIndices() [1/2]

Indices & osg::KdTree::getVertexIndices ( )
inline

References _vertexIndices.

◆ getVertexIndices() [2/2]

const Indices & osg::KdTree::getVertexIndices ( ) const
inline

References _vertexIndices.

◆ getVertices()

const osg::Vec3Array * osg::KdTree::getVertices ( ) const
inline

References _vertices.

◆ intersect()

template<class IntersectFunctor>
void osg::KdTree::intersect ( IntersectFunctor & functor,
const KdNode & node ) const
inline

◆ META_Shape()

osg::KdTree::META_Shape ( osg ,
KdTree  )
inline

References KdTree(), and OSG_EXPORT.

◆ setPrimitiveIndices()

void osg::KdTree::setPrimitiveIndices ( const Indices & indices)
inline

References _primitiveIndices.

◆ setVertexIndices()

void osg::KdTree::setVertexIndices ( const Indices & indices)
inline

References _vertexIndices.

◆ setVertices()

void osg::KdTree::setVertices ( osg::Vec3Array * vertices)
inline

References _vertices.

Member Data Documentation

◆ _degenerateCount

unsigned int osg::KdTree::_degenerateCount

◆ _kdNodes

KdNodeList osg::KdTree::_kdNodes
protected

◆ _primitiveIndices

◆ _vertexIndices

◆ _vertices

osg::ref_ptr<osg::Vec3Array> osg::KdTree::_vertices
protected

Referenced by getVertices(), intersect(), and setVertices().


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