GLC_Octree : represent space partioning implementation with octree. More...
#include <glc_octree.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_Octree (GLC_3DViewCollection *) | |
| Create an empty octree of the given 3D view collection. | |
| GLC_Octree (const GLC_Octree &) | |
| Create the octree from the given octree. | |
| virtual | ~GLC_Octree () |
| Destructor. | |
Private Member Functions | |
| void | createBoxWithMaterial (GLC_3DViewCollection *, GLC_OctreeNode *, GLC_Material *) |
| Create octree box representation in the given 3d view collection. | |
Private Attributes | |
| GLC_OctreeNode * | m_pRootNode |
| Octree root node. | |
| int | m_OctreeDepth |
| Octree depth. | |
Static Private Attributes | |
| static int | m_DefaultOctreeDepth = 3 |
| The default octree Depth. | |
Get Functions | |
|
| |
| virtual QList < GLC_3DViewInstance * > | listOfIntersectedInstances (const GLC_BoundingBox &bBox) |
| Return the list off instances inside or intersect the given bounding box. | |
| static int | defaultDepth () |
| Return the default octree Depth. | |
Set Functions | |
|
| |
| virtual void | updateViewableInstances (const GLC_Frustum &) |
| Update the viewable 3d view instance of this octree from the given frustum. | |
| virtual void | updateSpacePartitioning () |
| Update this octree space partionning. | |
| virtual void | clear () |
| Clear the space partionning. | |
| void | setDepth (int) |
| Set this octree depth. | |
| void | createBox (GLC_Material *, GLC_3DViewCollection *pCol=NULL) |
| Create octree box representation in the given collection with the specified material. | |
| static void | setDefaultDepth (int depth) |
| Set the default octree depth. | |
GLC_Octree : represent space partioning implementation with octree.
Definition at line 38 of file glc_octree.h.
| GLC_Octree::GLC_Octree | ( | GLC_3DViewCollection * | pCollection | ) |
Create an empty octree of the given 3D view collection.
Definition at line 31 of file glc_octree.cpp.
| GLC_Octree::GLC_Octree | ( | const GLC_Octree & | octree | ) |
Create the octree from the given octree.
Definition at line 40 of file glc_octree.cpp.
References GLC_OctreeNode, and m_pRootNode.
| GLC_Octree::~GLC_Octree | ( | ) | [virtual] |
| void GLC_Octree::clear | ( | void | ) | [virtual] |
Clear the space partionning.
Implements GLC_SpacePartitioning.
Definition at line 93 of file glc_octree.cpp.
References m_pRootNode.
| void GLC_Octree::createBox | ( | GLC_Material * | pMat, | |
| GLC_3DViewCollection * | pCol = NULL | |||
| ) |
Create octree box representation in the given collection with the specified material.
Definition at line 108 of file glc_octree.cpp.
References createBoxWithMaterial(), GLC_OctreeNode::isEmpty(), GLC_SpacePartitioning::m_pCollection, m_pRootNode, and updateSpacePartitioning().
| void GLC_Octree::createBoxWithMaterial | ( | GLC_3DViewCollection * | pCol, | |
| GLC_OctreeNode * | pNode, | |||
| GLC_Material * | pMat | |||
| ) | [private] |
Create octree box representation in the given 3d view collection.
Create box of the given Octree node with the given material
Definition at line 127 of file glc_octree.cpp.
References GLC_3DViewCollection::add(), GLC_OctreeNode::boundingBox(), GLC_OctreeNode::childAt(), GLC_OctreeNode::childCount(), GLC_Factory::createBox(), GLC_3DViewInstance::geomAt(), GLC_OctreeNode::hasChild(), GLC_OctreeNode::hasGeometry(), GLC_Factory::instance(), GLC_OctreeNode::isEmpty(), and GLC_Geometry::replaceMasterMaterial().
Referenced by createBox().
| int GLC_Octree::defaultDepth | ( | ) | [static] |
Return the default octree Depth.
Definition at line 56 of file glc_octree.cpp.
References m_DefaultOctreeDepth.
Referenced by GLC_State::defaultOctreeDepth().
| QList< GLC_3DViewInstance * > GLC_Octree::listOfIntersectedInstances | ( | const GLC_BoundingBox & | bBox | ) | [virtual] |
Return the list off instances inside or intersect the given bounding box.
Implements GLC_SpacePartitioning.
Definition at line 61 of file glc_octree.cpp.
References m_pRootNode, GLC_OctreeNode::setOfIntersectedInstances(), and updateSpacePartitioning().
| void GLC_Octree::setDefaultDepth | ( | int | depth | ) | [static] |
Set the default octree depth.
Definition at line 122 of file glc_octree.cpp.
References m_DefaultOctreeDepth.
Referenced by GLC_State::setDefaultOctreeDepth().
| void GLC_Octree::setDepth | ( | int | depth | ) |
Set this octree depth.
If space partitionning is already done, update it
Definition at line 99 of file glc_octree.cpp.
References m_OctreeDepth, m_pRootNode, and updateSpacePartitioning().
| void GLC_Octree::updateSpacePartitioning | ( | ) | [virtual] |
Update this octree space partionning.
Implements GLC_SpacePartitioning.
Definition at line 79 of file glc_octree.cpp.
References GLC_OctreeNode::addInstance(), GLC_3DViewCollection::boundingBox(), GLC_OctreeNode, GLC_3DViewCollection::instancesHandle(), m_OctreeDepth, GLC_SpacePartitioning::m_pCollection, m_pRootNode, and GLC_OctreeNode::removeEmptyChildren().
Referenced by createBox(), listOfIntersectedInstances(), setDepth(), and updateViewableInstances().
| void GLC_Octree::updateViewableInstances | ( | const GLC_Frustum & | frustum | ) | [virtual] |
Update the viewable 3d view instance of this octree from the given frustum.
Implements GLC_SpacePartitioning.
Definition at line 70 of file glc_octree.cpp.
References m_pRootNode, updateSpacePartitioning(), and GLC_OctreeNode::updateViewableInstances().
int GLC_Octree::m_DefaultOctreeDepth = 3 [static, private] |
The default octree Depth.
Definition at line 115 of file glc_octree.h.
Referenced by defaultDepth(), and setDefaultDepth().
int GLC_Octree::m_OctreeDepth [private] |
Octree depth.
Definition at line 112 of file glc_octree.h.
Referenced by setDepth(), and updateSpacePartitioning().
GLC_OctreeNode* GLC_Octree::m_pRootNode [private] |
Octree root node.
Definition at line 109 of file glc_octree.h.
Referenced by clear(), createBox(), GLC_Octree(), listOfIntersectedInstances(), setDepth(), updateSpacePartitioning(), updateViewableInstances(), and ~GLC_Octree().