public static VertexType ClassifyVertex(ECVertex v) { int count = 0; for (int i = 0; i < v.AdjEdges.Count; i++) { if (ECEdge.ClassifyEdge(v.AdjEdges[i]) == EdgeType.BORDER) { count++; } } if (count == v.AdjEdges.Count) { return(VertexType.BORDER_ONLY); } else if (count == 0) { return(VertexType.INTERIOR); } else if (count > 0) { return(VertexType.BORDER); } return(VertexType.BORDER_ONLY); }
public void InitTypes() { for (int i = 0; i < Vertices.Count; i++) { VertexType type = ECVertex.ClassifyVertex(Vertices[i]); Vertices[i].Type = type; } for (int i = 0; i < Edges.Count; i++) { EdgeType type = ECEdge.ClassifyEdge(Edges[i]); Edges[i].Type = type; } }