GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmCellMeshTopology Class Referenceabstract

Base interface class for mesh topological queries. More...

#include <gmCellMeshTopology.h>

Public Types

enum  QueryOptions { STAR , QSTAR }
 Query options for adjacent nodes retrieval. More...
 

Public Member Functions

virtual bool hasElementsWithoutTopology () const =0
 Returns true if this mesh contains elements that have no topology information (non-manifold elements like bars for a surface mesh and bars, quads and triangles for solid meshes)
 
virtual GmCelladjacentCell (const GmCell *cell, int sideIndex, int *adjSideIndex=NULL) const =0
 Given a cell, returns the adjacent cell sharing the given side, represented by a cell edge index for surface meshes or by a cell face index for solid meshes.
 
virtual void nodeAdjacentNodes (int nodeIndex, QueryOptions options, QVector< int > &list) const =0
 Fills list with the set of adjacent nodes to the given node. The result list depends on the given options parameter.
 
virtual void nodeAdjacentCells (int nodeIndex, QVector< GmCell * > &list) const =0
 Fills list with all the cells that include the given node.
 
virtual void nodeAdjacentCells (int nodeIndex, QVector< const GmCell * > &list) const =0
 Fills list with all the cells that include the given node. Overload filling a list of const pointers.
 
virtual void edgeAdjacentCells (const GmCell *cell, int edgeIndex, QVector< GmCell * > &list) const =0
 Fills list with all the cells that include the given edge, identified by a cell + local edge index pair. The input cell is added to the list. In 2D this is simillar to calling adjacentCell()
 
virtual void edgeAdjacentCells (const GmCell *cell, int edgeIndex, QVector< const GmCell * > &list) const =0
 Overload for edgeAdjacentCells(const GmCell*, int, QVector<GmCell*>&) filling a list of const pointers.
 
virtual void edgeAdjacentCells (int node1, int node2, QVector< GmCell * > &list) const =0
 Fills list with all the cells that include the given edge, identified by a pair of nodes. If the nodes do not form an edge, the returned list will be empty. Provided nodes should be element's "vertices", i.e, no mid edge nodes allowed.
 
virtual void edgeAdjacentCells (int node1, int node2, QVector< const GmCell * > &list) const =0
 Overload for edgeAdjacentCells(int, int, QVector<GmCell*>&) filling a list of const pointers.
 
virtual bool isBorderNode (int nodeIndex) const =0
 Returns true if this node belongs to an edge/face that does not have an adjacent cell. Returns false otherwise (this includes "nodes belonging only to "strange" elements or not belonging to a cell at all AND nodes belonging to a hole created by interface element intersections).
 
virtual int numBorders () const =0
 Returns the number of border curves / surfaces for a mesh.
 
virtual int borderIndex (const GmCell *cell, int sideIndex) const =0
 If the given side belongs to the mesh border, returns the border index (a value between 0 and numBorders() - 1). Otherwise, returns -2 for internal sides or -1 for a border side that belongs to a topological "hole" in the mesh, created by the intersection of multiple interface elements. Returns -3 for "strange" elements.
 
virtual GmCellfirstBorderCurveEdge (int borderCurveIndex, int *edgeIndex) const =0
 Given a border curve index, 0 >= index < numBorders(), from a surface mesh, returns a mesh edge belonging to that border. The edge is specified by the returned cell pointer and the local edge index inside the cell, filled in the output parameter edgeIndex.
 
virtual GmCellnextBorderCurveEdge (const GmCell *cell, int edgeIndex, int *nextEdgeIndex) const =0
 Given a cell edge belonging to a border from a surface mesh, returns the next edge in the border. The current edge is specified by a cell pointer and the local edge index inside the cell, and should be the values returned by firstBorderCurveEdge() or by the last call to nextBorderCurveEdge(). The next edge is given by the returned cell pointer and nextEdgeIndex parameters.
 
virtual void * borderTraverseStart (int borderId) const =0
 Given a borderId (a value between 0 and numBorders() - 1, that can also be queried through a call to borderIndex() over a known border side), returns a context that can be used on successive calls to borderTraverseNext(). After the border curve / surface traversal, the context should be destroyed by a call to borderTraverseEnd(). Returns NULL if border traversal is not possible.
 
virtual GmCellborderTraverseNext (void *context, int *nextSideIndex) const =0
 Returns the next cell, side pair on the border. context should be the pointer returned by borderTraverseStart(). The cell edge / face index is returned by the nextSideIndex output parameter. Returns NULL if there are no more edges / faces to return.
 
virtual void borderTraverseEnd (void *context) const =0
 Destroys the context returned by borderTraverseStart()
 
virtual void printParameters (const GmLogCategory &logger, GmLogLevel level) const =0
 Prints a summary of the topological structure in a way to be integrated with the mesh printed by GmCellMesh::printParameters()
 
virtual void print (const GmLogCategory &logger, GmLogLevel level) const =0
 Prints the topological structure FULL information to the specified logger/level.
 
virtual size_t printMemoryStatistics (const GmLogCategory &logger, GmLogLevel level) const =0
 Prints memory usage for the topological data structure to the given logger. Returns the used memory as reported by usedMemory()
 
virtual size_t usedMemory () const =0
 Returns the approximate memory used for storing the topological data structure.
 

Detailed Description

Base interface class for mesh topological queries.

Member Enumeration Documentation

◆ QueryOptions

Query options for adjacent nodes retrieval.

Enumerator
QSTAR 

Returns the set of connected nodes, ignoring quadratic nodes.

Member Function Documentation

◆ adjacentCell()

virtual GmCell * GmCellMeshTopology::adjacentCell ( const GmCell * cell,
int sideIndex,
int * adjSideIndex = NULL ) const
pure virtual

Given a cell, returns the adjacent cell sharing the given side, represented by a cell edge index for surface meshes or by a cell face index for solid meshes.

The sideIndex is a value between 0 and the number of element edges/face - 1, defining the position of the edge/face of interest in the cell. Returns NULL if the edge/face belongs to the mesh boundary. Also returns NULL for "strange" elements that don't have topology information (non-manifold elements like bars for a surface mesh and bars, quads and triangles for solid meshes).

If adjSideIndex is different from NULL, it will be filled with the side index of the adjacent edge/face in the adjacent cell.

◆ firstBorderCurveEdge()

virtual GmCell * GmCellMeshTopology::firstBorderCurveEdge ( int borderCurveIndex,
int * edgeIndex ) const
pure virtual

Given a border curve index, 0 >= index < numBorders(), from a surface mesh, returns a mesh edge belonging to that border. The edge is specified by the returned cell pointer and the local edge index inside the cell, filled in the output parameter edgeIndex.

To traverse all the edges in a border curve, call firstBorderCurveEdge() to get the first edge. Then, repeatedly call nextBorderCurveEdge() to get the next edge until the returned result is equal to the first edge returned by the call to firstBorderCurveEdge()

IMPORTANT: this function should NOT be called for solid meshes.

◆ nextBorderCurveEdge()

virtual GmCell * GmCellMeshTopology::nextBorderCurveEdge ( const GmCell * cell,
int edgeIndex,
int * nextEdgeIndex ) const
pure virtual

Given a cell edge belonging to a border from a surface mesh, returns the next edge in the border. The current edge is specified by a cell pointer and the local edge index inside the cell, and should be the values returned by firstBorderCurveEdge() or by the last call to nextBorderCurveEdge(). The next edge is given by the returned cell pointer and nextEdgeIndex parameters.

IMPORTANT: this function should NOT be called for solid meshes.

◆ nodeAdjacentNodes()

virtual void GmCellMeshTopology::nodeAdjacentNodes ( int nodeIndex,
QueryOptions options,
QVector< int > & list ) const
pure virtual

Fills list with the set of adjacent nodes to the given node. The result list depends on the given options parameter.

1—10-—2—11-—3 nodeIndex = 5: | | | options = STAR - Returns {2, 4, 8, 6} 12 22 13 23 14 options = QSTAR - Returns {13, 15, 18, 16} | | | 4—15-—5—16-—6 nodeIndex = 15: | | | options = STAR or QSTAR - Returns {4, 5} 17 24 18 25 19 | | | nodeIndex = 22: 7—20-—8—21-—9 options = STAR or QSTART - Returns {}


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