Back

BaseMeshTopology

The `BaseMeshTopology` is an abstract base class in Sofa (Simulation Open Framework Architecture) used to represent the topological structure of 3D geometric meshes for simulation purposes.

abstract
`BaseMeshTopology` represents the topological structure of 3D geometric meshes in SOFA, providing methods for adding and querying points, edges, triangles, quads, tetrahedra, and hexahedra.
sheet
# BaseMeshTopology ## Overview `BaseMeshTopology` is an abstract base class that represents the topological structure of 3D geometric meshes in SOFA. It provides methods for adding and querying various mesh elements such as points (vertices), edges, triangles, quads, tetrahedra, and hexahedra. ## Mathematical Model The `BaseMeshTopology` class defines the mathematical representation of topological entities within a 3D geometric mesh: ### Points (Vertices) - **Representation**: A point is represented by three scalar values \\( (px, py, pz) \\), where each coordinate can be considered as an element in \\( \mathbb{R}^3 \\). - **Addition**: The method `addPoint(SReal px, SReal py, SReal pz)` adds a new vertex to the mesh with coordinates \\( (px, py, pz) \\). Mathematically, this operation updates the set of vertices \\( V \), where each vertex can be represented as a vector in \\( \mathbb{R}^3 \\). ### Edges - **Representation**: An edge is defined by two points (vertices). Each point has an index uniquely identifying it, and edges are used to define connections between vertices. - **Addition**: The method `addEdge(Index p1, Index p2)` adds an edge connecting vertex \\( p1 \\) to vertex \\( p2 \\). Mathematically, this operation updates the set of edges \\( E \), where each edge can be represented as a pair \\( (p1, p2) \in V^2 \\). ### Triangles (Faces) - **Representation**: A triangle is defined by three points. Each point has an index and the triangle represents a triangular face in the mesh. - **Addition**: The method `addTriangle(Index p1, Index p2, Index p3)` adds a new triangle to the mesh, where \\( (p1, p2, p3) \\ are indices of vertices that form this triangle. Mathematically, each triangle can be represented as an ordered set \\( \{p1, p2, p3\} \in V^3 \\). ### Quads (Faces) - **Representation**: A quad is defined by four points forming a planar quadrilateral. - **Addition**: The method `addQuad(Index p1, Index p2, Index p3, Index p4)` adds a new quad to the mesh. Mathematically, this operation updates the set of quads \\( Q \), where each quad can be represented as an ordered set \\( \{p1, p2, p3, p4\} \in V^4 \\). ### Tetrahedra (Volumes) - **Representation**: A tetrahedron is defined by four points forming a solid in 3D space. - **Addition**: The method `addTetra(Index p1, Index p2, Index p3, Index p4)` adds a new tetrahedron to the mesh. Mathematically, each tetrahedron can be represented as an ordered set \\( \{p1, p2, p3, p4\} \in V^4 \\). ### Hexahedra (Volumes) - **Representation**: A hexahedron is defined by eight points forming a solid in 3D space. - **Addition**: The method `addHexa(Index p1, Index p2, Index p3, Index p4, Index p5, Index p6, Index p7, Index p8)` adds a new hexahedron to the mesh. Mathematically, each hexahedron can be represented as an ordered set \\( \{p1, p2, p3, p4, p5, p6, p7, p8\} \in V^8 \\). ### Mesh Topology Operations - **Querying**: Various methods are provided to query the mesh topology. For example, `getEdgeIndex(PointID a, PointID b)` returns the index of an edge connecting vertices \\( a \\ and \\( b \\). Similarly, there are methods for triangles (`getTriangleIndex`), quads (`getQuadIndex`), tetrahedra (`getTetrahedronIndex`), and hexahedra (`getHexahedronIndex`). - **Orientation**: The method `reOrientateTriangle(TriangleID id)` can be used to reorient a triangle, which is useful for ensuring consistent surface normals in the mesh. ### State Changes The class provides methods like `beginChange()`, `endChange()`, `beginStateChange()`, and `endStateChange()` to manage state changes within the topology. These methods are typically used during simulation steps where the mesh might undergo deformations or topological modifications.
name
Sofa Component: BaseMeshTopology
description
The `BaseMeshTopology` is an abstract base class in Sofa (Simulation Open Framework Architecture) used to represent the topological structure of 3D geometric meshes for simulation purposes.
parameters
  • {'name': 'filename', 'type': 'string', 'default_value': '', 'description': "The path to a file that contains mesh data in a format supported by Sofa's `MeshTopologyLoader`. If set, the topology will be loaded from this file during initialization."}
functions
  • {'name': 'load(filename)', 'parameters': ['filename'], 'return_type': 'bool', 'description': 'Loads mesh data from a specified file into the `BaseMeshTopology`. It clears any existing topology before loading new data. Returns true if successful, false otherwise.'}
  • {'name': 'clear()', 'parameters': [], 'return_type': 'void', 'description': 'Clears all stored topological information from the structure.'}
  • {'name': 'addPoint(x,y,z)', 'parameters': ['x', 'y', 'z'], 'return_type': 'void', 'description': 'Adds a new vertex to the mesh with coordinates (x, y, z).'}
  • {'name': 'addEdge(p1,p2)', 'parameters': ['p1', 'p2'], 'return_type': 'void', 'description': 'Creates an edge between two existing vertices p1 and p2.'}
  • {'name': 'addTriangle(p1,p2,p3)', 'parameters': ['p1', 'p2', 'p3'], 'return_type': 'void', 'description': 'Defines a triangle using three existing vertices p1, p2, and p3.'}
  • {'name': 'addQuad(p1,p2,p3,p4)', 'parameters': ['p1', 'p2', 'p3', 'p4'], 'return_type': 'void', 'description': 'Creates a quadrilateral surface using four vertices p1, p2, p3, and p4.'}
  • {'name': 'addTetra(p1,p2,p3,p4)', 'parameters': ['p1', 'p2', 'p3', 'p4'], 'return_type': 'void', 'description': 'Adds a tetrahedron element using four vertices p1, p2, p3 and p4.'}
  • {'name': 'addHexa(p1,p2,p3,p4,p5,p6,p7,p8)', 'parameters': ['p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8'], 'return_type': 'void', 'description': 'Creates a hexahedral element using eight vertices p1 to p8.'}
  • {'name': 'getEdgeIndex(p1,p2)', 'parameters': ['p1', 'p2'], 'return_type': 'Topology::EdgeID', 'description': 'Retrieves the index of an edge defined by two points, p1 and p2.'}
  • {'name': 'getTriangleIndex(p1,p2,p3)', 'parameters': ['p1', 'p2', 'p3'], 'return_type': 'Topology::TriangleID', 'description': 'Returns the index of a triangle defined by three points, p1 to p3.'}
  • {'name': 'getQuadIndex(p1,p2,p3,p4)', 'parameters': ['p1', 'p2', 'p3', 'p4'], 'return_type': 'Topology::QuadID', 'description': 'Obtains the index of a quad defined by four points, p1 to p4.'}
  • {'name': 'getTetrahedronIndex(p1,p2,p3,p4)', 'parameters': ['p1', 'p2', 'p3', 'p4'], 'return_type': 'Topology::TetrahedronID', 'description': 'Finds the index of a tetrahedron defined by four points, p1 to p4.'}
  • {'name': 'getHexahedronIndex(p1,p2,p3,p4,p5,p6,p7,p8)', 'parameters': ['p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8'], 'return_type': 'Topology::HexahedronID', 'description': 'Retrieves the index of a hexahedral element defined by eight points, p1 to p8.'}
events
  • {'name': 'beginChange()', 'description': 'Returns an iterator pointing to the beginning of a list of changes made to the topology.', 'type': 'std::list<const TopologyChange *>::const_iterator'}
  • {'name': 'endChange()', 'description': 'Returns an iterator pointing to one past the end of the list of changes.', 'type': 'std::list<const TopologyChange *>::const_iterator'}
notes
  • The `BaseMeshTopology` class provides functionality for loading, adding and managing topological elements such as points (vertices), edges, triangles, quads, tetrahedra, and hexahedra. It is abstract and meant to be subclassed in order to provide concrete implementations of its methods.
examples
  • To load a mesh from a file at initialization: ``` clear(); load("mesh.obj"); ```
maths
The `BaseMeshTopology` class in Sofa (Simulation Open Framework Architecture) is an abstract base class that represents the topological structure of 3D geometric meshes used for simulation purposes. It provides a framework to define, manipulate and query topological entities such as vertices (points), edges, faces (triangles or quads), tetrahedra, and hexahedra. Below are detailed mathematical descriptions of key functionalities related to mesh topology in this class: ### Points (Vertices) - **Representation**: A point is a 3D coordinate represented by three scalar values `(px, py, pz)`, where `SReal` can be considered as `float` or `double`. - **Addition**: The method `addPoint(SReal px, SReal py, SReal pz)` adds a new vertex to the mesh with coordinates `(px, py, pz)`. Mathematically, this operation updates the set of vertices \(V\), where each vertex can be represented as a vector in \( extbf{R}^3\). ### Edges - **Representation**: An edge is defined by two points (vertices). Each point is indexed uniquely and edges are used to define connections between vertices. - **Addition**: The method `addEdge(Index p1, Index p2)` adds an edge connecting vertex `p1` to vertex `p2`. Mathematically, this operation updates the set of edges \(E\), where each edge can be represented as a pair `(p1, p2) \in V^2\). ### Triangles (Faces) - **Representation**: A triangle is defined by three points. Each point has an index and the triangle represents a triangular face in the mesh. - **Addition**: The method `addTriangle(Index p1, Index p2, Index p3)` adds a new triangle to the mesh, where `(p1, p2, p3)` are indices of vertices that form this triangle. Mathematically, each triangle can be represented as an ordered set \(\{p1, p2, p3\} \in V^3\). ### Quads (Faces) - **Representation**: A quad is defined by four points forming a planar quadrilateral. - **Addition**: The method `addQuad(Index p1, Index p2, Index p3, Index p4)` adds a new quad to the mesh. Mathematically, this operation updates the set of quads \(Q\), where each quad can be represented as an ordered set \(\{p1, p2, p3, p4\} \in V^4\). ### Tetrahedra (Volumes) - **Representation**: A tetrahedron is defined by four points forming a solid in 3D space. - **Addition**: The method `addTetra(Index p1, Index p2, Index p3, Index p4)` adds a new tetrahedron to the mesh. Mathematically, each tetrahedron can be represented as an ordered set \(\{p1, p2, p3, p4\} \in V^4\). ### Hexahedra (Volumes) - **Representation**: A hexahedron is defined by eight points forming a solid in 3D space. - **Addition**: The method `addHexa(Index p1, Index p2, Index p3, Index p4, Index p5, Index p6, Index p7, Index p8)` adds a new hexahedron to the mesh. Mathematically, each hexahedron can be represented as an ordered set \(\{p1, p2, p3, p4, p5, p6, p7, p8\} \in V^8\). ### Mesh Topology Operations - **Querying**: Various methods are provided to query the mesh topology. For example, `getEdgeIndex(PointID a, PointID b)` returns the index of an edge connecting vertices `a` and `b`. Similarly, there are methods for triangles (`getTriangleIndex`), quads (`getQuadIndex`), tetrahedra (`getTetrahedronIndex`), and hexahedra (`getHexahedronIndex`). - **Orientation**: The method `reOrientateTriangle(TriangleID id)` can be used to reorient a triangle, which is useful for ensuring consistent surface normals in the mesh. ### State Changes The class provides methods like `beginChange()`, `endChange()`, `beginStateChange()`, and `endStateChange()` to manage state changes within the topology. These methods are typically used during simulation steps where the mesh might undergo deformations or topological modifications. ### Abstract Nature and Inheritance `BaseMeshTopology` is an abstract class, meaning that specific implementations must derive from it and provide concrete definitions for its methods. The inherited classes may represent different types of meshes (e.g., tetrahedral or hexahedral) with more specialized functionalities.
{
  "name": "BaseMeshTopology",
  "main": {
    "name": "BaseMeshTopology",
    "namespace": "sofa::core::topology",
    "module": "Sofa.framework.Core",
    "include": "sofa/core/topology/BaseMeshTopology.h",
    "doc": "",
    "inherits": [
      "Topology"
    ],
    "templates": [],
    "data_fields": [],
    "links": [],
    "methods": [
      {
        "name": "toBaseMeshTopology",
        "return_type": "const BaseMeshTopology *",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "init",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "computeCrossElementBuffers",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "load",
        "return_type": "bool",
        "params": [
          {
            "name": "filename",
            "type": "const char *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getFilename",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdges",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTriangles",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuads",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetrahedra",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedra",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPrisms",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPyramids",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbEdges",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbTriangles",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbQuads",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbTetrahedra",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbHexahedra",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbPrisms",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbPyramids",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdge",
        "return_type": "const Edge",
        "params": [
          {
            "name": "i",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTriangle",
        "return_type": "const Triangle",
        "params": [
          {
            "name": "i",
            "type": "TriangleID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuad",
        "return_type": "const Quad",
        "params": [
          {
            "name": "i",
            "type": "QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetrahedron",
        "return_type": "const Tetra",
        "params": [
          {
            "name": "i",
            "type": "TetraID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedron",
        "return_type": "const Hexa",
        "params": [
          {
            "name": "i",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPrism",
        "return_type": "const Prism",
        "params": [
          {
            "name": "i",
            "type": "PrismID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPyramid",
        "return_type": "const Pyramid",
        "params": [
          {
            "name": "i",
            "type": "PyramidID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTopologyType",
        "return_type": "sofa::geometry::ElementType",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": true,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbTetras",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbHexas",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetra",
        "return_type": "Tetra",
        "params": [
          {
            "name": "i",
            "type": "TetraID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexa",
        "return_type": "Hexa",
        "params": [
          {
            "name": "i",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetras",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexas",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesAroundVertex",
        "return_type": "const EdgesAroundVertex &",
        "params": [
          {
            "name": "i",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesInTriangle",
        "return_type": "const EdgesInTriangle &",
        "params": [
          {
            "name": "i",
            "type": "TriangleID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesInQuad",
        "return_type": "const EdgesInQuad &",
        "params": [
          {
            "name": "i",
            "type": "QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesInTetrahedron",
        "return_type": "const EdgesInTetrahedron &",
        "params": [
          {
            "name": "i",
            "type": "TetraID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesInHexahedron",
        "return_type": "const EdgesInHexahedron &",
        "params": [
          {
            "name": "i",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTrianglesAroundVertex",
        "return_type": "const TrianglesAroundVertex &",
        "params": [
          {
            "name": "i",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTrianglesAroundEdge",
        "return_type": "const TrianglesAroundEdge &",
        "params": [
          {
            "name": "i",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTrianglesInTetrahedron",
        "return_type": "const TrianglesInTetrahedron &",
        "params": [
          {
            "name": "i",
            "type": "TetraID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadsAroundVertex",
        "return_type": "const QuadsAroundVertex &",
        "params": [
          {
            "name": "i",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadsAroundEdge",
        "return_type": "const QuadsAroundEdge &",
        "params": [
          {
            "name": "i",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadsInHexahedron",
        "return_type": "const QuadsInHexahedron &",
        "params": [
          {
            "name": "i",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetrahedraAroundVertex",
        "return_type": "const TetrahedraAroundVertex &",
        "params": [
          {
            "name": "i",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetrahedraAroundEdge",
        "return_type": "const TetrahedraAroundEdge &",
        "params": [
          {
            "name": "i",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetrahedraAroundTriangle",
        "return_type": "const TetrahedraAroundTriangle &",
        "params": [
          {
            "name": "i",
            "type": "TriangleID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundVertex",
        "return_type": "const HexahedraAroundVertex &",
        "params": [
          {
            "name": "i",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundEdge",
        "return_type": "const HexahedraAroundEdge &",
        "params": [
          {
            "name": "i",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundQuad",
        "return_type": "const HexahedraAroundQuad &",
        "params": [
          {
            "name": "i",
            "type": "QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getVerticesAroundVertex",
        "return_type": "const VerticesAroundVertex",
        "params": [
          {
            "name": "i",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getElementAroundElement",
        "return_type": "const int",
        "params": [
          {
            "name": "elem",
            "type": "Index"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getElementAroundElements",
        "return_type": "const int",
        "params": [
          {
            "name": "elems",
            "type": "int"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgeIndex",
        "return_type": "EdgeID",
        "params": [
          {
            "name": "v1",
            "type": "PointID"
          },
          {
            "name": "v2",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTriangleIndex",
        "return_type": "TriangleID",
        "params": [
          {
            "name": "v1",
            "type": "PointID"
          },
          {
            "name": "v2",
            "type": "PointID"
          },
          {
            "name": "v3",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadIndex",
        "return_type": "QuadID",
        "params": [
          {
            "name": "v1",
            "type": "PointID"
          },
          {
            "name": "v2",
            "type": "PointID"
          },
          {
            "name": "v3",
            "type": "PointID"
          },
          {
            "name": "v4",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTetrahedronIndex",
        "return_type": "TetrahedronID",
        "params": [
          {
            "name": "v1",
            "type": "PointID"
          },
          {
            "name": "v2",
            "type": "PointID"
          },
          {
            "name": "v3",
            "type": "PointID"
          },
          {
            "name": "v4",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedronIndex",
        "return_type": "HexahedronID",
        "params": [
          {
            "name": "v1",
            "type": "PointID"
          },
          {
            "name": "v2",
            "type": "PointID"
          },
          {
            "name": "v3",
            "type": "PointID"
          },
          {
            "name": "v4",
            "type": "PointID"
          },
          {
            "name": "v5",
            "type": "PointID"
          },
          {
            "name": "v6",
            "type": "PointID"
          },
          {
            "name": "v7",
            "type": "PointID"
          },
          {
            "name": "v8",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getVertexIndexInTriangle",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const Triangle &"
          },
          {
            "name": "vertexIndex",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgeIndexInTriangle",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const EdgesInTriangle &"
          },
          {
            "name": "edgeIndex",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getVertexIndexInQuad",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const Quad &"
          },
          {
            "name": "vertexIndex",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgeIndexInQuad",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const EdgesInQuad &"
          },
          {
            "name": "edgeIndex",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getVertexIndexInTetrahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const Tetra &"
          },
          {
            "name": "vertexIndex",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgeIndexInTetrahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const EdgesInTetrahedron &"
          },
          {
            "name": "edgeIndex",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTriangleIndexInTetrahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const TrianglesInTetrahedron &"
          },
          {
            "name": "triangleIndex",
            "type": "TriangleID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getVertexIndexInHexahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const Hexa &"
          },
          {
            "name": "vertexIndex",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgeIndexInHexahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const EdgesInHexahedron &"
          },
          {
            "name": "edgeIndex",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadIndexInHexahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const QuadsInHexahedron &"
          },
          {
            "name": "quadIndex",
            "type": "QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalEdgesInTetrahedron",
        "return_type": "Edge",
        "params": [
          {
            "name": "i",
            "type": "const PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalTrianglesInTetrahedron",
        "return_type": "Triangle",
        "params": [
          {
            "name": "i",
            "type": "const PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalEdgesInHexahedron",
        "return_type": "Edge",
        "params": [
          {
            "name": "i",
            "type": "const PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalQuadsInHexahedron",
        "return_type": "Quad",
        "params": [
          {
            "name": "i",
            "type": "const PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLines",
        "return_type": "const SeqLines &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNbLines",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLine",
        "return_type": "Line",
        "params": [
          {
            "name": "i",
            "type": "LineID"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasPos",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPX",
        "return_type": "SReal",
        "params": [
          {
            "name": "",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPY",
        "return_type": "SReal",
        "params": [
          {
            "name": "",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPZ",
        "return_type": "SReal",
        "params": [
          {
            "name": "",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "clear",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addPoint",
        "return_type": "void",
        "params": [
          {
            "name": "px",
            "type": "SReal"
          },
          {
            "name": "py",
            "type": "SReal"
          },
          {
            "name": "pz",
            "type": "SReal"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addEdge",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addLine",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addTriangle",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          },
          {
            "name": "c",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addQuad",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          },
          {
            "name": "c",
            "type": "Index"
          },
          {
            "name": "d",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addTetra",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          },
          {
            "name": "c",
            "type": "Index"
          },
          {
            "name": "d",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addHexa",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          },
          {
            "name": "c",
            "type": "Index"
          },
          {
            "name": "d",
            "type": "Index"
          },
          {
            "name": "e",
            "type": "Index"
          },
          {
            "name": "f",
            "type": "Index"
          },
          {
            "name": "g",
            "type": "Index"
          },
          {
            "name": "h",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "checkConnexity",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "checkTopology",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNumberOfConnectedComponent",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getConnectedElement",
        "return_type": "const int",
        "params": [
          {
            "name": "elem",
            "type": "Index"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getRevision",
        "return_type": "int",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "reOrientateTriangle",
        "return_type": "void",
        "params": [
          {
            "name": "id",
            "type": "TriangleID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTrianglesOnBorder",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesOnBorder",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getPointsOnBorder",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "insertInNode",
        "return_type": "bool",
        "params": [
          {
            "name": "node",
            "type": "objectmodel::BaseNode *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "removeInNode",
        "return_type": "bool",
        "params": [
          {
            "name": "node",
            "type": "objectmodel::BaseNode *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      }
    ]
  },
  "desc": {
    "name": "Sofa Component: BaseMeshTopology",
    "description": "The `BaseMeshTopology` is an abstract base class in Sofa (Simulation Open Framework Architecture) used to represent the topological structure of 3D geometric meshes for simulation purposes.",
    "parameters": [
      {
        "name": "filename",
        "type": "string",
        "default_value": "",
        "description": "The path to a file that contains mesh data in a format supported by Sofa's `MeshTopologyLoader`. If set, the topology will be loaded from this file during initialization."
      }
    ],
    "functions": [
      {
        "name": "load(filename)",
        "parameters": [
          "filename"
        ],
        "return_type": "bool",
        "description": "Loads mesh data from a specified file into the `BaseMeshTopology`. It clears any existing topology before loading new data. Returns true if successful, false otherwise."
      },
      {
        "name": "clear()",
        "parameters": [],
        "return_type": "void",
        "description": "Clears all stored topological information from the structure."
      },
      {
        "name": "addPoint(x,y,z)",
        "parameters": [
          "x",
          "y",
          "z"
        ],
        "return_type": "void",
        "description": "Adds a new vertex to the mesh with coordinates (x, y, z)."
      },
      {
        "name": "addEdge(p1,p2)",
        "parameters": [
          "p1",
          "p2"
        ],
        "return_type": "void",
        "description": "Creates an edge between two existing vertices p1 and p2."
      },
      {
        "name": "addTriangle(p1,p2,p3)",
        "parameters": [
          "p1",
          "p2",
          "p3"
        ],
        "return_type": "void",
        "description": "Defines a triangle using three existing vertices p1, p2, and p3."
      },
      {
        "name": "addQuad(p1,p2,p3,p4)",
        "parameters": [
          "p1",
          "p2",
          "p3",
          "p4"
        ],
        "return_type": "void",
        "description": "Creates a quadrilateral surface using four vertices p1, p2, p3, and p4."
      },
      {
        "name": "addTetra(p1,p2,p3,p4)",
        "parameters": [
          "p1",
          "p2",
          "p3",
          "p4"
        ],
        "return_type": "void",
        "description": "Adds a tetrahedron element using four vertices p1, p2, p3 and p4."
      },
      {
        "name": "addHexa(p1,p2,p3,p4,p5,p6,p7,p8)",
        "parameters": [
          "p1",
          "p2",
          "p3",
          "p4",
          "p5",
          "p6",
          "p7",
          "p8"
        ],
        "return_type": "void",
        "description": "Creates a hexahedral element using eight vertices p1 to p8."
      },
      {
        "name": "getEdgeIndex(p1,p2)",
        "parameters": [
          "p1",
          "p2"
        ],
        "return_type": "Topology::EdgeID",
        "description": "Retrieves the index of an edge defined by two points, p1 and p2."
      },
      {
        "name": "getTriangleIndex(p1,p2,p3)",
        "parameters": [
          "p1",
          "p2",
          "p3"
        ],
        "return_type": "Topology::TriangleID",
        "description": "Returns the index of a triangle defined by three points, p1 to p3."
      },
      {
        "name": "getQuadIndex(p1,p2,p3,p4)",
        "parameters": [
          "p1",
          "p2",
          "p3",
          "p4"
        ],
        "return_type": "Topology::QuadID",
        "description": "Obtains the index of a quad defined by four points, p1 to p4."
      },
      {
        "name": "getTetrahedronIndex(p1,p2,p3,p4)",
        "parameters": [
          "p1",
          "p2",
          "p3",
          "p4"
        ],
        "return_type": "Topology::TetrahedronID",
        "description": "Finds the index of a tetrahedron defined by four points, p1 to p4."
      },
      {
        "name": "getHexahedronIndex(p1,p2,p3,p4,p5,p6,p7,p8)",
        "parameters": [
          "p1",
          "p2",
          "p3",
          "p4",
          "p5",
          "p6",
          "p7",
          "p8"
        ],
        "return_type": "Topology::HexahedronID",
        "description": "Retrieves the index of a hexahedral element defined by eight points, p1 to p8."
      }
    ],
    "events": [
      {
        "name": "beginChange()",
        "description": "Returns an iterator pointing to the beginning of a list of changes made to the topology.",
        "type": "std::list<const TopologyChange *>::const_iterator"
      },
      {
        "name": "endChange()",
        "description": "Returns an iterator pointing to one past the end of the list of changes.",
        "type": "std::list<const TopologyChange *>::const_iterator"
      }
    ],
    "notes": [
      "The `BaseMeshTopology` class provides functionality for loading, adding and managing topological elements such as points (vertices), edges, triangles, quads, tetrahedra, and hexahedra. It is abstract and meant to be subclassed in order to provide concrete implementations of its methods."
    ],
    "examples": [
      "To load a mesh from a file at initialization:\n```\nclear();\nload(\"mesh.obj\");\n```"
    ]
  },
  "maths": {
    "maths": "The `BaseMeshTopology` class in Sofa (Simulation Open Framework Architecture) is an abstract base class that represents the topological structure of 3D geometric meshes used for simulation purposes. It provides a framework to define, manipulate and query topological entities such as vertices (points), edges, faces (triangles or quads), tetrahedra, and hexahedra. Below are detailed mathematical descriptions of key functionalities related to mesh topology in this class:\n\n### Points (Vertices)\n- **Representation**: A point is a 3D coordinate represented by three scalar values `(px, py, pz)`, where `SReal` can be considered as `float` or `double`. \n- **Addition**: The method `addPoint(SReal px, SReal py, SReal pz)` adds a new vertex to the mesh with coordinates `(px, py, pz)`. Mathematically, this operation updates the set of vertices \\(V\\), where each vertex can be represented as a vector in \\(\textbf{R}^3\\).\n\n### Edges\n- **Representation**: An edge is defined by two points (vertices). Each point is indexed uniquely and edges are used to define connections between vertices.\n- **Addition**: The method `addEdge(Index p1, Index p2)` adds an edge connecting vertex `p1` to vertex `p2`. Mathematically, this operation updates the set of edges \\(E\\), where each edge can be represented as a pair `(p1, p2) \\in V^2\\).\n\n### Triangles (Faces)\n- **Representation**: A triangle is defined by three points. Each point has an index and the triangle represents a triangular face in the mesh.\n- **Addition**: The method `addTriangle(Index p1, Index p2, Index p3)` adds a new triangle to the mesh, where `(p1, p2, p3)` are indices of vertices that form this triangle. Mathematically, each triangle can be represented as an ordered set \\(\\{p1, p2, p3\\} \\in V^3\\).\n\n### Quads (Faces)\n- **Representation**: A quad is defined by four points forming a planar quadrilateral.\n- **Addition**: The method `addQuad(Index p1, Index p2, Index p3, Index p4)` adds a new quad to the mesh. Mathematically, this operation updates the set of quads \\(Q\\), where each quad can be represented as an ordered set \\(\\{p1, p2, p3, p4\\} \\in V^4\\).\n\n### Tetrahedra (Volumes)\n- **Representation**: A tetrahedron is defined by four points forming a solid in 3D space.\n- **Addition**: The method `addTetra(Index p1, Index p2, Index p3, Index p4)` adds a new tetrahedron to the mesh. Mathematically, each tetrahedron can be represented as an ordered set \\(\\{p1, p2, p3, p4\\} \\in V^4\\).\n\n### Hexahedra (Volumes)\n- **Representation**: A hexahedron is defined by eight points forming a solid in 3D space.\n- **Addition**: The method `addHexa(Index p1, Index p2, Index p3, Index p4, Index p5, Index p6, Index p7, Index p8)` adds a new hexahedron to the mesh. Mathematically, each hexahedron can be represented as an ordered set \\(\\{p1, p2, p3, p4, p5, p6, p7, p8\\} \\in V^8\\).\n\n### Mesh Topology Operations\n- **Querying**: Various methods are provided to query the mesh topology. For example, `getEdgeIndex(PointID a, PointID b)` returns the index of an edge connecting vertices `a` and `b`. Similarly, there are methods for triangles (`getTriangleIndex`), quads (`getQuadIndex`), tetrahedra (`getTetrahedronIndex`), and hexahedra (`getHexahedronIndex`).\n- **Orientation**: The method `reOrientateTriangle(TriangleID id)` can be used to reorient a triangle, which is useful for ensuring consistent surface normals in the mesh.\n\n### State Changes\nThe class provides methods like `beginChange()`, `endChange()`, `beginStateChange()`, and `endStateChange()` to manage state changes within the topology. These methods are typically used during simulation steps where the mesh might undergo deformations or topological modifications.\n\n### Abstract Nature and Inheritance\n`BaseMeshTopology` is an abstract class, meaning that specific implementations must derive from it and provide concrete definitions for its methods. The inherited classes may represent different types of meshes (e.g., tetrahedral or hexahedral) with more specialized functionalities."
  },
  "summary": {
    "abstract": "`BaseMeshTopology` represents the topological structure of 3D geometric meshes in SOFA, providing methods for adding and querying points, edges, triangles, quads, tetrahedra, and hexahedra.",
    "sheet": "# BaseMeshTopology\n\n## Overview\n`BaseMeshTopology` is an abstract base class that represents the topological structure of 3D geometric meshes in SOFA. It provides methods for adding and querying various mesh elements such as points (vertices), edges, triangles, quads, tetrahedra, and hexahedra.\n\n## Mathematical Model\nThe `BaseMeshTopology` class defines the mathematical representation of topological entities within a 3D geometric mesh:\n\n### Points (Vertices)\n- **Representation**: A point is represented by three scalar values \\\\( (px, py, pz) \\\\), where each coordinate can be considered as an element in \\\\( \\mathbb{R}^3 \\\\).\n- **Addition**: The method `addPoint(SReal px, SReal py, SReal pz)` adds a new vertex to the mesh with coordinates \\\\( (px, py, pz) \\\\). Mathematically, this operation updates the set of vertices \\\\( V \\), where each vertex can be represented as a vector in \\\\( \\mathbb{R}^3 \\\\).\n\n### Edges\n- **Representation**: An edge is defined by two points (vertices). Each point has an index uniquely identifying it, and edges are used to define connections between vertices.\n- **Addition**: The method `addEdge(Index p1, Index p2)` adds an edge connecting vertex \\\\( p1 \\\\) to vertex \\\\( p2 \\\\). Mathematically, this operation updates the set of edges \\\\( E \\), where each edge can be represented as a pair \\\\( (p1, p2) \\in V^2 \\\\).\n\n### Triangles (Faces)\n- **Representation**: A triangle is defined by three points. Each point has an index and the triangle represents a triangular face in the mesh.\n- **Addition**: The method `addTriangle(Index p1, Index p2, Index p3)` adds a new triangle to the mesh, where \\\\( (p1, p2, p3) \\\\ are indices of vertices that form this triangle. Mathematically, each triangle can be represented as an ordered set \\\\( \\{p1, p2, p3\\} \\in V^3 \\\\).\n\n### Quads (Faces)\n- **Representation**: A quad is defined by four points forming a planar quadrilateral.\n- **Addition**: The method `addQuad(Index p1, Index p2, Index p3, Index p4)` adds a new quad to the mesh. Mathematically, this operation updates the set of quads \\\\( Q \\), where each quad can be represented as an ordered set \\\\( \\{p1, p2, p3, p4\\} \\in V^4 \\\\).\n\n### Tetrahedra (Volumes)\n- **Representation**: A tetrahedron is defined by four points forming a solid in 3D space.\n- **Addition**: The method `addTetra(Index p1, Index p2, Index p3, Index p4)` adds a new tetrahedron to the mesh. Mathematically, each tetrahedron can be represented as an ordered set \\\\( \\{p1, p2, p3, p4\\} \\in V^4 \\\\).\n\n### Hexahedra (Volumes)\n- **Representation**: A hexahedron is defined by eight points forming a solid in 3D space.\n- **Addition**: The method `addHexa(Index p1, Index p2, Index p3, Index p4, Index p5, Index p6, Index p7, Index p8)` adds a new hexahedron to the mesh. Mathematically, each hexahedron can be represented as an ordered set \\\\( \\{p1, p2, p3, p4, p5, p6, p7, p8\\} \\in V^8 \\\\).\n\n### Mesh Topology Operations\n- **Querying**: Various methods are provided to query the mesh topology. For example, `getEdgeIndex(PointID a, PointID b)` returns the index of an edge connecting vertices \\\\( a \\\\ and \\\\( b \\\\). Similarly, there are methods for triangles (`getTriangleIndex`), quads (`getQuadIndex`), tetrahedra (`getTetrahedronIndex`), and hexahedra (`getHexahedronIndex`).\n- **Orientation**: The method `reOrientateTriangle(TriangleID id)` can be used to reorient a triangle, which is useful for ensuring consistent surface normals in the mesh.\n\n### State Changes\nThe class provides methods like `beginChange()`, `endChange()`, `beginStateChange()`, and `endStateChange()` to manage state changes within the topology. These methods are typically used during simulation steps where the mesh might undergo deformations or topological modifications."
  }
}