Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ring"></param>
        /// <param name="graph"></param>
        private void VisitInteriorRing(ILineString ring, PlanarGraph graph)
        {
            ICoordinate[] pts = ring.Coordinates;
            ICoordinate   pt0 = pts[0];

            /*
             * Find first point in coord list different to initial point.
             * Need special check since the first point may be repeated.
             */
            ICoordinate  pt1   = FindDifferentPoint(pts, pt0);
            Edge         e     = graph.FindEdgeInSameDirection(pt0, pt1);
            DirectedEdge de    = (DirectedEdge)graph.FindEdgeEnd(e);
            DirectedEdge intDe = null;

            if (de.Label.GetLocation(0, Positions.Right) == Locations.Interior)
            {
                intDe = de;
            }
            else if (de.Sym.Label.GetLocation(0, Positions.Right) == Locations.Interior)
            {
                intDe = de.Sym;
            }
            Assert.IsTrue(intDe != null, "unable to find dirEdge with Interior on RHS");
            VisitLinkedDirectedEdges(intDe);
        }
Ejemplo n.º 2
0
        private void VisitInteriorRing(ILineString iring, PlanarGraph graph)
        {
            LineString   ring  = (LineString)iring;
            Coordinates  pts   = ring.GetCoordinates();
            Edge         e     = graph.FindEdgeInSameDirection(pts[0], pts[1]);
            DirectedEdge de    = (DirectedEdge)graph.FindEdgeEnd(e);
            DirectedEdge intDe = null;

            if (de.Label.GetLocation(0, Position.Right) == Location.Interior)
            {
                intDe = de;
            }
            else if (de.Sym.Label.GetLocation(0, Position.Right) == Location.Interior)
            {
                intDe = de.Sym;
            }
            //Assert.isTrue(intDe != null, "unable to find dirEdge with Interior on RHS");

            VisitLinkedDirectedEdges(intDe);
        }