Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
 public SegmentNode(SegmentString segString, Coordinate coord,
                    int segmentIndex, int segmentOctant)
 {
     this.segString     = segString;
     this.coord         = new Coordinate(coord);
     this.segmentIndex  = segmentIndex;
     this.segmentOctant = segmentOctant;
     isInterior         = !coord.Equals(
         segString.GetCoordinate(segmentIndex));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Checks the correctness of the set of split edges corresponding
        /// to this edge.
        /// </summary>
        /// <param name="splitEdges">
        /// The split edges for this edge (in order).
        /// </param>
        private void CheckSplitEdgesCorrectness(IList splitEdges)
        {
            ICoordinateList edgePts = edge.Coordinates;

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

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

            SegmentString   splitn    = (SegmentString)splitEdges[splitEdges.Count - 1];
            ICoordinateList splitnPts = splitn.Coordinates;
            Coordinate      ptn       = splitnPts[splitnPts.Count - 1];

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