Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Node"/> class that refers to
        /// a specific point, with the specified location.
        /// </summary>
        /// <param name="p">The point that will be assigned this geometry (not null).
        /// Modified by referring its geometry to <c>this</c> node.</param>
        /// <param name="g">The geometry for the point (not null)</param>
        internal Node(PointFeature p, PointGeometry g)
            : base(g)
        {
            if (p==null)
                throw new ArgumentNullException();

            m_Points = new List<PointFeature>(1);
            m_Points.Add(p);

            // Ensure the point is associated with this node
            p.SetNode(this);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Node"/> class that refers to
        /// a specific point, with the specified location.
        /// </summary>
        /// <param name="p">The point that will be assigned this geometry (not null).
        /// Modified by referring its geometry to <c>this</c> node.</param>
        /// <param name="g">The geometry for the point (not null)</param>
        internal Node(PointFeature p, PointGeometry g)
            : base(g)
        {
            if (p == null)
            {
                throw new ArgumentNullException();
            }

            m_Points = new List <PointFeature>(1);
            m_Points.Add(p);

            // Ensure the point is associated with this node
            p.SetNode(this);
        }
Пример #3
0
        PointFeature GetArcEndPoint(PointGeometry g, ILength tol, Operation creator)
        {
            // Ensure we've got a point at the required position
            PointFeature pt = EnsurePointExists(g, tol, creator);

            // If it's not exactly coincident, we've picked up a previously loaded point
            // that happens to be within tolerance. If it's not already connected to any
            // lines, shift it to where we want it.
            if (!pt.IsCoincident(g))
            {
                if (!pt.HasDependents)
                {
                    m_Index.Remove(pt);
                    PointFeature[] pts = pt.Node.Points;
                    pt.SetNode(new Node(pts, g));
                    m_Index.Add(pt);
                }
            }

            return(pt);
        }