Namespace that contains code that is used by the octree internally. More...
Namespaces | |
namespace | anonymous_namespace{OctreeDirection.h} |
This namespace contains the tables that are anonymous within this file. | |
namespace | Tables |
This namespace contains all tables that can be used publicly. | |
Typedefs | |
using | Any = int unsigned |
A datatype that is wide enough to hold faces, edges or vertices. | |
using | Octant = Vertex |
A vertex is also capable of specifying an arbitrary octant in 3D. | |
Enumerations | |
enum | Face : Any { O = 0 , L = 1 , R = 2 , D = 3 , U = 4 , B = 5 , F = 6 } |
This enum can be used to index the faces of a cube including an "invalid" face. | |
enum | Edge : Any { OO = 0 , LD = buildEdge<L, D>() , LU = buildEdge<L, U>() , LB = buildEdge<L, B>() , LF = buildEdge<L, F>() , RD = buildEdge<R, D>() , RU = buildEdge<R, U>() , RB = buildEdge<R, B>() , RF = buildEdge<R, F>() , DB = buildEdge<D, B>() , DF = buildEdge<D, F>() , UB = buildEdge<U, B>() , UF = buildEdge<U, F>() } |
This enum can be used to index all edges of a cube including an "invalid" edge. | |
enum | Vertex : Any { OOO = 0 , LDB = buildVertex<L, D, B>() , LDF = buildVertex<L, D, F>() , LUB = buildVertex<L, U, B>() , LUF = buildVertex<L, U, F>() , RDB = buildVertex<R, D, B>() , RDF = buildVertex<R, D, F>() , RUB = buildVertex<R, U, B>() , RUF = buildVertex<R, U, F>() } |
This enum can be used to index all vertices of a cube including an "invalid" vertex. | |
Functions | |
template<Face f1, Face f2> | |
static constexpr Any | buildEdge () |
Create a bitfield for an edge given by the template parameters. | |
template<Face f1, Face f2, Face f3> | |
static constexpr Any | buildVertex () |
Create a bitfield for a vertex given by the template parameters. | |
int | vertexToIndex (Vertex vertex) |
Map an arbitrary vertex to a flat index. | |
template<typename T > | |
bool | isFace (T f) |
Check if f is a face. | |
template<typename T > | |
bool | isEdge (T e) |
Check if e is an edge. | |
template<typename T > | |
bool | isVertex (T v) |
Check if v is a vertex. | |
bool | ADJ (Any direction, Vertex octant) |
This function implements a LUT obtained from the Samet paper: "ADJ(I,O) is true if and only if octant O is adjacent to the Ith face, edge, or vertex of O's containing block". | |
Octant | REFLECT (Any direction, Octant octant) |
This function implements a LUT obtained from the Samet paper: "REFLECT(I,O) yields the SONTYPE value of the block of equal size (not necessarily a brother) that shares the Ith
face, edge, or vertex of a block having SONTYPE value O". | |
Face | COMMON_FACE (Any direction, Vertex octant) |
This function implements a LUT obtained from the Samet paper: "COMMON_FACE(I,O) yields the type on the face (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction. | |
Edge | COMMON_EDGE (Any direction, Vertex octant) |
This function implements a LUT obtained from the Samet paper: "COMMON_EDGE(I,O) yields the type of the edge (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction. | |
Any | getOppositeDirection (Any direction) |
Convert any direction to a direction that is directly opposing the given direction. | |
std::vector< Octant > | getAllowedDirections (Any along) |
Get a list of octants that are along the given direction. | |
Namespace that contains code that is used by the octree internally.
This function implements a LUT obtained from the Samet paper: "ADJ(I,O) is true if and only if octant O is adjacent to the Ith face, edge, or vertex of O's containing block".
direction | The direction I to search the adjacent neighbor |
octant | The octant O from the paper |
Create a bitfield for an edge given by the template parameters.
f1 | |
f2 |
|
staticconstexpr |
Create a bitfield for a vertex given by the template parameters.
f1 | |
f2 | |
f3 |
This function implements a LUT obtained from the Samet paper: "COMMON_EDGE(I,O) yields the type of the edge (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction.
"
direction | The direction I |
octant | The octant O |
This function implements a LUT obtained from the Samet paper: "COMMON_FACE(I,O) yields the type on the face (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction.
"
direction | The direction I |
octant | The octant O |
Get a list of octants that are along the given direction.
along | A direction the returned vertices should be admissible to |
Convert any direction to a direction that is directly opposing the given direction.
direction | Any direction (Face, Edge or Vertex) |
|
inline |
Check if e is an edge.
T |
e | The parameter to check |
|
inline |
Check if f is a face.
f | The parameter to check |
|
inline |
Check if v is a vertex.
T |
v | The parameter to check |
This function implements a LUT obtained from the Samet paper: "REFLECT(I,O) yields the SONTYPE value of the block of equal size (not necessarily a brother) that shares the Ith face, edge, or vertex of a block having SONTYPE value O".
direction | The direction I to search the reflected neighbor |
octant | The octant O |
|
inline |
Map an arbitrary vertex to a flat index.
vertex | An element from the Vertex enum |