OpenWalnut
1.5.0dev
|
Creates a non interpolated triangulation of an isosurface. More...
#include <WMarchingLegoAlgorithm.h>
Public Member Functions | |
WMarchingLegoAlgorithm () | |
standard constructor More... | |
~WMarchingLegoAlgorithm () | |
destructor More... | |
template<typename T > | |
std::shared_ptr< WTriangleMesh > | 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). More... | |
std::shared_ptr< WTriangleMesh > | 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). 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... | |
Creates a non interpolated triangulation of an isosurface.
Definition at line 63 of file WMarchingLegoAlgorithm.h.
WMarchingLegoAlgorithm::WMarchingLegoAlgorithm | ( | ) |
standard constructor
Definition at line 30 of file WMarchingLegoAlgorithm.cpp.
WMarchingLegoAlgorithm::~WMarchingLegoAlgorithm | ( | ) |
destructor
Definition at line 35 of file WMarchingLegoAlgorithm.cpp.
|
private |
adds 2 triangles for a given face of the voxel
x | position of the voxel |
y | position of the voxel |
z | position of the voxel |
surface | which 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().
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.
nbCoordsX | number of vertices in X direction |
nbCoordsY | number of vertices in Y direction |
nbCoordsZ | number of vertices in Z direction |
mat | the matrix transforming the vertices from canonical space |
vals | the values at the vertices |
isoValue | The surface will run through all positions with this value. |
mainProgress | Pointer to the parent's progress reporter. Leave empty if no progress should be shown |
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().
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.
nbCoordsX | number of vertices in X direction |
nbCoordsY | number of vertices in Y direction |
nbCoordsZ | number of vertices in Z direction |
mat | the matrix transforming the vertices from canonical space |
vals | the values at the vertices |
isoValue | The surface will run through all positions with this value. |
progress | parent's WProgressCombiner. May be empty if no status report is requested |
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().
|
private |
returns a vertex id for a given grid point
nX | x position in space |
nY | y position in space |
nZ | z position in space |
Definition at line 286 of file WMarchingLegoAlgorithm.cpp.
References m_nCellsX, and m_nCellsY.
Referenced by addSurface().
|
private |
List of WPointXYZIds which form the isosurface.
Definition at line 149 of file WMarchingLegoAlgorithm.h.
Referenced by addSurface(), generateSurface(), and genSurfaceOneValue().
|
private |
The 4x4 transformation matrix for the triangle vertices.
Definition at line 147 of file WMarchingLegoAlgorithm.h.
Referenced by generateSurface(), and genSurfaceOneValue().
|
private |
No. of cells in x direction.
Definition at line 141 of file WMarchingLegoAlgorithm.h.
Referenced by generateSurface(), genSurfaceOneValue(), and getVertexID().
|
private |
No. of cells in y direction.
Definition at line 142 of file WMarchingLegoAlgorithm.h.
Referenced by generateSurface(), genSurfaceOneValue(), and getVertexID().
|
private |
No. of cells in z direction.
Definition at line 143 of file WMarchingLegoAlgorithm.h.
Referenced by generateSurface(), and genSurfaceOneValue().
|
private |
The isovalue.
Definition at line 145 of file WMarchingLegoAlgorithm.h.
Referenced by generateSurface().
|
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().