public TriangleIndexedLinked GetFace(TetrahedronFace face) { switch (face) { case TetrahedronFace.Face_012: return(this.Face_012); case TetrahedronFace.Face_023: return(this.Face_023); case TetrahedronFace.Face_031: return(this.Face_031); case TetrahedronFace.Face_132: return(this.Face_132); default: throw new ApplicationException("Unknown TetrahedronFace: " + face.ToString()); } }
// These let you get at the neighbors with an enum instead of calling the explicit properties public Tetrahedron GetNeighbor(TetrahedronFace face) { switch (face) { case TetrahedronFace.Face_012: return(this.Neighbor_012); case TetrahedronFace.Face_023: return(this.Neighbor_023); case TetrahedronFace.Face_031: return(this.Neighbor_031); case TetrahedronFace.Face_132: return(this.Neighbor_132); default: throw new ApplicationException("Unknown TetrahedronFace: " + face.ToString()); } }
public void SetNeighbor(TetrahedronFace face, Tetrahedron neighbor) { switch (face) { case TetrahedronFace.Face_012: this.Neighbor_012 = neighbor; break; case TetrahedronFace.Face_023: this.Neighbor_023 = neighbor; break; case TetrahedronFace.Face_031: this.Neighbor_031 = neighbor; break; case TetrahedronFace.Face_132: this.Neighbor_132 = neighbor; break; default: throw new ApplicationException("Unknown TetrahedronFace: " + face.ToString()); } }
public TetrahedronEdge GetCommonEdge(TetrahedronFace face0, TetrahedronFace face1) { switch (face0) { case TetrahedronFace.Face_012: switch (face1) { case TetrahedronFace.Face_012: throw new ArgumentException("The two faces can't be identical: " + face0.ToString()); case TetrahedronFace.Face_023: return(TetrahedronEdge.Edge_02); case TetrahedronFace.Face_031: return(TetrahedronEdge.Edge_01); case TetrahedronFace.Face_132: return(TetrahedronEdge.Edge_12); default: throw new ApplicationException("Unknown TetrahedronFace: " + face0.ToString()); } case TetrahedronFace.Face_023: switch (face1) { case TetrahedronFace.Face_023: throw new ArgumentException("The two faces can't be identical: " + face0.ToString()); case TetrahedronFace.Face_012: return(TetrahedronEdge.Edge_02); case TetrahedronFace.Face_031: return(TetrahedronEdge.Edge_03); case TetrahedronFace.Face_132: return(TetrahedronEdge.Edge_23); default: throw new ApplicationException("Unknown TetrahedronFace: " + face0.ToString()); } case TetrahedronFace.Face_031: switch (face1) { case TetrahedronFace.Face_031: throw new ArgumentException("The two faces can't be identical: " + face0.ToString()); case TetrahedronFace.Face_012: return(TetrahedronEdge.Edge_01); case TetrahedronFace.Face_023: return(TetrahedronEdge.Edge_03); case TetrahedronFace.Face_132: return(TetrahedronEdge.Edge_13); default: throw new ApplicationException("Unknown TetrahedronFace: " + face0.ToString()); } case TetrahedronFace.Face_132: switch (face1) { case TetrahedronFace.Face_132: throw new ArgumentException("The two faces can't be identical: " + face0.ToString()); case TetrahedronFace.Face_012: return(TetrahedronEdge.Edge_12); case TetrahedronFace.Face_023: return(TetrahedronEdge.Edge_23); case TetrahedronFace.Face_031: return(TetrahedronEdge.Edge_13); default: throw new ApplicationException("Unknown TetrahedronFace: " + face0.ToString()); } default: throw new ApplicationException("Unknown TetrahedronFace: " + face0.ToString()); } }