Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="intPt"></param>
        /// <param name="segmentIndex"></param>
        public void AddIntersection(ICoordinate intPt, int segmentIndex)
        {
            int normalizedSegmentIndex = segmentIndex;
            // normalize the intersection point location
            int nextSegIndex = normalizedSegmentIndex + 1;

            if (nextSegIndex < pts.Length)
            {
                ICoordinate nextPt = pts[nextSegIndex];

                // Normalize segment index if intPt falls on vertex
                // The check for point equality is 2D only - Z values are ignored
                if (intPt.Equals2D(nextPt))
                {
                    normalizedSegmentIndex = nextSegIndex;
                }
            }

            // Add the intersection point to edge intersection list.
            SegmentNode ei = nodeList.Add(intPt, normalizedSegmentIndex);
        }