Esempio n. 1
0
 public void Clear()
 {
     PlanePlotter.Clear();
     LinePlotter.Clear();
     LabelPlotter.Clear();
     ConePlotter.Clear();
 }
Esempio n. 2
0
        protected void PlotLine(Point start, Point end, Material material)
        {
            UpdateLimits(GetRelativeElements(start));
            UpdateLimits(GetRelativeElements(end));

            LinePlotter.Plot(parent, start, end, material, lineMesh, PlotUtils.FunctionRadius());
        }
Esempio n. 3
0
    private void PlotBorder(List <Point> points)
    {
        for (int i = 1; i < points.Count; i++)
        {
            LinePlotter.Plot(parent, points[i - 1], points[i], lineMaterial, lineMesh, PlotUtils.FunctionRadius());
        }

        LinePlotter.Plot(parent, points.Last(), points.First(), lineMaterial, lineMesh, PlotUtils.FunctionRadius());
    }
Esempio n. 4
0
        void init()
        {
            dispatcher = PageList.Main.Dispatcher;

            speed      = PageList.Experience.SpeedChart;
            offset     = PageList.Experience.OffsetChart;
            accelerate = PageList.Experience.AccelerationChart;
            brake      = PageList.Experience.BrakeChart;
            follow     = PageList.Experience.FollowChart;
        }
Esempio n. 5
0
        private void plotExperienceLine(int scene, int mode, LinePlotter plotter, string variable, int xAxis)
        {
            int index = UserSelections.getIndex(scene, mode);

            if (user.Index[index] == -1)
            {
                return;
            }

            Dispatcher              dispatcher = PageList.Main.Dispatcher;
            ExperienceUnit          unit       = user.Experiences[user.Index[index]];
            List <SimulatedVehicle> list       = unit.Vehicles;

            plotter.Init.AppendAsync(dispatcher,
                                     new Point(0, (float)unit.Top.GetType().GetProperty(variable).GetValue(unit.Top)));
            plotter.Init.AppendAsync(dispatcher,
                                     new Point(0, (float)unit.Bottom.GetType().GetProperty(variable).GetValue(unit.Bottom)));

            switch (xAxis)
            {
            case 0:
                plotter.Init.AppendAsync(dispatcher, new Point(unit.Right.SimulationTime, 0));
                break;

            case 1:
                plotter.Init.AppendAsync(dispatcher, new Point(unit.Right.TotalDistance, 0));
                break;

            default:
                return;
            }


            foreach (SimulatedVehicle vehicle in list)
            {
                float x;

                switch (xAxis)
                {
                case 0:
                    x = vehicle.SimulationTime;
                    break;

                case 1:
                    x = vehicle.TotalDistance;
                    break;

                default:
                    return;
                }

                plotter.addRealTimePoint(mode,
                                         new Point(x, (float)vehicle.GetType().GetProperty(variable).GetValue(vehicle)));
            }
        }
Esempio n. 6
0
 private void ChangeMainChart(LinePlotter toChange)
 {
     if (currentLine == null || !currentLine.Equals(toChange))
     {
         if (currentLine != null)
         {
             currentLine.Visibility = System.Windows.Visibility.Hidden;
         }
         currentLine            = toChange;
         currentLine.Visibility = System.Windows.Visibility.Visible;
     }
 }
Esempio n. 7
0
        public void Plot(IPlotInput input)
        {
            if (input.functions.Length > 0)
            {
                PlotUtils.ResetScale();

                Clear();

                functions   = input.functions;
                independent = input.independent;
                dependent   = input.dependent;
                continuous  = true;
                closed      = true;

                continuousFunction = new bool[functions.Length];
                closedFunction     = new bool[functions.Length];

                functionPoints.Clear();

                for (int i = 0; i < functions.Length; i++)
                {
                    continuousFunction[i] = true;
                    closedFunction[i]     = true;
                    functionPoints.Add(new List <Point>());
                }

                BeforePlot(input);

                minI.Set(double.MaxValue);
                maxI.Set(double.MinValue);

                minD.Set(0, double.MaxValue);
                maxD.Set(0, double.MinValue);

                minF.Set(0, 0, double.MaxValue);
                maxF.Set(0, 0, double.MinValue);

                PlotFunctions(input.a, input.b, input.quality);

                AfterPlot(input.a, input.b, minI, maxI, minD, maxD, minF, maxF);

                PlotAxis();

                PlanePlotter.PlotActions();
                LinePlotter.PlotActions();
                ConePlotter.PlotActions();
                LabelPlotter.PlotActions();
            }
        }
Esempio n. 8
0
        private static void PlotMarks(GameObject parent, Material material, Mesh mesh, float radius,
                                      double markStart, double markEnd, double step, double proportion, Axis axis)
        {
            double min = step / 2;

            Debug.Log(markStart);
            Debug.Log(step);
            Debug.Log(markEnd);

            for (double i = markStart + step; i < markEnd; i += step)
            {
                if (i != 0 && (markEnd - i) > min)
                {
                    LinePlotter.Plot(parent, MarkPoint(i, axis, proportion, true),
                                     MarkPoint(i, axis, proportion, false), material, mesh, radius);

                    PlotLabel(parent, material, axis, proportion, i);
                }
            }
        }
Esempio n. 9
0
    private void Start()
    {
        List <Point> points = new List <Point>();

        points.Add(new Point(0, 1, 1));
        points.Add(new Point(1, 0, 1));
        points.Add(new Point(2, -1, 1));
        points.Add(new Point(3, -1, 1));
        points.Add(new Point(4, 0, 1));
        points.Add(new Point(5, 1, 1));

        points.Add(new Point(5, 1, 0));
        points.Add(new Point(4, 0, 0));
        points.Add(new Point(3, -1, 0));
        points.Add(new Point(2, -1, 0));
        points.Add(new Point(1, 0, 0));
        points.Add(new Point(0, 1, 0));

        Plot(points);

        points.Clear();

        points.Add(new Point(0, 1, -1.5));

        points.Add(new Point(1, 0, -1));
        points.Add(new Point(2, -1, -1));
        points.Add(new Point(3, -1, -1));
        points.Add(new Point(4, 0, -1));

        points.Add(new Point(5, 1, -1.5));

        points.Add(new Point(4, 0, -2));
        points.Add(new Point(3, -1, -2));
        points.Add(new Point(2, -1, -2));
        points.Add(new Point(1, 0, -2));

        Plot(points);

        PlanePlotter.PlotActions();
        LinePlotter.PlotActions();
    }
Esempio n. 10
0
        private static void PlotAxis(GameObject parent, Material material, Mesh mesh, float radius,
                                     Interval i, Axis axis)
        {
            double proportion = 0.15 / PlotUtils.scale;
            double step       = GetStep(i, proportion);

            Interval interval = AxisInterval(i, step);

            Point start = GetPoint(interval.a, axis);
            Point end   = GetPoint(interval.b, axis);

            LinePlotter.Plot(parent, start, end, material, mesh, radius);

            ConePlotter.Plot(parent, start, GetPoint(interval.a - (arrowHeight * proportion), axis),
                             arrowBaseScale, arrowPointScale, material);

            ConePlotter.Plot(parent, end, GetPoint(interval.b + (arrowHeight * proportion), axis),
                             arrowBaseScale, arrowPointScale, material);

            PlotMarks(parent, material, mesh, radius, interval.a, interval.b, step,
                      proportion, axis);
        }