version 3.3

VRS::PrimitiveQuadTreeGL Class Reference

#include <vrs/opengl/primitivequadtreegl.h>

Inheritance diagram for VRS::PrimitiveQuadTreeGL:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 PrimitiveQuadTreeGL (unsigned int depth, const SO< PolygonSet > &poly, const Bounds &area=Bounds(), bool duplicateTrianglesForIntersectedNodes=false)
 PrimitiveQuadTreeGL (unsigned int depth, const SO< MappedVertexAttributeDataGL > &vertexData, const Bounds &bbox, const std::vector< unsigned int > &indices=std::vector< unsigned int >(), bool duplicateDataForIntersectedNodes=false)
 PrimitiveQuadTreeGL (unsigned int depth, const SO< MappedVertexAttributeShapeGL > &shape, const Bounds &bbox=Bounds(), bool duplicateDataForIntersectedNodes=false)
unsigned int depth () const
Bounds boundingBox () const
SO< MappedVertexAttributeDataGLmappedVertexAttributeData () const
SO
< BaseVertexAttributeBufferObjectGL
indexBufferObject () const
SO< Iterator< unsigned int > > nodeFirstIndex () const
SO< Iterator< Bounds > > nodeBounds () const
 VRS_TYPEINFO (PrimitiveQuadTreeGL, MonoAttribute)
 VRS_SERIALIZABLE (PrimitiveQuadTreeGL)

Protected Member Functions

 PrimitiveQuadTreeGL ()

Friends

class PrimitiveQuadTreeAreaPainterGL
class PrimitiveQuadTreeDistancePainterGL
class PrimitiveQuadTreeAreaRayIntersectorGL
class PrimitiveQuadTreeDistanceRayIntersectorGL


Detailed Description

The PrimitiveQuadTree is a spatial data structure for efficient rendering of geometry distributed mainly in the x-z-plane. Its main advantage is the possibility to render rectangular sub-ranges very efficiently. For this, it provides the geometry as an MonoAttribute. Below such an attribute, you can insert PrimitiveQuadTreeAreaGL instances in order to render specific ranges of the geometry.

Constructor & Destructor Documentation

VRS::PrimitiveQuadTreeGL::PrimitiveQuadTreeGL ( unsigned int  depth,
const SO< PolygonSet > &  poly,
const Bounds area = Bounds(),
bool  duplicateTrianglesForIntersectedNodes = false 
)

Constructs a PrimitiveQuadtree for a given area. Note that only two dimensions are considered, i.e. the y-component of 'area' and these of the triangles in 'poly' do not have any effect on the spatial order. If you define 'area' it must contain the bounding box of poly (without consideration of the y-axis). If you leave it out, the bounding box of 'poly' is used as area. 'poly' must contain a single range of triangles. If poly is empty, this causes no error. However, no data is created and all iterator methods will return NULL. "duplicateTrianglesForIntersectedNodes" specifies that if a triangle intersects several leaf nodes of the quad tree the triangle should be inserted into the triangle list of all intersected nodes; otherwise the triangle is only inserted into the triangle list of the node containing the triangle's center point.

VRS::PrimitiveQuadTreeGL::PrimitiveQuadTreeGL ( unsigned int  depth,
const SO< MappedVertexAttributeDataGL > &  vertexData,
const Bounds bbox,
const std::vector< unsigned int > &  indices = std::vector< unsigned int >(),
bool  duplicateDataForIntersectedNodes = false 
)

VRS::PrimitiveQuadTreeGL::PrimitiveQuadTreeGL ( unsigned int  depth,
const SO< MappedVertexAttributeShapeGL > &  shape,
const Bounds bbox = Bounds(),
bool  duplicateDataForIntersectedNodes = false 
)

behaves like the PolygonSet-c'tor. The shape must contain only GL_TRIANGLES without ranges.

VRS::PrimitiveQuadTreeGL::PrimitiveQuadTreeGL (  )  [protected]


Member Function Documentation

unsigned int VRS::PrimitiveQuadTreeGL::depth (  )  const

Returns the depth set during construction.

Bounds VRS::PrimitiveQuadTreeGL::boundingBox (  )  const

Returns the bounding box of the contained geometry.

SO<MappedVertexAttributeDataGL> VRS::PrimitiveQuadTreeGL::mappedVertexAttributeData (  )  const

Returns the vertex attributes

SO<BaseVertexAttributeBufferObjectGL> VRS::PrimitiveQuadTreeGL::indexBufferObject (  )  const

Returns a buffer object containing all indices

SO<Iterator<unsigned int> > VRS::PrimitiveQuadTreeGL::nodeFirstIndex (  )  const

Used by the painter. The iterator contains the 'firstIndex' entry of each node.

SO<Iterator<Bounds> > VRS::PrimitiveQuadTreeGL::nodeBounds (  )  const

Used by the painter. The iterator contains the 'bounds' entry for each node.

VRS::PrimitiveQuadTreeGL::VRS_TYPEINFO ( PrimitiveQuadTreeGL  ,
MonoAttribute   
)

VRS::PrimitiveQuadTreeGL::VRS_SERIALIZABLE ( PrimitiveQuadTreeGL   ) 


Friends And Related Function Documentation

friend class PrimitiveQuadTreeAreaPainterGL [friend]

friend class PrimitiveQuadTreeDistancePainterGL [friend]


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

Generated on Tue May 22 06:00:24 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact