osg::KdTree Class Reference

`#include <KdTree>`

Inheritance diagram for osg::KdTree:

## Classes

struct | KdNode

## Public Types

typedef std::vector< unsigned int > | Indices
typedef int | value_type
typedef std::vector< KdNode > | KdNodeList
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::Vec3Array * | getVertices () const
void | setPrimitiveIndices (const Indices &indices)
Indices & | getPrimitiveIndices ()
const Indices & | getPrimitiveIndices () const
void | setVertexIndices (const Indices &indices)
Indices & | getVertexIndices ()
const Indices & | getVertexIndices () 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)
KdNode & | getNode (int nodeNum)
const KdNode & | getNode (int nodeNum) const
KdNodeList & | getNodes ()
const KdNodeList & | getNodes () 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 Object * | cloneType () const =0
virtual Object * | clone (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 Node * | asNode ()
virtual const Node * | asNode () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () 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::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
virtual void | setUserData (Referenced *obj)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () 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 &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () 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::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()
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

typedef int osg::KdTree::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 )

References KdTree(), and osg::CopyOp::SHALLOW_COPY.

## Member Function Documentation

## addLine()

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

inline

References _degenerateCount, _primitiveIndices, and _vertexIndices.

## addNode()

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

inline

References _kdNodes.

## addPoint()

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

inline

References _degenerateCount, _primitiveIndices, and _vertexIndices.

## addQuad()

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

inline

References _degenerateCount, _primitiveIndices, and _vertexIndices.

## addTriangle()

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

inline

References _degenerateCount, _primitiveIndices, and _vertexIndices.

## 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

References _kdNodes, _primitiveIndices, _vertexIndices, _vertices, osg::KdTree::KdNode::bb, osg::KdTree::KdNode::first, intersect(), OSG_NOTICE, and osg::KdTree::KdNode::second.

Referenced by intersect().

## 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

Referenced by addLine(), addPoint(), addQuad(), and addTriangle().

## _kdNodes

KdNodeList osg::KdTree::_kdNodes

protected

Referenced by addNode(), getNode(), getNode(), getNodes(), getNodes(), and intersect().

## _primitiveIndices

Indices osg::KdTree::_primitiveIndices

protected

Referenced by addLine(), addPoint(), addQuad(), addTriangle(), getPrimitiveIndices(), getPrimitiveIndices(), intersect(), and setPrimitiveIndices().

## _vertexIndices

Indices osg::KdTree::_vertexIndices

protected

Referenced by addLine(), addPoint(), addQuad(), addTriangle(), getVertexIndices(), getVertexIndices(), intersect(), and setVertexIndices().

## _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:

- KdTree