Ejemplo n.º 1
0
//C++ TO C# CONVERTER WARNING: The original C++ declaration of the following method implementation was not found:
        public void DeleteFace(int fi)
        {
            nff--;

            for (int i = 1; i <= faces.Get(fi).Face().GetNP(); i++)
            {
                PointIndex pi = faces.Get(fi).Face().PNum(i);
                points[pi].RemoveFace();
                if (!points[pi].Valid())
                {
                    delpointl.Append(pi);
                }
            }

            MiniElement2d face = faces.Get(fi).Face();
            Point3d       p1   = points[face.PNum(1)].P();
            Point3d       p2   = points[face.PNum(2)].P();
            Point3d       p3   = points[face.PNum(3)].P();

            vol -= 1.0 / 6.0 * (p1.X() + p2.X() + p3.X()) * ((p2.Y() - p1.Y()) * (p3.Z() - p1.Z()) - (p2.Z() - p1.Z()) * (p3.Y() - p1.Y()));

            if (face.GetNP() == 4)
            {
                Point3d p4 = points[face.PNum(4)].P();
                vol -= 1.0 / 6.0 * (p1.X() + p3.X() + p4.X()) * ((p3.Y() - p1.Y()) * (p4.Z() - p1.Z()) - (p3.Z() - p1.Z()) * (p4.Y() - p1.Y()));

                nff4--;
            }

            faces.Elem(fi).Invalidate();
        }