fw4spl
fwVtkIO::helper::Mesh Class Reference

Helper to manage vtkPolyData and fwData::Mesh. More...

#include <Mesh.hpp>

Static Public Member Functions

static FWVTKIO_API void fromVTKMesh (vtkSmartPointer< vtkPolyData > _polyData,::fwData::Mesh::sptr _mesh)
 Convert a vtkPolyData to a ::fwData::Mesh::sptr. More...
 
static FWVTKIO_API void fromVTKGrid (vtkSmartPointer< vtkUnstructuredGrid > grid,::fwData::Mesh::sptr mesh)
 Convert a vtkUnstructuredGrid to a ::fwData::Mesh::sptr. More...
 
static FWVTKIO_API void toVTKGrid (const ::fwData::Mesh::csptr &mesh, vtkSmartPointer< vtkUnstructuredGrid > grid)
 Convert a ::fwData::Mesh::csptr to a vtkUnstructuredGrid. More...
 
static FWVTKIO_API void toVTKMesh (const ::fwData::Mesh::csptr &_mesh, vtkSmartPointer< vtkPolyData > _polyData)
 Convert a ::fwData::Mesh::csptr to a vtkPolyData. More...
 
static FWVTKIO_API void updatePolyDataPoints (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with ::fwData::Mesh::sptr points. More...
 
static FWVTKIO_API void updatePolyDataPointColor (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with point color of fwData::Mesh. More...
 
static FWVTKIO_API void updatePolyDataCellColor (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with cell color of fwData::Mesh. More...
 
static FWVTKIO_API void updatePolyDataPointNormals (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with point normals of fwData::Mesh. More...
 
static FWVTKIO_API void updatePolyDataCellNormals (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with cell normals of fwData::Mesh. More...
 
static FWVTKIO_API void updatePolyDataPointTexCoords (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with point texCoords of fwData::Mesh. More...
 
static FWVTKIO_API void updatePolyDataCellTexCoords (vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkPolyData with cell texCoords of fwData::Mesh. More...
 
static FWVTKIO_API void updateGridPoints (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with ::fwData::Mesh::sptr points. More...
 
static FWVTKIO_API void updateGridPointColor (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with point color of fwData::Mesh. More...
 
static FWVTKIO_API void updateGridCellColor (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with cell color of fwData::Mesh. More...
 
static FWVTKIO_API void updateGridPointNormals (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with point normals of fwData::Mesh. More...
 
static FWVTKIO_API void updateGridCellNormals (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with cell normals of fwData::Mesh. More...
 
static FWVTKIO_API void updateGridPointTexCoords (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with point texCoords of fwData::Mesh. More...
 
static FWVTKIO_API void updateGridCellTexCoords (vtkSmartPointer< vtkUnstructuredGrid > gridDst, const ::fwData::Mesh::csptr &meshSrc)
 Update a vtkUnstructuredGrid with cell texCoords of fwData::Mesh. More...
 
static FWVTKIO_API double computeVolume (const ::fwData::Mesh::csptr &mesh)
 Compute the volume of the mesh using MassProperties vtk class. More...
 

Detailed Description

Helper to manage vtkPolyData and fwData::Mesh.

Definition at line 26 of file io/fwVtkIO/include/fwVtkIO/helper/Mesh.hpp.

Member Function Documentation

double fwVtkIO::helper::Mesh::computeVolume ( const ::fwData::Mesh::csptr &  mesh)
static

Compute the volume of the mesh using MassProperties vtk class.

Parameters
[in]meshcurrent mesh
Returns
volume of the mesh

Definition at line 835 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References OSLM_DEBUG, and toVTKMesh().

+ Here is the call graph for this function:

void fwVtkIO::helper::Mesh::fromVTKGrid ( vtkSmartPointer< vtkUnstructuredGrid >  grid,
::fwData::Mesh::sptr  mesh 
)
static

Convert a vtkUnstructuredGrid to a ::fwData::Mesh::sptr.

Parameters
[in]gridvtkUnstructuredGrid.
[out]mesh::fwData::Mesh::sptr.

Definition at line 214 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References fwDataTools::helper::Mesh::insertNextCell(), fwDataTools::helper::Mesh::insertNextPoint(), fwDataTools::helper::Mesh::setCellColor(), fwDataTools::helper::Mesh::setCellNormal(), fwDataTools::helper::Mesh::setCellTexCoord(), fwDataTools::helper::Mesh::setPointColor(), fwDataTools::helper::Mesh::setPointNormal(), fwDataTools::helper::Mesh::setPointTexCoord(), SLM_ASSERT, and fwDataTools::helper::Mesh::updateLock().

Referenced by fwVtkIO::SeriesDBReader::~SeriesDBReader().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::fromVTKMesh ( vtkSmartPointer< vtkPolyData >  _polyData,
::fwData::Mesh::sptr  _mesh 
)
static

Convert a vtkPolyData to a ::fwData::Mesh::sptr.

Parameters
[in]_polyDatavtkPolyData.
[out]_mesh::fwData::Mesh::sptr.

Definition at line 35 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References fwDataTools::helper::Mesh::insertNextCell(), fwDataTools::helper::Mesh::insertNextPoint(), fwDataTools::helper::Mesh::setCellColor(), fwDataTools::helper::Mesh::setCellNormal(), fwDataTools::helper::Mesh::setCellTexCoord(), fwDataTools::helper::Mesh::setPointColor(), fwDataTools::helper::Mesh::setPointNormal(), fwDataTools::helper::Mesh::setPointTexCoord(), SLM_ASSERT, and fwDataTools::helper::Mesh::updateLock().

Referenced by fwVtkIO::MeshReader::read(), opVTKMesh::SVTKMesher::updating(), opVTKMesh::action::SMeshCreation::updating(), and fwVtkIO::SeriesDBReader::~SeriesDBReader().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::toVTKGrid ( const ::fwData::Mesh::csptr &  mesh,
vtkSmartPointer< vtkUnstructuredGrid >  grid 
)
static

Convert a ::fwData::Mesh::csptr to a vtkUnstructuredGrid.

Parameters
[in]mesh::fwData::Mesh::csptr.
[out]gridvtkUnstructuredGrid.

Definition at line 480 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References fwDataTools::helper::MeshGetter::getCellData(), fwDataTools::helper::MeshGetter::getCellDataOffsets(), fwDataTools::helper::MeshGetter::getCellTypes(), updateGridCellColor(), updateGridCellNormals(), updateGridCellTexCoords(), updateGridPointColor(), updateGridPointNormals(), updateGridPoints(), and updateGridPointTexCoords().

+ Here is the call graph for this function:

void fwVtkIO::helper::Mesh::toVTKMesh ( const ::fwData::Mesh::csptr &  _mesh,
vtkSmartPointer< vtkPolyData >  _polyData 
)
static

Convert a ::fwData::Mesh::csptr to a vtkPolyData.

Parameters
[in]_mesh::fwData::Mesh::csptr.
[out]_polyDatavtkPolyData.

Definition at line 393 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References fwDataTools::helper::MeshGetter::getCellData(), fwDataTools::helper::MeshGetter::getCellDataOffsets(), fwDataTools::helper::MeshGetter::getCellTypes(), updatePolyDataCellColor(), updatePolyDataCellNormals(), updatePolyDataCellTexCoords(), updatePolyDataPointColor(), updatePolyDataPointNormals(), updatePolyDataPoints(), and updatePolyDataPointTexCoords().

Referenced by computeVolume(), vtkSimpleMesh::SRenderer::notifyCamPositionUpdated(), visuVTKAdaptor::SMeshesBoxWidget::updateMeshMapFromComposite(), visuVTKAdaptor::SMesh::updateOptionsMode(), vtkCompositeMesh::RendererService::updating(), visuVTKAdaptor::SMeshNormals::updating(), vtkSimpleMesh::SRenderer::updating(), fwVtkIO::MeshWriter::write(), and fwVtkIO::ModelSeriesObjWriter::~ModelSeriesObjWriter().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridCellColor ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with cell color of fwData::Mesh.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Returns the updated vtkUnstructuredGrid

Definition at line 993 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridCellNormals ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with cell normals of fwData::Mesh.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Returns the updated vtkUnstructuredGrid

Definition at line 1037 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridCellTexCoords ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with cell texCoords of fwData::Mesh.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Returns the updated vtkUnstructuredGrid

Definition at line 1124 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridPointColor ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with point color of fwData::Mesh.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Returns the updated vtkUnstructuredGrid

Definition at line 950 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridPointNormals ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with point normals of fwData::Mesh.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Returns the updated vtkUnstructuredGrid

Definition at line 881 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridPoints ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with ::fwData::Mesh::sptr points.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Warning : be careful with updatePoints : this may change the number of vertex of the vtkUnstructuredGrid, cells will not be updated. Returns the updated vtkUnstructuredGrid

Definition at line 924 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References fwDataTools::helper::MeshGetter::getPoints(), and SLM_ASSERT.

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updateGridPointTexCoords ( vtkSmartPointer< vtkUnstructuredGrid >  gridDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkUnstructuredGrid with point texCoords of fwData::Mesh.

Parameters
[out]gridDataDstvtkUnstructuredGrid
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkUnstructuredGrid

Returns the updated vtkUnstructuredGrid

Definition at line 1081 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKGrid().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataCellColor ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with cell color of fwData::Mesh.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkPolyData

Returns the updated vtkPolyPata

Definition at line 620 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKMesh(), and visuVTKAdaptor::SMesh::updateCellColors().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataCellNormals ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with cell normals of fwData::Mesh.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkPolyData

Returns the updated vtkPolyPata

Definition at line 707 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKMesh(), visuVTKAdaptor::SMeshNormals::updateCellNormals(), visuVTKAdaptor::SMesh::updateCellNormals(), and vtkSimpleMesh::SRenderer::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataCellTexCoords ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with cell texCoords of fwData::Mesh.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
the updated vtkPolyPata

Definition at line 792 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKMesh(), and visuVTKAdaptor::SMesh::updateCellTexCoords().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataPointColor ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with point color of fwData::Mesh.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkPolyData

Returns the updated vtkPolyPata

Definition at line 578 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKMesh(), visuVTKAdaptor::SMesh::updatePointColors(), and vtkSimpleMesh::SRenderer::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataPointNormals ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with point normals of fwData::Mesh.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkPolyData

Returns the updated vtkPolyPata

Definition at line 665 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKMesh(), visuVTKAdaptor::SMeshNormals::updatePointNormals(), visuVTKAdaptor::SMesh::updatePointNormals(), visuVTKAdaptor::SMeshNormals::updateVertex(), and vtkSimpleMesh::SRenderer::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataPoints ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with ::fwData::Mesh::sptr points.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
vtkPolyData

Warning : be careful with updatePoints : this may change the number of vertex of the polydata, cells will not be updated. Returns the updated vtkPolyPata

Definition at line 551 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

References fwDataTools::helper::MeshGetter::getPoints(), and SLM_ASSERT.

Referenced by toVTKMesh(), visuVTKAdaptor::SMeshNormals::updateVertex(), visuVTKAdaptor::SMesh::updateVertex(), and vtkSimpleMesh::SRenderer::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fwVtkIO::helper::Mesh::updatePolyDataPointTexCoords ( vtkSmartPointer< vtkPolyData >  polyDataDst,
const ::fwData::Mesh::csptr &  meshSrc 
)
static

Update a vtkPolyData with point texCoords of fwData::Mesh.

Parameters
[out]polyDataDstvtkPolyData
[in]meshSrc::fwData::Mesh::sptr
Returns
the updated vtkPolyPata

Definition at line 750 of file io/fwVtkIO/src/fwVtkIO/helper/Mesh.cpp.

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

Referenced by toVTKMesh(), and visuVTKAdaptor::SMesh::updatePointTexCoords().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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