Abstract tessellator interface. More...
#include <MeshVizXLM/tessellator/MiTessellator.h>
Public Member Functions | |
virtual | ~MiTessellator () |
virtual size_t | getTimeStamp () const =0 |
Returns for this tessellator a unique time stamp across all tessellators in the application. | |
Tessellation input mesh | |
virtual void | setMesh (const MiTopologyExplicitI &topology, const MiGeometryI &geometry)=0 |
Defines the topology and geometry of the input mesh from which the lines, surfaces and volumes are extracted before being tessellated. | |
virtual void | unsetMesh ()=0 |
Removes the input mesh after tessellation. | |
Tessellation of volume cells. | |
virtual void | startVolumeTessellation (MeWVolumeTopologyExplicitI &tessellatedTopology, MeWGeometryI &tessellatedGeometry)=0 |
Starting point of the tessellation of volumes. | |
virtual void | finishVolumeTessellation ()=0 |
End point of the tessellation of volumes. | |
virtual size_t | tessellateVolumeCell (const MiVolumeCell *volumeCell)=0 |
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(). | |
Tessellation of surface cells. | |
virtual void | startSurfaceTessellation (MeWSurfaceTopologyExplicitI &tessellatedTopology, MeWGeometryI &tessellatedGeometry)=0 |
Starting point of the tessellation of surfaces. | |
virtual void | finishSurfaceTessellation ()=0 |
End point of the tessellation of surfaces. | |
virtual size_t | tessellateSurfaceCell (const MiSurfaceCell *surfaceCell)=0 |
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(). | |
Tessellation of line cells. | |
virtual void | startLineTessellation (MeWLineTopologyExplicitI &tessellatedTopology, MeWGeometryI &tessellatedGeometry)=0 |
Starting point of the tessellation of lines. | |
virtual void | finishLineTessellation ()=0 |
End point of the tessellation of lines. | |
virtual size_t | tessellateLineCell (const MiLineCell *lineCell)=0 |
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(). | |
Static Public Member Functions | |
Factory methods | |
static MiTessellator * | getNewTessellatorBasic () |
Returns a new instance of a basic implementation of the interface MiTessellator. | |
static MiTessellator * | getNewTessellatorGeometry (const MiEdgeErrorMetric< MbVec3d > &edgeMetric) |
Returns a new instance of a geometrical implementation of the interface MiTessellator. | |
static MiTessellator * | getNewTessellatorPolyhedron () |
Returns a new instance of a polyhedral implementation of the interface MiTessellator. | |
Abstract tessellator interface.
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 }
Definition at line 133 of file MiTessellator.h.
|
inlinevirtual |
Definition at line 136 of file MiTessellator.h.
|
pure virtual |
End point of the tessellation of lines.
This method is called after all the line cells are tessellated.
|
pure virtual |
End point of the tessellation of surfaces.
This method is called after all the surface cells are tessellated.
|
pure virtual |
End point of the tessellation of volumes.
This method is called after all the volume cells are tessellated.
|
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 |
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 |
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.
|
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.
|
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. |
|
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()). |
|
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()). |
|
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()). |
|
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. |
|
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(). |
|
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. |
|
pure virtual |
Removes the input mesh after tessellation.