Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="argIndex"></param>
        /// <param name="coord"></param>
        /// <param name="onLocation"></param>
        private void InsertPoint(int argIndex, Coordinate coord, Location onLocation)
        {
            Node  n   = NodeMap.AddNode(coord);
            Label lbl = n.Label;

            if (lbl == null)
            {
                n.Label = new Label(argIndex, onLocation);
            }
            else
            {
                lbl.SetLocation(argIndex, onLocation);
            }
        }
Example #2
0
        /// <summary>
        /// Adds candidate boundary points using the current <see cref="IBoundaryNodeRule"/>.
        /// This is used to add the boundary
        /// points of dim-1 geometries (Curves/MultiCurves).
        /// </summary>
        /// <param name="argIndex"></param>
        /// <param name="coord"></param>
        private void InsertBoundaryPoint(int argIndex, Coordinate coord)
        {
            var n = NodeMap.AddNode(coord);
            // nodes always have labels
            Label lbl = n.Label;
            // the new point to insert is on a boundary
            int boundaryCount = 1;
            // determine the current location for the point (if any)
            //Location loc = Location.Null;
            var loc = lbl.GetLocation(argIndex, Positions.On);

            if (loc == Location.Boundary)
            {
                boundaryCount++;
            }

            // determine the boundary status of the point according to the Boundary Determination Rule
            Location newLoc = DetermineBoundary(_boundaryNodeRule, boundaryCount);

            lbl.SetLocation(argIndex, newLoc);
        }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 public PlanarGraph()
 {
     _nodes = new NodeMap(new NodeFactory());
 }
Example #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="nodeFact"></param>
 public PlanarGraph(NodeFactory nodeFact)
 {
     _nodes = new NodeMap(nodeFact);
 }