CheL2: The level 2 of CHE - Prograf-UFF/che.js GitHub Wiki

This class represents the level 2 of CHE, it stores the a direct reference of each element of a mesh, i.e. sets a half-edge to represent each vertex, and a half-edge to represent each edge.

Attributes

  • _edgeMap: map that stores a half-edge to represent an edge.
  • _tableVertexHalfEdge: Stores the half-edge thar represents each vertex.
  • _nEdges: Stores the amount of edges found in the mesh.
  • _che: References the Che orchestrator class.

Initializers

  • computeEdgeMap()
    • Computes which half-edges represent each edge.
  • computeVertexHalfEdge()
    • Computes which half-edge represents each vertex.

Getters

  • compoundCount: returns the amount of compounds in the mesh

  • getEdgeHalfEdge(heId)

    • returns the edge represented by heId.
  • getVertexHalfEdge(vertexId)

    • returns the half-edge that represents the vertex referenced by vertexId.

Relation methods

The methods that find the star of something related to a vertex benefits from the new info in this level.

  • relation00(vertexId)

    • Returns the index of the vertices in the star of the vertex identified by vertexId.
  • relation02(vertexId)

    • Returns the index of the triangles in the star of the vertex identified by vertexId.

Integrity

  • checkEdgeHalfEdge()
    • Checks if all the edges in the _edgeMap are referenced by valid half edges.
  • checkValidVertexHalfEdge()
    • Checks if all vertex half edges are valid half-edge values.
  • checkVertexfHalfEdgeTable()
    • checks if the amount of elements on the _tableVertexHalfEdge is equal to the amount of vertices in the mesh