public void Clear() { PlanePlotter.Clear(); LinePlotter.Clear(); LabelPlotter.Clear(); ConePlotter.Clear(); }
protected void PlotLine(Point start, Point end, Material material) { UpdateLimits(GetRelativeElements(start)); UpdateLimits(GetRelativeElements(end)); LinePlotter.Plot(parent, start, end, material, lineMesh, PlotUtils.FunctionRadius()); }
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()); }
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; }
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))); } }
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; } }
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(); } }
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); } } }
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(); }
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); }