fw4spl
fwDataTools::Mesh Class Reference

This helper generates a mesh using specified structure (quad or triangle). More...

#include <Mesh.hpp>

Public Types

typedef std::map< Point,::fwData::Mesh::Id > PointsMapType
 
typedef std::array< double, 3 > PositionType
 
typedef std::array< size_t, 3 > OrganizationType
 

Static Public Member Functions

static FWDATATOOLS_API void initRand ()
 Initialize 'rand' seed.
 
static FWDATATOOLS_API void generateCellNormals (::fwData::Mesh::sptr mesh)
 Generate cell normals for the mesh. More...
 
static FWDATATOOLS_API void generatePointNormals (::fwData::Mesh::sptr mesh)
 Generate point normals for the mesh. More...
 
static FWDATATOOLS_API void shakeNormals (::fwData::Array::sptr array)
 Shake Array of Normals. More...
 
static FWDATATOOLS_API void shakePointNormals (::fwData::Mesh::sptr mesh)
 Shake point Normals. More...
 
static FWDATATOOLS_API void shakeCellNormals (::fwData::Mesh::sptr mesh)
 Shake cell Normals. More...
 
static FWDATATOOLS_API void shakePoint (::fwData::Mesh::sptr mesh)
 Shake points of the mesh. More...
 
static FWDATATOOLS_API void colorizeMeshPoints (::fwData::Mesh::sptr mesh)
 Colorize mesh (vertex point color). More...
 
static FWDATATOOLS_API void colorizeMeshCells (::fwData::Mesh::sptr mesh)
 Colorize mesh (cell color). More...
 
static FWDATATOOLS_API bool hasUniqueCellType (::fwData::Mesh::csptr mesh,::fwData::Mesh::CellTypes cell)
 
static FWDATATOOLS_API void transform (fwData::Mesh::csptr inMesh,::fwData::Mesh::sptr outMesh,::fwData::TransformationMatrix3D::csptr t)
 Apply a transformation 4x4 from an input mesh to an output mesh.
 
static FWDATATOOLS_API void transform (::fwData::Mesh::sptr mesh,::fwData::TransformationMatrix3D::csptr t)
 Apply a transformation 4x4 on a mesh.
 
static FWDATATOOLS_API void colorizeMeshPoints (const ::fwData::Mesh::sptr &mesh, const std::uint8_t colorR, const std::uint8_t colorG, const std::uint8_t colorB, const std::uint8_t colorA=255)
 Colorize the mesh points with the given color. More...
 
static FWDATATOOLS_API void colorizeMeshPoints (const ::fwData::Mesh::sptr &_mesh, const std::vector< size_t > &_vectorNumTriangle, const std::uint8_t _colorR, const std::uint8_t colorG, const std::uint8_t colorB, const std::uint8_t _colorA=255)
 Colorize the mesh points associated to the triangle in _vectorNumTriangle. More...
 
static FWDATATOOLS_API void colorizeMeshCells (const ::fwData::Mesh::sptr &mesh, const std::uint8_t colorR, const std::uint8_t colorG, const std::uint8_t colorB, const std::uint8_t _colorA=255)
 Colorize the mesh cells with the given rgb color. More...
 
static FWDATATOOLS_API void colorizeMeshCells (const ::fwData::Mesh::sptr &mesh, const std::vector< size_t > &triangleIndexVector, const std::uint8_t colorR, const std::uint8_t colorG, const std::uint8_t colorB, const std::uint8_t _colorA=255)
 Colorize the cells in vectorNumTriangle. More...
 

Detailed Description

This helper generates a mesh using specified structure (quad or triangle).

Definition at line 24 of file core/fwDataTools/include/fwDataTools/Mesh.hpp.

Member Function Documentation

void fwDataTools::Mesh::colorizeMeshCells ( ::fwData::Mesh::sptr  mesh)
static

Colorize mesh (cell color).

Parameters
[in]meshfwData::Mesh mesh structure to colorize.

Definition at line 448 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::Mesh::setCellColor().

Referenced by fwTest::generator::Mesh::generateMesh(), and Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwDataTools::Mesh::colorizeMeshCells ( const ::fwData::Mesh::sptr &  mesh,
const std::uint8_t  colorR,
const std::uint8_t  colorG,
const std::uint8_t  colorB,
const std::uint8_t  _colorA = 255 
)
static

Colorize the mesh cells with the given rgb color.

Precondition
cell color array must be allocated
mesh must only contain triangle

Definition at line 659 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::Array::getBuffer(), fwData::Mesh::s_CELL_COLORS_MODIFIED_SIG, and SLM_ASSERT.

+ Here is the call graph for this function:

void fwDataTools::Mesh::colorizeMeshCells ( const ::fwData::Mesh::sptr &  mesh,
const std::vector< size_t > &  triangleIndexVector,
const std::uint8_t  colorR,
const std::uint8_t  colorG,
const std::uint8_t  colorB,
const std::uint8_t  _colorA = 255 
)
static

Colorize the cells in vectorNumTriangle.

Precondition
cell color array must be allocated
mesh must only contain triangle

Definition at line 696 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::Array::getBuffer(), fwData::Mesh::s_CELL_COLORS_MODIFIED_SIG, and SLM_ASSERT.

+ Here is the call graph for this function:

void fwDataTools::Mesh::colorizeMeshPoints ( ::fwData::Mesh::sptr  mesh)
static

Colorize mesh (vertex point color).

Parameters
[in]meshfwData::Mesh mesh structure to colorize.

Definition at line 430 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::Mesh::setPointColor().

Referenced by fwTest::generator::Mesh::generateMesh(), Tuto14MeshGenerator::AlgoMeshDeformation::initSimu(), and Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwDataTools::Mesh::colorizeMeshPoints ( const ::fwData::Mesh::sptr &  mesh,
const std::uint8_t  colorR,
const std::uint8_t  colorG,
const std::uint8_t  colorB,
const std::uint8_t  colorA = 255 
)
static

Colorize the mesh points with the given color.

Precondition
point color array must be allocated
mesh must only contain triangle

Definition at line 569 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::Array::begin(), fwData::Mesh::s_POINT_COLORS_MODIFIED_SIG, and SLM_ASSERT.

+ Here is the call graph for this function:

void fwDataTools::Mesh::colorizeMeshPoints ( const ::fwData::Mesh::sptr &  _mesh,
const std::vector< size_t > &  _vectorNumTriangle,
const std::uint8_t  _colorR,
const std::uint8_t  colorG,
const std::uint8_t  colorB,
const std::uint8_t  _colorA = 255 
)
static

Colorize the mesh points associated to the triangle in _vectorNumTriangle.

Precondition
point color array must be allocated
mesh must only contain triangle

Definition at line 606 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::ArrayGetter::begin(), fwDataTools::helper::Array::getBuffer(), fwData::Mesh::s_POINT_COLORS_MODIFIED_SIG, and SLM_ASSERT.

+ Here is the call graph for this function:

void fwDataTools::Mesh::generateCellNormals ( ::fwData::Mesh::sptr  mesh)
static

Generate cell normals for the mesh.

Parameters
[out]meshfwData::Mesh structure to fill with cell normals.

Definition at line 202 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

Referenced by fwTest::generator::Mesh::generateMesh(), and Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the caller graph for this function:

void fwDataTools::Mesh::generatePointNormals ( ::fwData::Mesh::sptr  mesh)
static

Generate point normals for the mesh.

Parameters
[out]meshfwData::Mesh structure to fill with cell normals.

Definition at line 319 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

Referenced by Tuto14MeshGenerator::AlgoMeshDeformation::computeSimu(), fwTest::generator::Mesh::generateMesh(), vtkSimpleMesh::SSimpleMeshDeformation::stopDeformation(), and Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the caller graph for this function:

bool fwDataTools::Mesh::hasUniqueCellType ( ::fwData::Mesh::csptr  mesh,
::fwData::Mesh::CellTypes  cell 
)
static
Parameters
[in]meshfwData::Mesh mesh structure to find cell type.
[in]cellCellTypes to find in mesh.

Definition at line 47 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::MeshGetter::getCellTypes().

Referenced by fwGdcmIO::container::DicomSurface::DicomSurface(), and fwDataIO::writer::MeshWriter::write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwDataTools::Mesh::shakeCellNormals ( ::fwData::Mesh::sptr  mesh)
static

Shake cell Normals.

Parameters
[out]meshfwData::Mesh structure to shake normals.

Definition at line 423 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

Referenced by Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the caller graph for this function:

void fwDataTools::Mesh::shakeNormals ( ::fwData::Array::sptr  array)
static

Shake Array of Normals.

Array must have 3 float components, 1 dimension. Otherwise, shakeNormals will do nothing.

Parameters
[out]arraymesh's array containing normals.

Definition at line 386 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::Array::getBuffer().

+ Here is the call graph for this function:

void fwDataTools::Mesh::shakePoint ( ::fwData::Mesh::sptr  mesh)
static

Shake points of the mesh.

Parameters
[out]meshfwData::Mesh structure to shake.

Definition at line 468 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

References fwDataTools::helper::ArrayGetter::begin(), fwDataTools::helper::Array::begin(), fwDataTools::TransformationMatrix3D::getMatrixFromTF3D(), fwDataTools::helper::Mesh::getPoints(), SLM_ASSERT, and transform().

Referenced by fwTest::generator::Mesh::generateMesh(), and Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwDataTools::Mesh::shakePointNormals ( ::fwData::Mesh::sptr  mesh)
static

Shake point Normals.

Parameters
[out]meshfwData::Mesh structure to shake normals.

Definition at line 416 of file core/fwDataTools/src/fwDataTools/Mesh.cpp.

Referenced by Tuto14MeshGenerator::SMeshModifier::updating().

+ Here is the caller graph for this function:


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