/// <summary>
        /// Adds nodes for the first and last points of the edge.
        /// </summary>
        private void AddEndPoints()
        {
            int maxSegIndex = edge.Count - 1;

            Add(edge.GetCoordinate(0), 0);
            Add(edge.GetCoordinate(maxSegIndex), maxSegIndex);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SegmentNode"/> class.
 /// </summary>
 /// <param name="segString"></param>
 /// <param name="coord"></param>
 /// <param name="segmentIndex"></param>
 /// <param name="segmentOctant"></param>
 public SegmentNode(SegmentString segString, ICoordinate coord, int segmentIndex, Octants segmentOctant)
 {
     this.segString     = segString;
     this.Coordinate    = new Coordinate(coord);
     this.SegmentIndex  = segmentIndex;
     this.segmentOctant = segmentOctant;
     isInterior         = !coord.Equals2D(segString.GetCoordinate(segmentIndex));
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="splitEdges"></param>
        private void CheckSplitEdgesCorrectness(IList splitEdges)
        {
            ICoordinate[] edgePts = edge.Coordinates;

            // check that first and last points of split edges are same as endpoints of edge
            SegmentString split0 = (SegmentString)splitEdges[0];
            ICoordinate   pt0    = split0.GetCoordinate(0);

            if (!pt0.Equals2D(edgePts[0]))
            {
                throw new Exception("bad split edge start point at " + pt0);
            }

            SegmentString splitn = (SegmentString)splitEdges[splitEdges.Count - 1];

            ICoordinate[] splitnPts = splitn.Coordinates;
            ICoordinate   ptn       = splitnPts[splitnPts.Length - 1];

            if (!ptn.Equals2D(edgePts[edgePts.Length - 1]))
            {
                throw new Exception("bad split edge end point at " + ptn);
            }
        }