當前位置: 首頁>>代碼示例>>C#>>正文


C# Point.ScaleDown方法代碼示例

本文整理匯總了C#中System.Point.ScaleDown方法的典型用法代碼示例。如果您正苦於以下問題:C# Point.ScaleDown方法的具體用法?C# Point.ScaleDown怎麽用?C# Point.ScaleDown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Point的用法示例。


在下文中一共展示了Point.ScaleDown方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: cT

        private static Result cT(DateTime startTime)
        {
            var scale = Solver.Solver.ScaleDown;

            var start = new Point(120, 180);
            var end = new Point(320, 220);

            var a = new PointD(100, 200);
            var b = new PointD(100, 100);

            var c = new PointD(300, 200);
            var d = new PointD(300, 100);

            var lines = new[]
            {
                new LineD(new PointD(250, 300), new PointD(250, 150) ),

                new LineD(a, new PointD(200, 200) ),
                new LineD(b, new PointD(200, 100) ),
                new LineD(a, b ),

                new LineD(c, new PointD(400, 200) ),
                new LineD(d, new PointD(400, 100) ),

                new LineD( new PointD(300, 300), d ),

                new LineD(new PointD(250, 300), new PointD(300, 300) ),
                new LineD(new Point(start.X - scale, start.Y +scale), new PointD(start.X - scale, start.Y +scale)),

              }.ToList();

             /*   var lastSolutionLinePoints = new int[] { 24, 36, 34, 36, 40, 36, 46, 46, 46, 54, 52, 64, 58, 64, 64, 54, 64, 44, 64, 44 };
              var lastSolutionLines = LineD.CreateLists(lastSolutionLinePoints, scale, scale);
              var lastSolutionLines2 = LineD.CreateLists(lastSolutionLinePoints, scale, -scale);

              lines.AddRange(lastSolutionLines);
              lines.AddRange(lastSolutionLines2);*/

            var bb = new BoundingBox(new Point(start.X, start.Y), new Point(end.X + 2, 320));

            var boxesForProperEnd = new[]
            {
                  new BoundingBox(new Point(248, 250), new Point(500, 400)),
                  new BoundingBox(new Point(300, 200), new Point(500, 400))
              };

            var boxesForAux2 = new[]
            {
                  new BoundingBox(new Point(248, 250), new Point(275, 400)),

              };

            var auxEndPoint = new Point(249, 300);
            var auxEndPoint2 = new Point(301, 300);
            var end1 = end;
            Func<Point, Point> auxEnd = point =>
            {
                point = point.ScaleUp(scale);
                if (boxesForAux2.Any(box => box.IsInside(point)))
                {
                    return auxEndPoint2;
                }

                if (boxesForProperEnd.Any(box => box.IsInside(point)))
                {
                    return end1;
                }

                return auxEndPoint;
            };

            // lines = new LineD[] {};

            if (Solver.Solver.SwapStartAndEnd)
            {
                Helpers.Swap(ref start, ref end);
            }
            var desc = new Description(new Car(start), end, lines.ToList(), bb, Solver.Solver.MaxSteps, auxEnd).ScaleDown(scale);

            return Solver.Solver.DoIt(desc, LogResult(startTime, start.ScaleDown(scale)), LogInfo(startTime, start.ScaleDown(scale)),
                 false);
        }
開發者ID:WinstonSmith77,項目名稱:vertrackt,代碼行數:82,代碼來源:Program.cs


注:本文中的System.Point.ScaleDown方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。