|
GOAT (Geometrical optics application tool) 0.1
|
This template class is used for internal purposes and represents an octree. More...
#include <octree.h>
Public Member Functions | |
| void | createChilds () |
| Creates the childs of the Octree and calculates the bounding boxes. | |
| void | createTree (int maxRecursions=1, int rek=0) |
| Prepare the tree with recursion depth maxRecursions. | |
| void | delAllChilds () |
| Delete all children of the Octree. | |
| void | delChild (int i) |
| Delete the i-th child of the Octree. | |
| void | delElements () |
| Deletes all elements. | |
| Octree () | |
| Octree (const Octree &O) | |
| void | setBoundingBox (maths::Vector< double > MP, maths::Vector< double > d) |
| Set the bounding box of the Octree The bounding box is a circumscribing cuboid with center MP and the side lengths described by the components of d. | |
| void | setRecursiondepth (int max_recursions) |
| void | trimOctree () |
| Trims the tree, i.e. removing all empty childs. | |
| void | trimOctree (int rek) |
| ~Octree () | |
Public Attributes | |
| Box | BBox |
| std::vector< std::unique_ptr< Octree< T > > > | child |
| std::vector< T > | Element |
| bool | isLeaf |
| Sign wether the Octree is a leaf or not. | |
| int | MAX_RECURSIONS |
| size_t | nChilds |
| size_t | nElements |
| Octree< T > * | parent |
This template class is used for internal purposes and represents an octree.
This class is mainly used together with the surface class. When searching the intersection point of a ray with a surface described by a large number of triangles, one has to test the ray against all triangles. This is often very time consuming. Therefore we used an octree algorithm. In this case the object is circumscribed by a box. In a first step, the intersection between the ray and this box is tested. If the ray hits this bounding box, the box is subdivided into 8 sub-boxes (therefore the name octree). The next task is to find the sub-box with the nearest intersection point. Then, this box is one again subdivided in another 8 boxes. This procedure is repeated several times (according to the number MAX_RECURSIONS). Then, only the triangles on the last sub-box are tested against the ray. Depending on the total number of triangles on the surface, this procedure can safe a lot of time. The Octree class is used to store the triangles in a tree-like structure, so the triangles within one box can be easily found. Since this class is a template, in principal it can be used for different purposes. The Octree structure is recursive. That means each Octree is a part of the whole tree. It contains up to 8 children (it can have less then 8, if some of the boxes are empty) and one parent Octree. The last Octree, i.e. an Octree with no children, is called a leaf.
|
inline |
| GOAT::raytracing::Octree< T >::Octree | ( | const Octree< T > & | O | ) |
|
inline |
| void GOAT::raytracing::Octree< T >::createChilds | ( | ) |
| void GOAT::raytracing::Octree< T >::createTree | ( | int | maxRecursions = 1, |
| int | rek = 0 ) |
| void GOAT::raytracing::Octree< T >::delAllChilds | ( | ) |
| void GOAT::raytracing::Octree< T >::delChild | ( | int | i | ) |
| void GOAT::raytracing::Octree< T >::delElements | ( | ) |
| void GOAT::raytracing::Octree< T >::setBoundingBox | ( | maths::Vector< double > | MP, |
| maths::Vector< double > | d ) |
| void GOAT::raytracing::Octree< T >::setRecursiondepth | ( | int | max_recursions | ) |
| void GOAT::raytracing::Octree< T >::trimOctree | ( | ) |
| void GOAT::raytracing::Octree< T >::trimOctree | ( | int | rek | ) |
| Box GOAT::raytracing::Octree< T >::BBox |
| std::vector<std::unique_ptr<Octree<T> > > GOAT::raytracing::Octree< T >::child |
| std::vector<T> GOAT::raytracing::Octree< T >::Element |
| bool GOAT::raytracing::Octree< T >::isLeaf |
| int GOAT::raytracing::Octree< T >::MAX_RECURSIONS |
| size_t GOAT::raytracing::Octree< T >::nChilds |
| size_t GOAT::raytracing::Octree< T >::nElements |
| Octree<T>* GOAT::raytracing::Octree< T >::parent |