当前位置: 首页>>代码示例>>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;未经允许,请勿转载。