Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
MiTessellator Class Referenceabstract

MeshViz 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 MiTessellatorgetNewTessellatorBasic ()
 Returns a new instance of a basic implementation of the interface MiTessellator.
 
static MiTessellatorgetNewTessellatorGeometry (const MiEdgeErrorMetric< MbVec3d > &edgeMetric)
 Returns a new instance of a geometrical implementation of the interface MiTessellator.
 
static MiTessellatorgetNewTessellatorPolyhedron ()
 Returns a new instance of a polyhedral implementation of the interface MiTessellator.
 

Detailed Description

MeshViz 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.

Constructor & Destructor Documentation

◆ ~MiTessellator()

virtual MiTessellator::~MiTessellator ( )
inlinevirtual

Definition at line 136 of file MiTessellator.h.

Member Function Documentation

◆ finishLineTessellation()

virtual void MiTessellator::finishLineTessellation ( )
pure virtual

End point of the tessellation of lines.


This method is called after all the line cells are tessellated.

See also
startLineTessellation().

◆ finishSurfaceTessellation()

virtual void MiTessellator::finishSurfaceTessellation ( )
pure virtual

End point of the tessellation of surfaces.


This method is called after all the surface cells are tessellated.

See also
startSurfaceTessellation().

◆ finishVolumeTessellation()

virtual void MiTessellator::finishVolumeTessellation ( )
pure virtual

End point of the tessellation of volumes.


This method is called after all the volume cells are tessellated.

See also
startVolumeTessellation().

◆ getNewTessellatorBasic()

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.

◆ getNewTessellatorGeometry()

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.

Note
MiEdgeErrorMetric is just an interface with no constructor available. It is up to the application to decide which test should be done to check if 3 points are almost aligned or not. However, the class MxEdgeErrorMetricGeometry is an implementation provided for convenience. It implements a simple test with a tolerance factor.

The following image shows an example of the result of the geometrical tessellator when tessellating a quadratic triangle cell.

Parameters
edgeMetricThe 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.

◆ getNewTessellatorPolyhedron()

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.

Note
Tessellating a line or a surface cell with this tessallator simply returns the cell as is.

◆ getTimeStamp()

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.

Note
MxTimeStamp can be used to generate a valid time stamp.

◆ setMesh()

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.

Parameters
[in]topologyThe input mesh topology.
[in]geometryThe input mesh geometry.

◆ startLineTessellation()

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.

See also
finishLineTessellation().
Parameters
[in]tessellatedTopologyThe topology class in which the resulting segments of the tessellation are added. (see tessellateLineCell()).
[in]tessellatedGeometryThe geometry class in which the resulting coordinates of the tessellation are added. (see tessellateLineCell()).

◆ startSurfaceTessellation()

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.

See also
finishSurfaceTessellation().
Parameters
[in]tessellatedTopologyThe topology class in which the resulting triangles of the tessellation are added. (see tessellateSurfaceCell()).
[in]tessellatedGeometryThe geometry class in which the resulting coordinates of the tessellation are added. (see tessellateSurfaceCell()).

◆ startVolumeTessellation()

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.

See also
finishVolumeTessellation().
Parameters
[in]tessellatedTopologyThe topology class in which the resulting cells of the tessellation are added. (see tessellateVollumeCell()).
[in]tessellatedGeometryThe geometry class in which the resulting coordinates of the tessellation are added. (see tessellateVolumeCell()).

◆ tessellateLineCell()

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().

Parameters
[in]lineCellThe line cell to be tessellated.
Returns
the number of edges generated by the tessellation of this cell.

◆ tessellateSurfaceCell()

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().

Parameters
[in]surfaceCellthe 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().
Returns
the number of triangles generated by the tessellation of this cell.

◆ tessellateVolumeCell()

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().

Parameters
[in]volumeCellthe volume cell to be tessellated.
Returns
the number of cells generated by the tessellation of this cell.

◆ unsetMesh()

virtual void MiTessellator::unsetMesh ( )
pure virtual

Removes the input mesh after tessellation.


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