Exemple #1
0
        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();
        }
Exemple #2
0
 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!");
 }
Exemple #3
0
 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!");
 }
Exemple #4
0
 public HEFace GetFace(int fid)
 {
     Debugs.CheckRange(fid, 0, FaceCount);
     return(_faces[fid]);
 }
Exemple #5
0
 internal HEEdge GetHEdge(int eid)
 {
     Debugs.CheckRange(eid, 0, HEdgeCount);
     return(_hedges[eid]);
 }
Exemple #6
0
 public HEdge GetEdge(int eid)
 {
     Debugs.CheckRange(eid, 0, EdgeCount);
     return(_edges[eid]);
 }
Exemple #7
0
 public HEVertex GetVertex(int vid)
 {
     Debugs.CheckRange(vid, 0, VertexCount);
     return(_vertices[vid]);
 }
Exemple #8
0
 public Vector3D GetPosition(int vid)
 {
     Debugs.CheckRange(vid, 0, VertexCount);
     return(_vertices[vid].Position);
 }
Exemple #9
0
 public IndexN <int> GetVerticeOfFace(int fid)
 {
     Debugs.CheckRange(fid, 0, FaceCount);
     return(new IndexN <int>(_faces[fid].GetVertice().Select(v => v.ID)));
 }
Exemple #10
0
 public void DeleteVertex(int vid)
 {
     Debugs.CheckRange(vid, 0, VertexCount);
     DeleteVertex(_vertices[vid]);
 }
Exemple #11
0
 internal HEdge AddEdge(int vid1, int vid2)
 {
     Debugs.CheckRange(vid1, 0, VertexCount);
     Debugs.CheckRange(vid2, 0, VertexCount);
     return(AddEdge(_vertices[vid1], _vertices[vid2]));
 }
Exemple #12
0
 public bool IsConnected(int vid1, int vid2)
 {
     Debugs.CheckRange(vid1, 0, VertexCount);
     Debugs.CheckRange(vid2, 0, VertexCount);
     return(IsConnected(_vertices[vid1], _vertices[vid2]));
 }
Exemple #13
0
 public HEdge EdgeBetween(int vid1, int vid2)
 {
     Debugs.CheckRange(vid1, 0, VertexCount);
     Debugs.CheckRange(vid2, 0, VertexCount);
     return(EdgeBetween(_vertices[vid1], _vertices[vid2]));
 }
Exemple #14
0
 public IndexN <int> GetNeighborFaceOfFace(int fid)
 {
     Debugs.CheckRange(fid, 0, FaceCount);
     return(new IndexN <int>(_faces[fid].GetAdjacentFaces().Select(f => f.ID)));
 }
Exemple #15
0
 public IndexN <int> GetEdgesOfFace(int fid)
 {
     Debugs.CheckRange(fid, 0, FaceCount);
     return(new IndexN <int>(_faces[fid].GetEdges().Select(edge => edge.ID)));
 }
Exemple #16
0
 public IndexN <int> GetNeighborVerticeOfVertex(int vid)
 {
     Debugs.CheckRange(vid, 0, VertexCount);
     return(new IndexN <int>(_vertices[vid].GetAdjacentVertice().Select(v => v.ID)));
 }