/// <summary> /// Add a new vertex to the end of the Vertex list. /// </summary> /// <param name="tag">The type of vertex tag, such as smooth or corner.</param> /// <param name="vertex">Location of new vertex.</param> /// <returns>The newly added vertex.</returns> /// <exception cref="ArgumentOutOfRangeException">If tag is unset or non-defined.</exception> /// <since>7.0</since> public SubDVertex Add(SubDVertexTag tag, Point3d vertex) { if (!SubD.IsSubDVertexTagDefined(tag)) { throw new ArgumentOutOfRangeException("tag"); } IntPtr ptr_subd = m_subd.NonConstPointer(); uint id = 0; IntPtr ptr_vertex = UnsafeNativeMethods.ON_SubD_AddVertex(ptr_subd, tag, vertex, ref id); if (ptr_vertex != IntPtr.Zero) { return(new SubDVertex(m_subd, ptr_vertex, id)); } return(null); }
internal static bool IsSubDVertexTagDefined(SubDVertexTag tag) { return(tag > SubDVertexTag.Unset && tag <= SubDVertexTag.Dart); }