Class MeshEdgeSet

java.lang.Object
mgui.geometry.mesh.MeshEdgeSet

public class MeshEdgeSet
extends java.lang.Object
Represents a mesh in terms of triangles and edges. For purposes of subdivision it is desirable to have an edge with reference to its adjacent triangles, and a triangle with reference to its edges. MeshEdgeSet has two arrays: of MeshEdge objects and MeshTriangle objects.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Summary

    Fields
    Modifier and Type Field Description
    java.util.ArrayList<MeshEdge> edges  
    Mesh3D mesh  
    java.util.ArrayList<MeshTriangle> triangles  
  • Constructor Summary

    Constructors
    Constructor Description
    MeshEdgeSet​(Mesh3D mesh3d)  
  • Method Summary

    Modifier and Type Method Description
    void addEdge​(MeshEdge e)  
    MeshEdge getEdge​(int i)  
    int getEdgeIndex​(int n1, int n2)
    Returns the index of the edge connecting n1 and n2.
    java.util.ArrayList<MeshEdge> getEdges()  
    MeshEdge[] getEdges​(int faceIndex, int triIndex)  
    MeshTriangle getEdgeTri​(int i, int edge)
    Returns the ith triangle index associated with this edge.
    int getFaceIndex​(int tri_idx)
    Returns the face index (i.e., in the source mesh) of the triangle at tri_idx.
    int getOppositeFaceIndex​(int edge_idx, int face_idx)
    Get the face index (i.e., in the source mesh) of the triangle opposite to triangle at face_idx, which is joined at edge.
    int getOppositeNode​(int edge_index, int tri_index)
    Get the vertex index (i.e., in the source mesh) of the vertex opposite to triangle at tri_index, which is joined at edge.
    int getOppositeNode​(MeshEdge edge, MeshTriangle triangle)
    Get the vertex index (i.e., in the source mesh) of the vertex opposite to triangle, which is joined at edge.
    MeshTriangle getOppositeTri​(int edge_idx, int face_idx)
    Get the triangle opposite to triangle at face_idx, which is joined at edge.
    MeshTriangle getOppositeTri​(MeshEdge edge, MeshTriangle face)
    Get the triangle opposite to face, which is joined at edge.
    int getOppositeTriIndex​(int edge_idx, int face_idx)
    Get the triangle index (i.e., in this set) of the triangle opposite to triangle at face_idx, which is joined at edge.
    int searchEdge​(MeshEdge e)
    Finds the specified edge in this set
    void setMesh​(Mesh3D mesh3d)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • edges

      public java.util.ArrayList<MeshEdge> edges
    • triangles

      public java.util.ArrayList<MeshTriangle> triangles
    • mesh

      public Mesh3D mesh
  • Constructor Details

    • MeshEdgeSet

      public MeshEdgeSet​(Mesh3D mesh3d)
  • Method Details

    • setMesh

      public void setMesh​(Mesh3D mesh3d)
    • getEdges

      public java.util.ArrayList<MeshEdge> getEdges()
    • getEdges

      public MeshEdge[] getEdges​(int faceIndex, int triIndex)
    • searchEdge

      public int searchEdge​(MeshEdge e)
      Finds the specified edge in this set
      Parameters:
      e -
      Returns:
    • getEdgeIndex

      public int getEdgeIndex​(int n1, int n2)
      Returns the index of the edge connecting n1 and n2.
      Parameters:
      n1 -
      n2 -
      Returns:
    • addEdge

      public void addEdge​(MeshEdge e)
    • getEdge

      public MeshEdge getEdge​(int i)
    • getEdgeTri

      public MeshTriangle getEdgeTri​(int i, int edge)
      Returns the ith triangle index associated with this edge.
      Parameters:
      i -
      edge -
      Returns:
    • getOppositeTri

      public MeshTriangle getOppositeTri​(MeshEdge edge, MeshTriangle face)
      Get the triangle opposite to face, which is joined at edge.
      Parameters:
      e -
      t -
      Returns:
    • getOppositeTri

      public MeshTriangle getOppositeTri​(int edge_idx, int face_idx)
      Get the triangle opposite to triangle at face_idx, which is joined at edge.
      Parameters:
      e -
      t -
      Returns:
    • getOppositeFaceIndex

      public int getOppositeFaceIndex​(int edge_idx, int face_idx)
      Get the face index (i.e., in the source mesh) of the triangle opposite to triangle at face_idx, which is joined at edge.
      Parameters:
      e -
      t -
      Returns:
    • getOppositeTriIndex

      public int getOppositeTriIndex​(int edge_idx, int face_idx)
      Get the triangle index (i.e., in this set) of the triangle opposite to triangle at face_idx, which is joined at edge.
      Parameters:
      edge_idx -
      face_idx -
      Returns:
    • getFaceIndex

      public int getFaceIndex​(int tri_idx)
      Returns the face index (i.e., in the source mesh) of the triangle at tri_idx.
      Parameters:
      tri_idx -
      Returns:
    • getOppositeNode

      public int getOppositeNode​(MeshEdge edge, MeshTriangle triangle)
      Get the vertex index (i.e., in the source mesh) of the vertex opposite to triangle, which is joined at edge.
      Parameters:
      edge -
      triangle -
      Returns:
    • getOppositeNode

      public int getOppositeNode​(int edge_index, int tri_index)
      Get the vertex index (i.e., in the source mesh) of the vertex opposite to triangle at tri_index, which is joined at edge.
      Parameters:
      edge -
      triangle -
      Returns: