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 PlotAxis(Interval iInterval, Interval dInterval, Interval fInterval) { xInterval = null; yInterval = null; zInterval = null; if (axisEnabled[Axis.x]) { xInterval = GetAbsoluteElement(iInterval, dInterval, fInterval, Axis.x); } if (axisEnabled[Axis.y]) { yInterval = GetAbsoluteElement(iInterval, dInterval, fInterval, Axis.y); } if (axisEnabled[Axis.z]) { zInterval = GetAbsoluteElement(iInterval, dInterval, fInterval, Axis.z); } PlotUtils.SetScale(scale, xInterval, yInterval); AxisPlotter.Plot(parent, axisMaterial, lineMesh, PlotUtils.AxisRadius(), xInterval, yInterval, zInterval); }
private static void Plot(Cone cone, GameObject parent, Point start, Point end, float baseScale, float pointScale, Material material) { cone.mesh.Clear(); cone.gameObject.transform.parent = parent.transform; cone.gameObject.transform.position = parent.transform.position; Vector3 pos = PlotUtils.ToVector3(start); Vector3 finalPos = PlotUtils.ToVector3(end); Vector3[] vertices = Vertices(Vector3.Distance(pos, finalPos), baseScale, pointScale); cone.mesh.vertices = vertices; cone.mesh.normals = Normales(vertices); cone.mesh.uv = Uvs(vertices); cone.mesh.triangles = Triangles(); cone.mesh.RecalculateBounds(); cone.mesh.Optimize(); cone.meshRenderer.material = material; Locate(cone.gameObject, pos, finalPos); cone.gameObject.SetActive(true); }
private static void Plot(GameObject parent, List <Point> points, Material material, bool reverse) { Vector3[] vertices = points.Select(p => PlotUtils.ToVector3(p)).ToArray(); int[] triangles = Triangles(vertices, reverse); Plot(pool.Get(), parent, vertices, triangles, material); }
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 Locate(GameObject gameObject, Point start, Point end) { Vector3 from = PlotUtils.ToVector3(start); Vector3 to = PlotUtils.ToVector3(end); float height = 0.5f * Vector3.Distance(from, to); gameObject.transform.localPosition = from; gameObject.transform.localScale = new Vector3(gameObject.transform.localScale.x, height, gameObject.transform.localScale.z); gameObject.transform.LookAt(to); gameObject.transform.rotation *= Quaternion.Euler(90, 0, 0); }
private static void Plot(Label label, GameObject parent, Point start, Point end, string message, Color color, Alignment alignment) { label.gameObject.transform.SetParent(parent.transform); Vector3 pos = PlotUtils.ToVector3(start); float height = Vector3.Distance(pos, PlotUtils.ToVector3(end)); float width = message.Length * height * 1.5f; label.mesh.text = message; label.mesh.alignment = LabelAlignment(alignment); label.mesh.rectTransform.sizeDelta = new Vector2(width, height); label.mesh.color = color; label.gameObject.transform.localPosition = new Vector3(pos.x + TextOffset(width, alignment), pos.y, pos.z); label.gameObject.SetActive(true); }
public void PlotBtn_Click(object sender, RoutedEventArgs e) { PlotUtils.removeAllCharts(this.plotter); foreach (PlotLineController pl in PLClist) { if ((bool)pl.checkboxSelect.IsChecked) { switch ((int)pl.Key) { case 0: { PlotUtils.plotSelectedNumericalValues(this.plotter, (string)pl.LogFilePath, (int)pl.Key, (int)pl.DataIndex, (int)pl.OffsetValue, (double)pl.ScaleValue, (string)pl.checkboxSelect.Content, (SolidColorBrush)pl.MyBrush); break; } default: { PlotUtils.plotSelectedBooleanValues(this.plotter, (string)pl.LogFilePath, (int)pl.Key, (int)pl.DataIndex, (int)pl.OffsetValue, (double)pl.ScaleValue, (string)pl.checkboxSelect.Content, (SolidColorBrush)pl.MyBrush); break; } } } } }
private void removeAllChartsBtn_Click(object sender, RoutedEventArgs e) { PlotUtils.Clear_Checked_Boxes(PLClist); //removeAllCharts(); }
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()); }