OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
osg::KdTree Class Reference

#include <KdTree.h>

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

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 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)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
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.

Definition at line 26 of file KdTree.h.

Member Typedef Documentation

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

Definition at line 129 of file KdTree.h.

Definition at line 83 of file KdTree.h.

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

Definition at line 130 of file KdTree.h.

Definition at line 89 of file KdTree.h.

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

Definition at line 132 of file KdTree.h.

unsigned int osg::KdTree::addTriangle ( const Triangle tri)
inline

Definition at line 148 of file KdTree.h.

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

Definition at line 139 of file KdTree.h.

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

Definition at line 140 of file KdTree.h.

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

Definition at line 142 of file KdTree.h.

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

Definition at line 143 of file KdTree.h.

Triangle& osg::KdTree::getTriangle ( unsigned int  i)
inline

Definition at line 155 of file KdTree.h.

const Triangle& osg::KdTree::getTriangle ( unsigned int  i) const
inline

Definition at line 156 of file KdTree.h.

TriangleList& osg::KdTree::getTriangles ( )
inline

Definition at line 158 of file KdTree.h.

const TriangleList& osg::KdTree::getTriangles ( ) const
inline

Definition at line 159 of file KdTree.h.

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

Definition at line 146 of file KdTree.h.

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

Definition at line 35 of file KdTree.h.

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

Definition at line 145 of file KdTree.h.

Member Data Documentation

KdNodeList osg::KdTree::_kdNodes
protected

Definition at line 165 of file KdTree.h.

TriangleList osg::KdTree::_triangles
protected

Definition at line 166 of file KdTree.h.

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

Definition at line 164 of file KdTree.h.


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