fw4spl
fwDataTools::helper::Mesh Class Reference

Helper to manage Mesh. Lock the mesh buffer before to modify it. More...

#include <Mesh.hpp>

Public Member Functions

FWDATATOOLS_API Mesh (::fwData::Mesh::sptr mesh)
 
FWDATATOOLS_API void updateLock ()
 Updates locks on all internal data Array of Mesh.
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextPoint (const ::fwData::Mesh::PointValueType p[3])
 Insert a point into the mesh. Reallocates the point array if needed. More...
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextPoint (::fwData::Mesh::PointValueType x,::fwData::Mesh::PointValueType y,::fwData::Mesh::PointValueType z)
 Insert a point into the mesh. More...
 
FWDATATOOLS_API void setPoint (::fwData::Mesh::Id id, const ::fwData::Mesh::PointValueType p[3])
 Set a point coordinates. The mesh must be allocated before calling this method. More...
 
FWDATATOOLS_API void setPoint (::fwData::Mesh::Id id,::fwData::Mesh::PointValueType x,::fwData::Mesh::PointValueType y,::fwData::Mesh::PointValueType z)
 Set a point coordinates. More...
 
FWDATATOOLS_API void setPointColor (::fwData::Mesh::Id id, const ::fwData::Mesh::ColorValueType c[4])
 Set a point color. More...
 
FWDATATOOLS_API void setCellColor (::fwData::Mesh::Id id, const ::fwData::Mesh::ColorValueType c[4])
 Set a cell color. More...
 
FWDATATOOLS_API void setPointNormal (::fwData::Mesh::Id id, const ::fwData::Mesh::NormalValueType n[3])
 Set a point normal. More...
 
FWDATATOOLS_API void setCellNormal (::fwData::Mesh::Id id, const ::fwData::Mesh::NormalValueType n[3])
 Set a cell normal. More...
 
FWDATATOOLS_API void setPointTexCoord (::fwData::Mesh::Id id, const ::fwData::Mesh::TexCoordValueType t[2])
 Set a point texCoord. More...
 
FWDATATOOLS_API void setCellTexCoord (::fwData::Mesh::Id id, const ::fwData::Mesh::TexCoordValueType t[2])
 Set a cell texCoord. More...
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextCell (::fwData::Mesh::CellTypesEnum type, const ::fwData::Mesh::CellValueType *cell, size_t nb)
 Insert a cell into the mesh. More...
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextCell (::fwData::Mesh::CellValueType p)
 Insert a cell into the mesh. More...
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextCell (::fwData::Mesh::CellValueType p1,::fwData::Mesh::CellValueType p2)
 Insert a cell into the mesh. More...
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextCell (::fwData::Mesh::CellValueType p1,::fwData::Mesh::CellValueType p2,::fwData::Mesh::CellValueType p3)
 Insert a cell into the mesh. More...
 
FWDATATOOLS_API::fwData::Mesh::Id insertNextCell (::fwData::Mesh::CellValueType p1,::fwData::Mesh::CellValueType p2,::fwData::Mesh::CellValueType p3,::fwData::Mesh::CellValueType p4,::fwData::Mesh::CellTypesEnum type=::fwData::Mesh::QUAD)
 Insert a cell into the mesh. More...
 
template<typename T >
::fwData::Mesh::Id insertNextCell (::fwData::Mesh::CellTypesEnum type, const T &pointsBegin, const T &pointsEnd)
 Insert a cell into the mesh. More...
 
FWDATATOOLS_API::fwData::Mesh::PointsMultiArrayType getPoints () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::CellTypesMultiArrayType getCellTypes () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::CellDataMultiArrayType getCellData () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::CellDataOffsetsMultiArrayType getCellDataOffsets () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::PointColorsMultiArrayType getPointColors () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::CellColorsMultiArrayType getCellColors () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::PointNormalsMultiArrayType getPointNormals () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::CellNormalsMultiArrayType getCellNormals () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::PointTexCoordsMultiArrayType getPointTexCoords () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::CellTexCoordsMultiArrayType getCellTexCoords () const
 Returns the internal corresponding array as a boost::multi_array_ref.
 
FWDATATOOLS_API::fwData::Mesh::csptr getMesh () const
 Returns the internal fwData::Mesh.
 
FWDATATOOLS_API bool isClosed ()
 Return true if the mesh is closed. The result is computed for each call.
 

Protected Attributes

::fwData::Mesh::sptr m_mesh
 
::fwDataTools::helper::Array::sptr m_helperPoints
 
::fwDataTools::helper::Array::sptr m_helperCellTypes
 
::fwDataTools::helper::Array::sptr m_helperCellData
 
::fwDataTools::helper::Array::sptr m_helperCellDataOffsets
 
::fwDataTools::helper::Array::sptr m_helperPointColors
 
::fwDataTools::helper::Array::sptr m_helperCellColors
 
::fwDataTools::helper::Array::sptr m_helperPointNormals
 
::fwDataTools::helper::Array::sptr m_helperCellNormals
 
::fwDataTools::helper::Array::sptr m_helperPointTexCoords
 
::fwDataTools::helper::Array::sptr m_helperCellTexCoords
 

Friends

class ::boost::serialization::access
 
template<class , class >
struct ::boost::python::objects::pointer_holder
 
template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Detailed Description

Helper to manage Mesh. Lock the mesh buffer before to modify it.

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

Member Function Documentation

fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextCell ( ::fwData::Mesh::CellTypesEnum  type,
const ::fwData::Mesh::CellValueType *  cell,
size_t  nb 
)

Insert a cell into the mesh.

Reallocates the mesh concerned arrays if needed.

Returns
The id of the new cell
Exceptions
fwData::Exception

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

References SLM_ASSERT.

Referenced by fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextCell ( ::fwData::Mesh::CellValueType  p)

Insert a cell into the mesh.

See also
insertNextCell

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

fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextCell ( ::fwData::Mesh::CellValueType  p1,
::fwData::Mesh::CellValueType  p2 
)

Insert a cell into the mesh.

See also
insertNextCell

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

fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextCell ( ::fwData::Mesh::CellValueType  p1,
::fwData::Mesh::CellValueType  p2,
::fwData::Mesh::CellValueType  p3 
)

Insert a cell into the mesh.

See also
insertNextCell

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

fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextCell ( ::fwData::Mesh::CellValueType  p1,
::fwData::Mesh::CellValueType  p2,
::fwData::Mesh::CellValueType  p3,
::fwData::Mesh::CellValueType  p4,
::fwData::Mesh::CellTypesEnum  type = ::fwData::Mesh::QUAD 
)

Insert a cell into the mesh.

See also
insertNextCell

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

template<typename T >
::fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextCell ( ::fwData::Mesh::CellTypesEnum  type,
const T &  pointsBegin,
const T &  pointsEnd 
)

Insert a cell into the mesh.

See also
insertNextCell
fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextPoint ( const ::fwData::Mesh::PointValueType  p[3])

Insert a point into the mesh. Reallocates the point array if needed.

Parameters
ppoint coordinates
Returns
The id of the new point
Exceptions
fwData::Exception

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

Referenced by fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

fwData::Mesh::Id fwDataTools::helper::Mesh::insertNextPoint ( ::fwData::Mesh::PointValueType  x,
::fwData::Mesh::PointValueType  y,
::fwData::Mesh::PointValueType  z 
)

Insert a point into the mesh.

See also
insertNextPoint

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

void fwDataTools::helper::Mesh::setCellColor ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::ColorValueType  c[4] 
)

Set a cell color.

Depending on the type of allocated cell-colors array (RGB or RGBA), 3 or 4 points will be read from p. The color array must be allocated before calling this method.

Parameters
idcell index
ccolor
Exceptions
fwData::Exception

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

Referenced by fwDataTools::Mesh::colorizeMeshCells(), fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

void fwDataTools::helper::Mesh::setCellNormal ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::NormalValueType  n[3] 
)

Set a cell normal.

The normal array must be allocated before calling this method.

Parameters
idcell index
nnormal
Exceptions
fwData::Exception

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

Referenced by fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

void fwDataTools::helper::Mesh::setCellTexCoord ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::TexCoordValueType  t[2] 
)

Set a cell texCoord.

The texCoord array must be allocated before calling this method.

Parameters
idcell index
ttexCoord
Exceptions
fwData::Exception

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

Referenced by fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

void fwDataTools::helper::Mesh::setPoint ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::PointValueType  p[3] 
)

Set a point coordinates. The mesh must be allocated before calling this method.

Parameters
idpoint index
ppoint coordinates
Exceptions
fwData::Exception

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

void fwDataTools::helper::Mesh::setPoint ( ::fwData::Mesh::Id  id,
::fwData::Mesh::PointValueType  x,
::fwData::Mesh::PointValueType  y,
::fwData::Mesh::PointValueType  z 
)

Set a point coordinates.

See also
setPoint

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

void fwDataTools::helper::Mesh::setPointColor ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::ColorValueType  c[4] 
)

Set a point color.

Depending on the type of allocated point-colors array (RGB or RGBA), 3 or 4 points will be read from p. The color array must be allocated before calling this method.

Parameters
idpoint index
ccolor
Exceptions
fwData::Exception

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

Referenced by fwDataTools::Mesh::colorizeMeshPoints(), fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

void fwDataTools::helper::Mesh::setPointNormal ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::NormalValueType  n[3] 
)

Set a point normal.

The normal array must be allocated before calling this method.

Parameters
idpoint index
nnormal
Exceptions
fwData::Exception

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

Referenced by fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:

void fwDataTools::helper::Mesh::setPointTexCoord ( ::fwData::Mesh::Id  id,
const ::fwData::Mesh::TexCoordValueType  t[2] 
)

Set a point texCoord.

The texCoord array must be allocated before calling this method.

Parameters
idpoint index
ttexCoord
Exceptions
fwData::Exception

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

Referenced by fwVtkIO::helper::Mesh::fromVTKGrid(), and fwVtkIO::helper::Mesh::fromVTKMesh().

+ Here is the caller graph for this function:


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