コード例 #1
0
ファイル: DrawUtility.cs プロジェクト: pzgulyas/openrails-1
        public static PointF FindIntersection(AESegment segArea, AESegment track)
        {
            PointF intersection;

            if (track.isCurved)
            {
                if ((int)(track.startPoint.X) == 45892)
                {
                    intersection = PointF.Empty;
                }
                intersection = DrawUtility.FindCurveIntersection(segArea, track);
            }
            else
            {
                intersection = DrawUtility.FindStraightIntersection(segArea, track);
            }
            return(intersection);
        }
コード例 #2
0
ファイル: AESegment.cs プロジェクト: pzgulyas/openrails-1
        public bool PointOnSegment(PointF toCheck)
        {
            PointF closest;
            double dist;

            if (!isCurved)
            {
                dist = DrawUtility.FindDistanceToSegment(toCheck, this, out closest);
            }
            else
            {
                dist = DrawUtility.FindDistanceToCurve(toCheck, this, out closest);
            }
            if (Math.Round(dist, 2) != 0.0)
            {
                return(false);
            }
            return(true);
        }