Abstract tessellator interface. More...
#include <MeshVizXLM/tessellator/MiTessellator.h>
Public Member Functions | |
virtual | ~MiTessellator () |
virtual size_t | getTimeStamp () const =0 |
Tessellation input mesh | |
| |
virtual void | setMesh (const MiTopologyExplicitI &topology, const MiGeometryI &geometry)=0 |
virtual void | unsetMesh ()=0 |
Tessellation of volume cells. | |
| |
virtual void | startVolumeTessellation (MeWVolumeTopologyExplicitI &tessellatedTopology, MeWGeometryI &tessellatedGeometry)=0 |
virtual void | finishVolumeTessellation ()=0 |
virtual size_t | tessellateVolumeCell (const MiVolumeCell *volumeCell)=0 |
Tessellation of surface cells. | |
| |
virtual void | startSurfaceTessellation (MeWSurfaceTopologyExplicitI &tessellatedTopology, MeWGeometryI &tessellatedGeometry)=0 |
virtual void | finishSurfaceTessellation ()=0 |
virtual size_t | tessellateSurfaceCell (const MiSurfaceCell *surfaceCell)=0 |
Tessellation of line cells. | |
| |
virtual void | startLineTessellation (MeWLineTopologyExplicitI &tessellatedTopology, MeWGeometryI &tessellatedGeometry)=0 |
virtual void | finishLineTessellation ()=0 |
virtual size_t | tessellateLineCell (const MiLineCell *lineCell)=0 |
Factory methods | |
| |
static MiTessellator * | getNewTessellatorBasic () |
static MiTessellator * | getNewTessellatorGeometry (const MiEdgeErrorMetric< MbVec3d > &edgeMetric) |
static MiTessellator * | getNewTessellatorPolyhedron () |
Defines the interface used to handle the tessellation of non linear meshes.
This class is an abstract interface and no constructor is available. A concrete instance of this interface can be allocated by calling either getNewTessellatorBasic() or getNewTessellatorGeometry(). The application can either use one of these instances, or implement its own tessellation tool by extending this interface and implementing all the abstract methods.
MiTessellator defines the miscellaneous methods used to tessellate either line meshes, surface meshes or volume meshes. The setMesh method defines the topology and geometry of the input mesh from which the lines, surfaces or volumes to be tessellated are extracted.
List of methods used to tessellate a line cell:
The following pseudo code explains how these methods are used by a class that extracts or draws some lines from an input mesh.
aLineExtractorMethod(MiTessellator* tessellator, inputMesh, ...) { // Extract the useful line cells. ... // now start the tessellation tessellator->setMesh(inputMesh.getTopology(),inputMesh.getGeometry()); tessellator->startLineTessellation(tessellatedTopo,tessellatedGeom); for each extracted line cell lC { tessellator->tessellateLineCell(lC); } tessellator->finishLineTessellation(); tessellator->unsetMesh(); return tessellatedTopo and tessellatedGeom }
List of methods used to tessellate a surface cell:
The following pseudo code explains how these methods are used by a class that extracts or draws some surfaces from an input mesh.
aSurfaceExtractorMethod(MiTessellator* tessellator, inputMesh, ...) { // Extract the useful surface cells. ... // now start the tessellation tessellator->setMesh(inputMesh.getTopology(),inputMesh.getGeometry()); tessellator->startSurfaceTessellation(tessellatedTopo,tessellatedGeom); for each extracted surface cell sC { tessellator->tessellateSurfaceCell(sC,iC); } tessellator->finishSurfaceTessellation(); tessellator->unsetMesh(); return tessellatedTopo and tessellatedGeom }
List of methods used to tessellate a volume cell:
The following pseudo code explains how these methods are used by a class that extracts or draws some volumes from an input mesh.
aVolumeExtractorMethod(MiTessellator* tessellator, inputMesh, ...) { // Extract the useful volume cells. ... // now start the tessellation tessellator->setMesh(inputMesh.getTopology(),inputMesh.getGeometry()); tessellator->startVolumeTessellation(tessellatedTopo,tessellatedGeom); for each extracted volume cell vC { tessellator->tessellateVolumeCell(vC); } tessellator->finishVolumeTessellation(); tessellator->unsetMesh(); return tessellatedTopo and tessellatedGeom }
TessellatedLine, TessellatedSkin, TessellatedSurface, QuadraticLine, QuadraticSkin, QuadraticSurface
virtual MiTessellator::~MiTessellator | ( | ) | [inline, virtual] |
virtual void MiTessellator::finishLineTessellation | ( | ) | [pure virtual] |
End point of the tessellation of lines.
This method is called after all the line cells are tessellated.
virtual void MiTessellator::finishSurfaceTessellation | ( | ) | [pure virtual] |
End point of the tessellation of surfaces.
This method is called after all the surface cells are tessellated.
virtual void MiTessellator::finishVolumeTessellation | ( | ) | [pure virtual] |
End point of the tessellation of volumes.
This method is called after all the volume cells are tessellated.
static MiTessellator* MiTessellator::getNewTessellatorBasic | ( | ) | [static] |
Returns a new instance of a basic implementation of the interface MiTessellator.
This basic instance does not really tessellate the given cell because it does not add any points in the result. The line cells to tessellate are replaced by their sub segments returned by the method MiLineCell::getSubEdgeNodesIndex(). The surface cells to tessellate are replaced by their sub segments returned by the method MiSurfaceCell::getSubTriangleNodesIndex(). For instance the following image shows the result of the basic tessellator when tessellating a quadratic triangle cell.
static MiTessellator* MiTessellator::getNewTessellatorGeometry | ( | const MiEdgeErrorMetric< MbVec3d > & | edgeMetric | ) | [static] |
Returns a new instance of a geometrical implementation of the interface MiTessellator.
This geometrical tessellator splits the edges of line or surface cells in a recursive way. This tessellator does not take into account any dataset attached to the cell's nodes. It uses only the geometrical criterion defined by the instance of MiEdgeErrorMetric<MbVec3d> given. If an edge is seen as not linear by this criterion, the tessellator splits it into 2 sub edges, which are then also checked with this criterion, and so on. However, the tessellation stops when the recursive depth exceeds the environment variable MESHVIZ_TESSELLATION_MAX_DEPTH (see SoPreferences) even if the geometrical criterion is not reached. In other words, the sub-edges minimum length is 1/2^MESHVIZ_TESSELLATION_MAX_DEPTH of the tessellated edge original length. The default value is 10, meaning that a given edge will never be divided into more than 2^10 = 1024 edges.
The following image shows an example of the result of the geometrical tessellator when tessellating a quadratic triangle cell.
edgeMetric | The instance of MiEdgeErrorMetric used by the geometry tessellator as the criteria to decide if an edge of a current level of tessellation should be split or not. |
static MiTessellator* MiTessellator::getNewTessellatorPolyhedron | ( | ) | [static] |
Returns a new instance of a polyhedral implementation of the interface MiTessellator.
This polyhedral tessellator splits polyhedron cells into a set of tetrahedra and pyramids. This tessellator does not take into account any dataset attached to the cell's nodes. The break down criterion is only based on the topological definition of each volume cell given by the MiVolumeCell interface, namely the number of nodes and the number of faces. New nodes are then added at the center of the volume cell and eventually at the center of each face if having more that four nodes.
virtual size_t MiTessellator::getTimeStamp | ( | ) | const [pure virtual] |
Returns for this tessellator a unique time stamp across all tessellators in the application.
When the content of the tessellator changes, the time stamp must increase. The time stamp allows extractors to identify this tessellator and to be aware of any changes to it.
virtual void MiTessellator::setMesh | ( | const MiTopologyExplicitI & | topology, | |
const MiGeometryI & | geometry | |||
) | [pure virtual] |
Defines the topology and geometry of the input mesh from which the lines, surfaces and volumes are extracted before being tessellated.
[in] | topology | The input mesh topology. |
[in] | geometry | The input mesh geometry. |
virtual void MiTessellator::startLineTessellation | ( | MeWLineTopologyExplicitI & | tessellatedTopology, | |
MeWGeometryI & | tessellatedGeometry | |||
) | [pure virtual] |
Starting point of the tessellation of lines.
When a list of line cells needs to be tessellated, this method is called first.
[in] | tessellatedTopology | The topology class in which the resulting segments of the tessellation are added. (see tessellateLineCell()). |
[in] | tessellatedGeometry | The geometry class in which the resulting coordinates of the tessellation are added. (see tessellateLineCell()). |
virtual void MiTessellator::startSurfaceTessellation | ( | MeWSurfaceTopologyExplicitI & | tessellatedTopology, | |
MeWGeometryI & | tessellatedGeometry | |||
) | [pure virtual] |
Starting point of the tessellation of surfaces.
When a list of surface cells needs to be tessellated, this method is called first.
[in] | tessellatedTopology | The topology class in which the resulting triangles of the tessellation are added. (see tessellateSurfaceCell()). |
[in] | tessellatedGeometry | The geometry class in which the resulting coordinates of the tessellation are added. (see tessellateSurfaceCell()). |
virtual void MiTessellator::startVolumeTessellation | ( | MeWVolumeTopologyExplicitI & | tessellatedTopology, | |
MeWGeometryI & | tessellatedGeometry | |||
) | [pure virtual] |
Starting point of the tessellation of volumes.
When a list of volume cells needs to be tessellated, this method is called first.
[in] | tessellatedTopology | The topology class in which the resulting cells of the tessellation are added. (see tessellateVollumeCell()). |
[in] | tessellatedGeometry | The geometry class in which the resulting coordinates of the tessellation are added. (see tessellateVolumeCell()). |
virtual size_t MiTessellator::tessellateLineCell | ( | const MiLineCell * | lineCell | ) | [pure virtual] |
Tessellates a line cell and appends the resulting indexed tessellation to the tessellatedTopology and tessellatedGeometry given to this tessellator by the previous call to startLineTessellation().
[in] | lineCell | The line cell to be tessellated. |
virtual size_t MiTessellator::tessellateSurfaceCell | ( | const MiSurfaceCell * | surfaceCell | ) | [pure virtual] |
Tessellates a surface cell and appends the resulting indexed tessellation to the tessellatedTopology and tessellatedGeometry given to this tessellator by the previous call to startSurfaceTessellation().
[in] | surfaceCell | the surface cell to be tessellated. A non-linear surface cell is defined by its sub triangle decomposition given by MiSurfaceCell::getSubTriangleNodesIndex() but not directly by the MiCell::getNodeIndex(). |
virtual size_t MiTessellator::tessellateVolumeCell | ( | const MiVolumeCell * | volumeCell | ) | [pure virtual] |
Tessellates a volume cell and appends the resulting indexed tessellation to the tessellatedTopology and tessellatedGeometry given to this tessellator by the previous call to startVolumeTessellation().
[in] | volumeCell | the volume cell to be tessellated. |
virtual void MiTessellator::unsetMesh | ( | ) | [pure virtual] |
Removes the input mesh after tessellation.