Пример #1
0
        public static ILength GetDistance(ILineSegmentGeometry g, IPosition point)
        {
            double xp, yp;

            BasicGeom.GetPerpendicular(point.X, point.Y, g.Start.X, g.Start.Y, g.End.X, g.End.Y, out xp, out yp);
            double d = BasicGeom.Distance(new Position(xp, yp), point);

            return(new Length(d));
        }
Пример #2
0
 internal override uint IntersectSegment(IntersectionResult results, ILineSegmentGeometry that)
 {
     return IntersectionHelper.Intersect(results, (ILineSegmentGeometry)this, that);
 }
Пример #3
0
 abstract internal uint IntersectSegment(IntersectionResult results, ILineSegmentGeometry seg);
Пример #4
0
 internal override uint IntersectSegment(IntersectionResult results, ILineSegmentGeometry seg)
 {
     return(Make().IntersectSegment(results, seg));
 }
 public static ILength GetDistance(ILineSegmentGeometry g, IPosition point)
 {
     double xp, yp;
     BasicGeom.GetPerpendicular(point.X, point.Y, g.Start.X, g.Start.Y, g.End.X, g.End.Y, out xp, out yp);
     double d = BasicGeom.Distance(new Position(xp, yp), point);
     return new Length(d);
 }
Пример #6
0
 internal static uint Intersect(IntersectionResult result, ILineSegmentGeometry seg, ICircleGeometry circle)
 {
     return Intersect(result, seg.Start, seg.End, circle.Center, circle.Radius);
 }
Пример #7
0
        internal static uint Intersect(IntersectionResult result, ILineSegmentGeometry seg, IMultiSegmentGeometry line)
        {
            uint nx=0;

            IPointGeometry a = seg.Start;
            IPointGeometry b = seg.End;
            IPointGeometry[] data = line.Data;

            for (int i=1; i<data.Length; i++)
                nx += Intersect(result, a, b, data[i-1], data[i]);

            return nx;
        }
Пример #8
0
 internal override uint IntersectSegment(IntersectionResult results, ILineSegmentGeometry that)
 {
     return(IntersectionHelper.Intersect(results, that, (ICircularArcGeometry)this));
 }
Пример #9
0
 public static IWindow GetExtent(ILineSegmentGeometry g)
 {
     return(new Window(g.Start, g.End));
 }
Пример #10
0
 public static void Render(ILineSegmentGeometry g, ISpatialDisplay display, IDrawStyle style)
 {
     style.Render(display, new IPosition[] { g.Start, g.End });
 }
Пример #11
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="g">The geometry to copy</param>
 public LineSegmentGeometry(ILineSegmentGeometry g)
 {
     m_Start = g.Start;
     m_End = g.End;
 }
Пример #12
0
 /// <summary>
 /// Gets the position that is a specific distance from the start of a line segment.
 /// </summary>
 /// <param name="g">The line segment</param>
 /// <param name="dist">The distance from the start of the segment.</param>
 /// <param name="result">The position found</param>
 /// <returns>True if the distance is somewhere ON the line. False if the distance
 /// was less than zero, or more than the line length (in that case, the position
 /// found corresponds to the corresponding terminal point).</returns>
 public static bool GetPosition(ILineSegmentGeometry g, double d, out IPosition result)
 {
     return GetPosition(g.Start, g.End, d, out result);
 }
Пример #13
0
 public static ILength GetLength(ILineSegmentGeometry g)
 {
     double d = BasicGeom.Distance(g.Start, g.End);
     return new Length(d);
 }
Пример #14
0
 public static IWindow GetExtent(ILineSegmentGeometry g)
 {
     return new Window(g.Start, g.End);
 }
Пример #15
0
 internal uint IntersectSegment(ILineSegmentGeometry seg)
 {
     return m_IntersectedObject.LineGeometry.IntersectSegment(this, seg);
 }
Пример #16
0
        public static ILength GetLength(ILineSegmentGeometry g)
        {
            double d = BasicGeom.Distance(g.Start, g.End);

            return(new Length(d));
        }
Пример #17
0
 internal uint IntersectSegment(ILineSegmentGeometry seg)
 {
     return(m_IntersectedObject.LineGeometry.IntersectSegment(this, seg));
 }
Пример #18
0
 /// <summary>
 /// Gets the position that is a specific distance from the start of a line segment.
 /// </summary>
 /// <param name="g">The line segment</param>
 /// <param name="dist">The distance from the start of the segment.</param>
 /// <param name="result">The position found</param>
 /// <returns>True if the distance is somewhere ON the line. False if the distance
 /// was less than zero, or more than the line length (in that case, the position
 /// found corresponds to the corresponding terminal point).</returns>
 public static bool GetPosition(ILineSegmentGeometry g, double d, out IPosition result)
 {
     return(GetPosition(g.Start, g.End, d, out result));
 }
Пример #19
0
 internal override uint IntersectSegment(IntersectionResult results, ILineSegmentGeometry seg)
 {
     return Make().IntersectSegment(results, seg);
 }
Пример #20
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="g">The geometry to copy</param>
 public LineSegmentGeometry(ILineSegmentGeometry g)
 {
     m_Start = g.Start;
     m_End   = g.End;
 }
Пример #21
0
 internal static uint Intersect(IntersectionResult result, ILineSegmentGeometry seg, ICircularArcGeometry arc)
 {
     if (CircularArcGeometry.IsCircle(arc))
         return Intersect(result, seg, arc.Circle);
     else
         return Intersect(result, seg.Start, seg.End, arc.First, arc.Second, arc.Circle);
 }
Пример #22
0
 public static void Render(ILineSegmentGeometry g, ISpatialDisplay display, IDrawStyle style)
 {
     style.Render(display, new IPosition[] { g.Start, g.End });
 }
Пример #23
0
 internal static uint Intersect(IntersectionResult results, ILineSegmentGeometry ab, ILineSegmentGeometry pq)
 {
     return Intersect(results, ab.Start, ab.End, pq.Start, pq.End);
 }
Пример #24
0
 internal abstract uint IntersectSegment(IntersectionResult results, ILineSegmentGeometry seg);