public void Set(HBVertex vertex, HBFace face, HBEdge previous, HBEdge next, HBEdge opposite) { Vertex = vertex; Face = face; Previous = previous; Next = next; Opposite = opposite; }
public int IndexOf(HBFace face) { FACE f = face as FACE; if (f == null) { return(-1); } return(Faces.IndexOf(f)); }
private bool SetOppositeEdge(HBEdge edge, HBFace neighbor) { if (neighbor == null) { return(false); } if (edge == null) { throw new NullReferenceException("Edge is null."); } if (edge.Vertex == null) { throw new NullReferenceException("Edge has null vertex."); } if (neighbor.Edge == null) { throw new NullReferenceException("Neighbor has null edge."); } var v0 = edge.Vertex; var v1 = edge.Previous.Vertex; foreach (var nedge in neighbor.Edge.EnumerateEdges()) { if (nedge.Vertex == null) { throw new NullReferenceException("Neighbor edge has null vertex."); } if (ReferenceEquals(v0, nedge.Previous.Vertex) && ReferenceEquals(v1, nedge.Vertex)) { edge.Opposite = nedge; nedge.Opposite = edge; return(true); } } return(false); }
public HBEdge(HBVertex vertex, HBFace face, HBEdge previous, HBEdge next, HBEdge opposite) { Set(vertex, face, previous, next, opposite); }