41 unsigned int _numVerticesProcessed;
42 unsigned int _targetNumTrianglesPerLeaf;
43 unsigned int _maxNumLevels;
56 typedef std::vector< unsigned int >
Indices;
78 inline unsigned int addLine(
unsigned int p0,
unsigned int p1)
89 inline unsigned int addTriangle(
unsigned int p0,
unsigned int p1,
unsigned int p2)
101 inline unsigned int addQuad(
unsigned int p0,
unsigned int p1,
unsigned int p2,
unsigned int p3)
137 int num =
static_cast<int>(
_kdNodes.size());
149 template<
class IntersectFunctor>
155 int istart = -node.
first-1;
156 int iend = istart + node.
second;
158 for(
int i=istart; i<iend; ++i)
169 default :
OSG_NOTICE<<
"Warning: KdTree::intersect() encounted unsupported primitive size of "<<numVertices<<std::endl;
break;
173 else if (functor.enter(node.
bb))
#define OSG_NOTICE
Definition Notify:86
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
TemplateArray< Vec3, Array::Vec3ArrayType, 3, GL_FLOAT > Vec3Array
Definition Array:449
BoundingBoxd BoundingBox
Definition BoundingBox:257
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void intersect(IntersectFunctor &functor, const KdNode &node) const
Definition KdTree:150
unsigned int addTriangle(unsigned int p0, unsigned int p1, unsigned int p2)
Definition KdTree:89
Indices & getPrimitiveIndices()
Definition KdTree:60
void setVertexIndices(const Indices &indices)
Definition KdTree:64
const Indices & getVertexIndices() const
Definition KdTree:66
unsigned int addPoint(unsigned int p0)
Definition KdTree:69
const osg::Vec3Array * getVertices() const
Definition KdTree:53
META_Shape(osg, KdTree) struct OSG_EXPORT BuildOptions
Definition KdTree:35
KdNode & getNode(int nodeNum)
Definition KdTree:142
int addNode(const KdNode &node)
Definition KdTree:135
unsigned int addLine(unsigned int p0, unsigned int p1)
Definition KdTree:78
Indices _primitiveIndices
Definition KdTree:187
Indices _vertexIndices
Definition KdTree:188
const KdNodeList & getNodes() const
Definition KdTree:146
int value_type
Definition KdTree:116
std::vector< unsigned int > Indices
Definition KdTree:56
unsigned int _degenerateCount
Definition KdTree:182
KdNodeList _kdNodes
Definition KdTree:189
std::vector< KdNode > KdNodeList
Definition KdTree:133
Indices & getVertexIndices()
Definition KdTree:65
void setVertices(osg::Vec3Array *vertices)
Definition KdTree:52
osg::ref_ptr< osg::Vec3Array > _vertices
Definition KdTree:186
const KdNode & getNode(int nodeNum) const
Definition KdTree:143
KdTree(const KdTree &rhs, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual bool build(BuildOptions &buildOptions, osg::Geometry *geometry)
Build the kdtree from the specified source geometry object.
void setPrimitiveIndices(const Indices &indices)
Definition KdTree:59
unsigned int addQuad(unsigned int p0, unsigned int p1, unsigned int p2, unsigned int p3)
Definition KdTree:101
const Indices & getPrimitiveIndices() const
Definition KdTree:61
KdNodeList & getNodes()
Definition KdTree:145
value_type second
Definition KdTree:131
osg::BoundingBox bb
Definition KdTree:128
value_type first
Definition KdTree:130
KdNode(value_type f, value_type s)
Definition KdTree:124
KdNode()
Definition KdTree:120
KdTree::BuildOptions _buildOptions
Definition KdTree:206
virtual ~KdTreeBuilder()
Definition KdTree:214
void apply(Geometry &geometry)
osg::ref_ptr< osg::KdTree > _kdTreePrototype
Definition KdTree:208
KdTreeBuilder(const KdTreeBuilder &rhs)
META_NodeVisitor(osg, KdTreeBuilder) virtual KdTreeBuilder *clone()
Definition KdTree:200
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
virtual Object * clone(const CopyOp &) const =0
Clone an object, with Object* return type.
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for all shape types.
Definition Shape:49
#define OSG_EXPORT
Definition Export:39