Template Class DualLeaf

Class Documentation

template<typename BaseVecT, typename BoxT>
class DualLeaf

Public Functions

DualLeaf(BaseVecT vertices[])

Constructor.

Parameters:

middle – Center of the voxel

inline virtual ~DualLeaf()

Destructor (virtual)

int getIndex(float distances[])

Calculates and returns the bit-pattern respectively index from the edges of the represented voxel for the MC-Table.

Parameters:

distances – Distances of the eight edges.

Returns:

Index for the MC-Table.

BaseVecT getIntersectionPoint(float intersection, BaseVecT corner_one, BaseVecT corner_two)
BaseVecT getIntersectionPoint(BaseVecT corner_one, float intersection, BaseVecT corner_two)
BaseVecT getIntersectionPoint(BaseVecT corner_one, BaseVecT corner_two, float intersection)
void getIntersections(BaseVecT corners[], float distance[], BaseVecT positions[])

Calculates the twelve possible intersections between the cell and the surface to interpolate.

Parameters:
  • corners – Eight corners of the current cell.

  • distance – Corresponding distance value.

  • positions – Interpolated intersections.

void getVertices(BaseVecT corners[])

Returns edges of the voxel.

Parameters:

corner – Corners of the voxel.

uint getIntersection(char i)

Returns the stored intersection between the cell and the surface at a given edge.

Parameters:

i – Index of the edge.

BaseVecT &getMiddle()

Returns the middle of the represented voxel.

Returns:

Middle of the represented voxel.

void setIntersection(char i, uint value)

Sets the intersection between the cell and the surface at a given edge.

Parameters:
  • i – Index of the edge.

  • value – Value of the intersection.

Protected Functions

float calcIntersection(float x1, float x2, float d1, float d2)

Interpolates the intersection between x1 and x1.

Parameters:
  • x1 – First coordinate.

  • x2 – Second coordinate.

  • d1 – Distance value for the first coordinate.

  • d2 – Distance value for the second coordinate.

Returns:

Interpolated distance.

Protected Attributes

BaseVecT m_vertices[8]
uint m_intersections[12]