OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WMarchingLegoAlgorithm Class Reference

Creates a non interpolated triangulation of an isosurface. More...

#include <WMarchingLegoAlgorithm.h>

+ Collaboration diagram for WMarchingLegoAlgorithm:

Public Member Functions

 WMarchingLegoAlgorithm ()
 standard constructor More...
 
 ~WMarchingLegoAlgorithm ()
 destructor More...
 
template<typename T >
std::shared_ptr< WTriangleMeshgenerateSurface (size_t nbCoordsX, size_t nbCoordsY, size_t nbCoordsZ, const WMatrix< double > &mat, const std::vector< T > *vals, double isoValue, std::shared_ptr< WProgressCombiner > mainProgress=std::shared_ptr< WProgressCombiner >())
 Generate the triangles for the surface on the given dataSet (inGrid, vals). More...
 
std::shared_ptr< WTriangleMeshgenSurfaceOneValue (size_t nbCoordsX, size_t nbCoordsY, size_t nbCoordsZ, const WMatrix< double > &mat, const std::vector< size_t > *vals, size_t isoValue, std::shared_ptr< WProgressCombiner > progress=std::shared_ptr< WProgressCombiner >())
 Generate the triangles for the surface on the given dataSet (inGrid, vals). More...
 

Private Member Functions

void addSurface (size_t x, size_t y, size_t z, size_t surface)
 adds 2 triangles for a given face of the voxel More...
 
size_t getVertexID (size_t nX, size_t nY, size_t nZ)
 returns a vertex id for a given grid point More...
 

Private Attributes

unsigned int m_nCellsX
 No. of cells in x direction. More...
 
unsigned int m_nCellsY
 No. of cells in y direction. More...
 
unsigned int m_nCellsZ
 No. of cells in z direction. More...
 
double m_tIsoLevel
 The isovalue. More...
 
WMatrix< double > m_matrix
 The 4x4 transformation matrix for the triangle vertices. More...
 
ID2WMLPointXYZId m_idToVertices
 List of WPointXYZIds which form the isosurface. More...
 
WMLTriangleVECTOR m_trivecTriangles
 List of WMCTriangleS which form the triangulation of the isosurface. More...
 

Detailed Description

Creates a non interpolated triangulation of an isosurface.

Definition at line 63 of file WMarchingLegoAlgorithm.h.

Constructor & Destructor Documentation

◆ WMarchingLegoAlgorithm()

WMarchingLegoAlgorithm::WMarchingLegoAlgorithm ( )

standard constructor

Definition at line 30 of file WMarchingLegoAlgorithm.cpp.

◆ ~WMarchingLegoAlgorithm()

WMarchingLegoAlgorithm::~WMarchingLegoAlgorithm ( )

destructor

Definition at line 35 of file WMarchingLegoAlgorithm.cpp.

Member Function Documentation

◆ addSurface()

void WMarchingLegoAlgorithm::addSurface ( size_t  x,
size_t  y,
size_t  z,
size_t  surface 
)
private

adds 2 triangles for a given face of the voxel

Parameters
xposition of the voxel
yposition of the voxel
zposition of the voxel
surfacewhich side of the voxel to paint

Definition at line 39 of file WMarchingLegoAlgorithm.cpp.

References getVertexID(), m_idToVertices, m_trivecTriangles, WMLPointXYZId::newID, WMLTriangle::pointID, WMLPointXYZId::x, WMLPointXYZId::y, and WMLPointXYZId::z.

Referenced by generateSurface(), and genSurfaceOneValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateSurface()

template<typename T >
std::shared_ptr< WTriangleMesh > WMarchingLegoAlgorithm::generateSurface ( size_t  nbCoordsX,
size_t  nbCoordsY,
size_t  nbCoordsZ,
const WMatrix< double > &  mat,
const std::vector< T > *  vals,
double  isoValue,
std::shared_ptr< WProgressCombiner mainProgress = std::shared_ptr < WProgressCombiner >() 
)

Generate the triangles for the surface on the given dataSet (inGrid, vals).

The texture coordinates in the resulting mesh are relative to the grid. This means they are NOT transformed. This ensure faster grid matrix updates in texture space. This might be useful where texture transformation matrices are used.

Parameters
nbCoordsXnumber of vertices in X direction
nbCoordsYnumber of vertices in Y direction
nbCoordsZnumber of vertices in Z direction
matthe matrix transforming the vertices from canonical space
valsthe values at the vertices
isoValueThe surface will run through all positions with this value.
mainProgressPointer to the parent's progress reporter. Leave empty if no progress should be shown
Returns
the created triangle mesh

Definition at line 154 of file WMarchingLegoAlgorithm.h.

References addSurface(), m_idToVertices, m_matrix, m_nCellsX, m_nCellsY, m_nCellsZ, m_tIsoLevel, and m_trivecTriangles.

Referenced by WROIArbitrary::updateGFX().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ genSurfaceOneValue()

std::shared_ptr< WTriangleMesh > WMarchingLegoAlgorithm::genSurfaceOneValue ( size_t  nbCoordsX,
size_t  nbCoordsY,
size_t  nbCoordsZ,
const WMatrix< double > &  mat,
const std::vector< size_t > *  vals,
size_t  isoValue,
std::shared_ptr< WProgressCombiner progress = std::shared_ptr < WProgressCombiner >() 
)

Generate the triangles for the surface on the given dataSet (inGrid, vals).

The texture coordinates in the resulting mesh are relative to the grid. This means they are NOT transformed. This ensure faster grid matrix updates in texture space. This might be useful where texture transformation matrices are used.

Parameters
nbCoordsXnumber of vertices in X direction
nbCoordsYnumber of vertices in Y direction
nbCoordsZnumber of vertices in Z direction
matthe matrix transforming the vertices from canonical space
valsthe values at the vertices
isoValueThe surface will run through all positions with this value.
progressparent's WProgressCombiner. May be empty if no status report is requested
Returns
the created triangle mesh

Definition at line 291 of file WMarchingLegoAlgorithm.cpp.

References addSurface(), m_idToVertices, m_matrix, m_nCellsX, m_nCellsY, m_nCellsZ, and m_trivecTriangles.

Referenced by WMClusterDisplayVoxels::createMesh(), and WMHierchClustDisplay::initTreeData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVertexID()

size_t WMarchingLegoAlgorithm::getVertexID ( size_t  nX,
size_t  nY,
size_t  nZ 
)
private

returns a vertex id for a given grid point

Parameters
nXx position in space
nYy position in space
nZz position in space
Returns
the id

Definition at line 286 of file WMarchingLegoAlgorithm.cpp.

References m_nCellsX, and m_nCellsY.

Referenced by addSurface().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_idToVertices

ID2WMLPointXYZId WMarchingLegoAlgorithm::m_idToVertices
private

List of WPointXYZIds which form the isosurface.

Definition at line 149 of file WMarchingLegoAlgorithm.h.

Referenced by addSurface(), generateSurface(), and genSurfaceOneValue().

◆ m_matrix

WMatrix< double > WMarchingLegoAlgorithm::m_matrix
private

The 4x4 transformation matrix for the triangle vertices.

Definition at line 147 of file WMarchingLegoAlgorithm.h.

Referenced by generateSurface(), and genSurfaceOneValue().

◆ m_nCellsX

unsigned int WMarchingLegoAlgorithm::m_nCellsX
private

No. of cells in x direction.

Definition at line 141 of file WMarchingLegoAlgorithm.h.

Referenced by generateSurface(), genSurfaceOneValue(), and getVertexID().

◆ m_nCellsY

unsigned int WMarchingLegoAlgorithm::m_nCellsY
private

No. of cells in y direction.

Definition at line 142 of file WMarchingLegoAlgorithm.h.

Referenced by generateSurface(), genSurfaceOneValue(), and getVertexID().

◆ m_nCellsZ

unsigned int WMarchingLegoAlgorithm::m_nCellsZ
private

No. of cells in z direction.

Definition at line 143 of file WMarchingLegoAlgorithm.h.

Referenced by generateSurface(), and genSurfaceOneValue().

◆ m_tIsoLevel

double WMarchingLegoAlgorithm::m_tIsoLevel
private

The isovalue.

Definition at line 145 of file WMarchingLegoAlgorithm.h.

Referenced by generateSurface().

◆ m_trivecTriangles

WMLTriangleVECTOR WMarchingLegoAlgorithm::m_trivecTriangles
private

List of WMCTriangleS which form the triangulation of the isosurface.

Definition at line 150 of file WMarchingLegoAlgorithm.h.

Referenced by addSurface(), generateSurface(), and genSurfaceOneValue().


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