A volume representation used by the standard Marching Cubes implementation. More...
#include <FastBox.hpp>
Public Member Functions | |
FastBox (VertexT ¢er) | |
Constructs a new box at the given center point defined by the used m_voxelsize}. | |
virtual | ~FastBox () |
Destructor. | |
void | setVertex (int index, uint value) |
Each cell vertex (0 to 7) as associated with a vertex in the reconstruction grid. This methods assigns the index value} to the index}th cell corner. | |
void | setNeighbor (int index, FastBox< VertexT, NormalT > *cell) |
Adjacent cells in the grid should use common vertices. This functions assigns the value of corner[index] to the corresponding corner of the give neighbor cell. | |
uint | getVertex (int index) |
Gets the vertex index of the queried cell corner. | |
FastBox< VertexT, NormalT > * | getNeighbor (int index) |
void | getSurface (BaseMesh< VertexT, NormalT > &mesh, vector< QueryPoint< VertexT > > &query_points, uint &globalIndex) |
Performs a local reconstruction according to the standard Marching Cubes table from Paul Bourke. | |
Static Public Attributes | |
static float | m_voxelsize |
The voxelsize of the reconstruction grid. | |
static uint | INVALID_INDEX |
An index value that is used to reference vertices that are not in the grid. | |
Private Member Functions | |
float | calcIntersection (float x1, float x2, float d1, float d2) |
int | getIndex (vector< QueryPoint< VertexT > > &query_points) |
Calculated the index for the MC table. | |
void | getCorners (VertexT corners[], vector< QueryPoint< VertexT > > &query_points) |
Calculates the position of the eight cell corners. | |
void | getDistances (float distances[], vector< QueryPoint< VertexT > > &query_points) |
Calculates the distance value for the eight cell corners. | |
void | getIntersections (VertexT corners[], float distance[], VertexT positions[]) |
Calculated the 12 possible intersections between the cell and the surface to interpolate. | |
Private Attributes | |
VertexT | m_center |
The box center. | |
uint | m_vertices [8] |
The eight box corners. | |
uint | m_intersections [12] |
The twelve intersection between box and surface. | |
FastBox< VertexT, NormalT > * | m_neighbors [27] |
Pointer to all adjacent cells. |
A volume representation used by the standard Marching Cubes implementation.
Definition at line 30 of file FastBox.hpp.
lssr::FastBox< VertexT, NormalT >::FastBox | ( | VertexT & | center | ) |
Constructs a new box at the given center point defined by the used m_voxelsize}.
virtual lssr::FastBox< VertexT, NormalT >::~FastBox | ( | ) | [inline, virtual] |
Destructor.
Definition at line 43 of file FastBox.hpp.
float lssr::FastBox< VertexT, NormalT >::calcIntersection | ( | float | x1, | |
float | x2, | |||
float | d1, | |||
float | d2 | |||
) | [private] |
void lssr::FastBox< VertexT, NormalT >::getCorners | ( | VertexT | corners[], | |
vector< QueryPoint< VertexT > > & | query_points | |||
) | [private] |
Calculates the position of the eight cell corners.
corners | The cell corners | |
query_points | The query points of the grid |
void lssr::FastBox< VertexT, NormalT >::getDistances | ( | float | distances[], | |
vector< QueryPoint< VertexT > > & | query_points | |||
) | [private] |
Calculates the distance value for the eight cell corners.
distances | The distance values | |
query_points | The query points of the grid |
int lssr::FastBox< VertexT, NormalT >::getIndex | ( | vector< QueryPoint< VertexT > > & | query_points | ) | [private] |
Calculated the index for the MC table.
void lssr::FastBox< VertexT, NormalT >::getIntersections | ( | VertexT | corners[], | |
float | distance[], | |||
VertexT | positions[] | |||
) | [private] |
Calculated the 12 possible intersections between the cell and the surface to interpolate.
corners | The eight corners of the current cell | |
distance | The corresponding distance value | |
positions | The interpolated intersections. |
FastBox<VertexT, NormalT>* lssr::FastBox< VertexT, NormalT >::getNeighbor | ( | int | index | ) |
void lssr::FastBox< VertexT, NormalT >::getSurface | ( | BaseMesh< VertexT, NormalT > & | mesh, | |
vector< QueryPoint< VertexT > > & | query_points, | |||
uint & | globalIndex | |||
) |
Performs a local reconstruction according to the standard Marching Cubes table from Paul Bourke.
mesh | The reconstructed mesh | |
query_points | A vector containing the query points of the reconstruction grid | |
globalIndex | The index of the newest vertex in the mesh, i.e. a newly generated vertex shout have the index globalIndex + 1. |
uint lssr::FastBox< VertexT, NormalT >::getVertex | ( | int | index | ) |
Gets the vertex index of the queried cell corner.
index | One of the eight cell corners |
void lssr::FastBox< VertexT, NormalT >::setNeighbor | ( | int | index, | |
FastBox< VertexT, NormalT > * | cell | |||
) |
Adjacent cells in the grid should use common vertices. This functions assigns the value of corner[index] to the corresponding corner of the give neighbor cell.
index | One of the eight cell corners. | |
cell | A neighbor cell. |
void lssr::FastBox< VertexT, NormalT >::setVertex | ( | int | index, | |
uint | value | |||
) |
Each cell vertex (0 to 7) as associated with a vertex in the reconstruction grid. This methods assigns the index value} to the index}th cell corner.
index | One of the eight cell corners. | |
value | An index in the reconstruction grid. |
uint lssr::FastBox< VertexT, NormalT >::INVALID_INDEX [static] |
An index value that is used to reference vertices that are not in the grid.
Definition at line 93 of file FastBox.hpp.
VertexT lssr::FastBox< VertexT, NormalT >::m_center [private] |
The box center.
Definition at line 139 of file FastBox.hpp.
uint lssr::FastBox< VertexT, NormalT >::m_intersections[12] [private] |
The twelve intersection between box and surface.
Definition at line 145 of file FastBox.hpp.
FastBox<VertexT, NormalT>* lssr::FastBox< VertexT, NormalT >::m_neighbors[27] [private] |
Pointer to all adjacent cells.
Definition at line 148 of file FastBox.hpp.
uint lssr::FastBox< VertexT, NormalT >::m_vertices[8] [private] |
The eight box corners.
Definition at line 142 of file FastBox.hpp.
float lssr::FastBox< VertexT, NormalT >::m_voxelsize [static] |
The voxelsize of the reconstruction grid.
Definition at line 90 of file FastBox.hpp.