Esempio n. 1
0
        public static double GetLength(Polyline3DT polyline, ILineTypeScaler lineTypeScaler)
        {
            double num = 0.0;

            if (polyline.Count > 1)
            {
                Point3D point3D = polyline[0].Position;
                for (int index = 1; index < polyline.Count; ++index)
                {
                    Point3D position = polyline[index].Position;
                    num    += lineTypeScaler.GetScaledLength(position - point3D);
                    point3D = position;
                }
                if (polyline.Closed)
                {
                    num += lineTypeScaler.GetScaledLength(polyline[0].Position - point3D);
                }
            }
            return(num);
        }
Esempio n. 2
0
        public static double GetLength(Polyline2D2N polyline, ILineTypeScaler lineTypeScaler)
        {
            double num = 0.0;

            if (polyline.Count > 1)
            {
                Point2D2N point2D2N1 = polyline[0];
                for (int index = 1; index < polyline.Count; ++index)
                {
                    Point2D2N point2D2N2 = polyline[index];
                    num       += lineTypeScaler.GetScaledLength(point2D2N2.Position - point2D2N1.Position);
                    point2D2N1 = point2D2N2;
                }
                if (polyline.Closed)
                {
                    num += lineTypeScaler.GetScaledLength(polyline[0].Position - point2D2N1.Position);
                }
            }
            return(num);
        }
Esempio n. 3
0
        public static double GetLength(Polyline3D polyline, ILineTypeScaler lineTypeScaler)
        {
            double num = 0.0;

            if (polyline.Count > 1)
            {
                Point3D point3D1 = polyline[0];
                for (int index = 1; index < polyline.Count; ++index)
                {
                    Point3D point3D2 = polyline[index];
                    num     += lineTypeScaler.GetScaledLength(point3D2 - point3D1);
                    point3D1 = point3D2;
                }
                if (polyline.Closed)
                {
                    num += lineTypeScaler.GetScaledLength(polyline[0] - point3D1);
                }
            }
            return(num);
        }