Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
lvr2::FastBox< BaseVecT > Class Template Reference

A volume representation used by the standard Marching Cubes implementation. More...

#include <FastBox.hpp>

Inheritance diagram for lvr2::FastBox< BaseVecT >:
Inheritance graph
[legend]

Public Member Functions

 FastBox (BaseVecT center)
 Constructs a new box at the given center point defined by the used m_voxelsize}. More...
 
BaseVecT getCenter ()
 
FastBox< BaseVecT > * getNeighbor (int index)
 
virtual void getSurface (BaseMesh< BaseVecT > &mesh, vector< QueryPoint< BaseVecT >> &query_points, uint &globalIndex)
 Performs a local reconstruction according to the standard Marching Cubes table from Paul Bourke. More...
 
virtual void getSurface (BaseMesh< BaseVecT > &mesh, vector< QueryPoint< BaseVecT >> &query_points, uint &globalIndex, BoundingBox< BaseVecT > &bb, vector< unsigned int > &duplicates, float comparePrecision)
 
uint getVertex (int index)
 Gets the vertex index of the queried cell corner. More...
 
void setNeighbor (int index, FastBox< BaseVecT > *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. More...
 
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. More...
 
virtual ~FastBox ()
 Destructor.NormalT. More...
 

Public Attributes

BaseVecT m_center
 The box center. More...
 
bool m_duplicate
 
bool m_extruded
 
OptionalVertexHandle m_intersections [12]
 The twelve intersection between box and surface. More...
 
FastBox< BaseVecT > * m_neighbors [27]
 Pointer to all adjacent cells. More...
 

Static Public Attributes

static uint INVALID_INDEX
 An index value that is used to reference vertices that are not in the grid. More...
 
static float m_voxelsize
 The voxelsize of the reconstruction grid. More...
 

Protected Types

typedef FastBox< BaseVecT > BoxType
 

Protected Member Functions

float calcIntersection (float x1, float x2, float d1, float d2)
 
bool compareFloat (double num1, double num2)
 
float distanceToBB (const BaseVecT &v, const BoundingBox< BaseVecT > &bb) const
 
void getCorners (BaseVecT corners[], vector< QueryPoint< BaseVecT >> &query_points)
 Calculates the position of the eight cell corners. More...
 
void getDistances (float distances[], vector< QueryPoint< BaseVecT >> &query_points)
 Calculates the distance value for the eight cell corners. More...
 
int getIndex (vector< QueryPoint< BaseVecT >> &query_points)
 Calculated the index for the MC table. More...
 
void getIntersections (BaseVecT *corners, float *distance, BaseVecT *positions)
 Calculated the 12 possible intersections between the cell and the surface to interpolate. More...
 

Protected Attributes

uint m_vertices [8]
 The eight box corners. More...
 

Friends

template<typename T >
class BilinearFastBox
 

Detailed Description

template<typename BaseVecT>
class lvr2::FastBox< BaseVecT >

A volume representation used by the standard Marching Cubes implementation.

Definition at line 65 of file FastBox.hpp.

Member Typedef Documentation

◆ BoxType

template<typename BaseVecT>
typedef FastBox<BaseVecT> lvr2::FastBox< BaseVecT >::BoxType
protected

Definition at line 218 of file FastBox.hpp.

Constructor & Destructor Documentation

◆ FastBox()

template<typename BaseVecT>
lvr2::FastBox< BaseVecT >::FastBox ( BaseVecT  center)

Constructs a new box at the given center point defined by the used m_voxelsize}.

◆ ~FastBox()

template<typename BaseVecT>
virtual lvr2::FastBox< BaseVecT >::~FastBox ( )
inlinevirtual

Destructor.NormalT.

Definition at line 78 of file FastBox.hpp.

Member Function Documentation

◆ calcIntersection()

template<typename BaseVecT>
float lvr2::FastBox< BaseVecT >::calcIntersection ( float  x1,
float  x2,
float  d1,
float  d2 
)
protected

◆ compareFloat()

template<typename BaseVecT>
bool lvr2::FastBox< BaseVecT >::compareFloat ( double  num1,
double  num2 
)
inlineprotected

Definition at line 160 of file FastBox.hpp.

◆ distanceToBB()

template<typename BaseVecT>
float lvr2::FastBox< BaseVecT >::distanceToBB ( const BaseVecT &  v,
const BoundingBox< BaseVecT > &  bb 
) const
protected

◆ getCenter()

template<typename BaseVecT>
BaseVecT lvr2::FastBox< BaseVecT >::getCenter ( )
inline

Definition at line 111 of file FastBox.hpp.

◆ getCorners()

template<typename BaseVecT>
void lvr2::FastBox< BaseVecT >::getCorners ( BaseVecT  corners[],
vector< QueryPoint< BaseVecT >> &  query_points 
)
protected

Calculates the position of the eight cell corners.

Parameters
cornersThe cell corners
query_pointsThe query points of the grid

◆ getDistances()

template<typename BaseVecT>
void lvr2::FastBox< BaseVecT >::getDistances ( float  distances[],
vector< QueryPoint< BaseVecT >> &  query_points 
)
protected

Calculates the distance value for the eight cell corners.

Parameters
distancesThe distance values
query_pointsThe query points of the grid

◆ getIndex()

template<typename BaseVecT>
int lvr2::FastBox< BaseVecT >::getIndex ( vector< QueryPoint< BaseVecT >> &  query_points)
protected

Calculated the index for the MC table.

◆ getIntersections()

template<typename BaseVecT>
void lvr2::FastBox< BaseVecT >::getIntersections ( BaseVecT *  corners,
float *  distance,
BaseVecT *  positions 
)
protected

Calculated the 12 possible intersections between the cell and the surface to interpolate.

Parameters
cornersThe eight corners of the current cell
distanceThe corresponding distance value
positionsThe interpolated intersections.

◆ getNeighbor()

template<typename BaseVecT>
FastBox<BaseVecT>* lvr2::FastBox< BaseVecT >::getNeighbor ( int  index)

◆ getSurface() [1/2]

template<typename BaseVecT>
virtual void lvr2::FastBox< BaseVecT >::getSurface ( BaseMesh< BaseVecT > &  mesh,
vector< QueryPoint< BaseVecT >> &  query_points,
uint globalIndex 
)
virtual

Performs a local reconstruction according to the standard Marching Cubes table from Paul Bourke.

Parameters
meshThe reconstructed mesh
query_pointsA vector containing the query points of the reconstruction grid
globalIndexThe index of the newest vertex in the mesh, i.e. a newly generated vertex shout have the index globalIndex + 1.

Reimplemented in lvr2::TetraederBox< BaseVecT >, and lvr2::BilinearFastBox< BaseVecT >.

◆ getSurface() [2/2]

template<typename BaseVecT>
virtual void lvr2::FastBox< BaseVecT >::getSurface ( BaseMesh< BaseVecT > &  mesh,
vector< QueryPoint< BaseVecT >> &  query_points,
uint globalIndex,
BoundingBox< BaseVecT > &  bb,
vector< unsigned int > &  duplicates,
float  comparePrecision 
)
virtual

◆ getVertex()

template<typename BaseVecT>
uint lvr2::FastBox< BaseVecT >::getVertex ( int  index)

Gets the vertex index of the queried cell corner.

Parameters
indexOne of the eight cell corners
Returns
A vertex index.

◆ setNeighbor()

template<typename BaseVecT>
void lvr2::FastBox< BaseVecT >::setNeighbor ( int  index,
FastBox< BaseVecT > *  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.

Parameters
indexOne of the eight cell corners.
cellA neighbor cell.

◆ setVertex()

template<typename BaseVecT>
void lvr2::FastBox< BaseVecT >::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.

Parameters
indexOne of the eight cell corners.
valueAn index in the reconstruction grid.

Friends And Related Function Documentation

◆ BilinearFastBox

template<typename BaseVecT>
template<typename T >
friend class BilinearFastBox
friend

Definition at line 216 of file FastBox.hpp.

Member Data Documentation

◆ INVALID_INDEX

template<typename BaseVecT>
uint lvr2::FastBox< BaseVecT >::INVALID_INDEX
static

An index value that is used to reference vertices that are not in the grid.

Definition at line 144 of file FastBox.hpp.

◆ m_center

template<typename BaseVecT>
BaseVecT lvr2::FastBox< BaseVecT >::m_center

The box center.

Definition at line 152 of file FastBox.hpp.

◆ m_duplicate

template<typename BaseVecT>
bool lvr2::FastBox< BaseVecT >::m_duplicate

Definition at line 149 of file FastBox.hpp.

◆ m_extruded

template<typename BaseVecT>
bool lvr2::FastBox< BaseVecT >::m_extruded

Definition at line 148 of file FastBox.hpp.

◆ m_intersections

template<typename BaseVecT>
OptionalVertexHandle lvr2::FastBox< BaseVecT >::m_intersections[12]

The twelve intersection between box and surface.

Definition at line 147 of file FastBox.hpp.

◆ m_neighbors

template<typename BaseVecT>
FastBox<BaseVecT>* lvr2::FastBox< BaseVecT >::m_neighbors[27]

Pointer to all adjacent cells.

Definition at line 155 of file FastBox.hpp.

◆ m_vertices

template<typename BaseVecT>
uint lvr2::FastBox< BaseVecT >::m_vertices[8]
protected

The eight box corners.

Definition at line 214 of file FastBox.hpp.

◆ m_voxelsize

template<typename BaseVecT>
float lvr2::FastBox< BaseVecT >::m_voxelsize
static

The voxelsize of the reconstruction grid.

Definition at line 141 of file FastBox.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:11