Пример #1
0
        protected override int CompareToGeometry(Geometry o)
        {
            SplineCurve line = (SplineCurve)o;
            // MD - optimized implementation
            int i = 0;
            int j = 0;

            while (i < points.Count && j < line.points.Count)
            {
                int comparison = points[i].CompareTo(line.points[j]);
                if (comparison != 0)
                {
                    return(comparison);
                }
                i++;
                j++;
            }

            if (i < points.Count)
            {
                return(1);
            }

            if (j < line.points.Count)
            {
                return(-1);
            }
            return(0);
        }
Пример #2
0
        public override Geometry Clone()
        {
            SplineCurve ls = (SplineCurve)base.MemberwiseClone();

            ls.points = points.Clone();

            return(ls);
        }
Пример #3
0
        public override bool EqualsExact(Geometry other, double tolerance)
        {
            if (!IsEquivalentType(other))
            {
                return(false);
            }

            SplineCurve otherLineString = (SplineCurve)other;

            if (points.Count != otherLineString.points.Count)
            {
                return(false);
            }

            for (int i = 0; i < points.Count; i++)
            {
                if (!points[i].Equals(otherLineString.points[i], tolerance))
                {
                    return(false);
                }
            }

            return(true);
        }