private void _DeleteElement(IHEMeshNode element, IList list) { if (element.IsDeleted) { return; } var id = element.ID; Debugs.CheckRange(id, 0, list.Count); var v = list[id]; if (v != element) { throw new InvalidOperationException("The element is not belong to this mesh!"); } var lastID = list.Count - 1; if (id != lastID) { var last = list[lastID] as IHEMeshNode; last.ID = id; list[id] = last; } list.RemoveAt(lastID); element.Dispose(); }
public Vector3D GetFaceNormal(int fid) { Debugs.CheckRange(fid, 0, FaceCount); if (HasFaceNormals) { return(_facesNormals[fid]); } throw new InvalidOperationException("Please call UpdateFaceNormals() method before invoke GetNormal() method!"); }
public Vector3D GetVertexNormal(int vid) { Debugs.CheckRange(vid, 0, VertexCount); if (HasVerticeNormals) { return(_verticeNormals[vid]); } throw new InvalidOperationException("Please call UpdateVerticeNormals() method before invoke GetNormal() method!"); }
public HEFace GetFace(int fid) { Debugs.CheckRange(fid, 0, FaceCount); return(_faces[fid]); }
internal HEEdge GetHEdge(int eid) { Debugs.CheckRange(eid, 0, HEdgeCount); return(_hedges[eid]); }
public HEdge GetEdge(int eid) { Debugs.CheckRange(eid, 0, EdgeCount); return(_edges[eid]); }
public HEVertex GetVertex(int vid) { Debugs.CheckRange(vid, 0, VertexCount); return(_vertices[vid]); }
public Vector3D GetPosition(int vid) { Debugs.CheckRange(vid, 0, VertexCount); return(_vertices[vid].Position); }
public IndexN <int> GetVerticeOfFace(int fid) { Debugs.CheckRange(fid, 0, FaceCount); return(new IndexN <int>(_faces[fid].GetVertice().Select(v => v.ID))); }
public void DeleteVertex(int vid) { Debugs.CheckRange(vid, 0, VertexCount); DeleteVertex(_vertices[vid]); }
internal HEdge AddEdge(int vid1, int vid2) { Debugs.CheckRange(vid1, 0, VertexCount); Debugs.CheckRange(vid2, 0, VertexCount); return(AddEdge(_vertices[vid1], _vertices[vid2])); }
public bool IsConnected(int vid1, int vid2) { Debugs.CheckRange(vid1, 0, VertexCount); Debugs.CheckRange(vid2, 0, VertexCount); return(IsConnected(_vertices[vid1], _vertices[vid2])); }
public HEdge EdgeBetween(int vid1, int vid2) { Debugs.CheckRange(vid1, 0, VertexCount); Debugs.CheckRange(vid2, 0, VertexCount); return(EdgeBetween(_vertices[vid1], _vertices[vid2])); }
public IndexN <int> GetNeighborFaceOfFace(int fid) { Debugs.CheckRange(fid, 0, FaceCount); return(new IndexN <int>(_faces[fid].GetAdjacentFaces().Select(f => f.ID))); }
public IndexN <int> GetEdgesOfFace(int fid) { Debugs.CheckRange(fid, 0, FaceCount); return(new IndexN <int>(_faces[fid].GetEdges().Select(edge => edge.ID))); }
public IndexN <int> GetNeighborVerticeOfVertex(int vid) { Debugs.CheckRange(vid, 0, VertexCount); return(new IndexN <int>(_vertices[vid].GetAdjacentVertice().Select(v => v.ID))); }