Пример #1
0
            /// <summary>
            /// Looks for a possibly adjusted vertex value in the current set.
            /// </summary>
            /// <param name="vertex">The original vertex value.</param>
            /// <returns>The possibly adjusted vertex value.</returns>
            public XYZ FindOrAdd(XYZ vertex)
            {
                XYZ adjustedVertex = null;

                if (!VertexSet.TryGetValue(vertex, out adjustedVertex))
                {
                    adjustedVertex = vertex;
                    VertexSet.Add(adjustedVertex);
                }
                return(adjustedVertex);
            }
Пример #2
0
 public void AddVertex(Vertex vertex)
 {
     foreach (Vertex v in VertexSet)
     {
         if (v.Equals(vertex))
         {
             throw new ArgumentException("Vertices must have unique ids.");
         }
     }
     VertexSet.Add(vertex);
 }