Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
VectorFieldDisplayer.cs
Go to the documentation of this file.
1 using System;
4 using UnityEngine;
5 
6 namespace droid.Runtime.Prototyping.Displayers.ScatterPlots {
10  [ExecuteInEditMode]
11  [AddComponentMenu(DisplayerComponentMenuPath._ComponentMenuPath
12  + "VectorField"
13  + DisplayerComponentMenuPath._Postfix)]
18  protected override void Setup() { }
19 
20  public override void Display(Double value) { }
21 
22  public override void Display(float[] values) { }
23 
24  public override void Display(String values) { }
25 
26  public override void Display(Vector3 value) { throw new NotImplementedException(); }
27  public override void Display(Vector3[] value) { this.ScatterPlot(value); }
28 
29  public override void Display(Points.ValuePoint points) { this.PlotSeries(new[] {points}); }
30 
31  public override void Display(Points.ValuePoint[] points) { }
32 
33  public override void Display(Points.StringPoint point) { throw new NotImplementedException(); }
34  public override void Display(Points.StringPoint[] points) { throw new NotImplementedException(); }
35 
36  //public override void Display(Object o) { throw new NotImplementedException(); }
37  public override void Display(float values) { }
38 
39  void Update() {
40  if (this._RetainLastPlot) {
41  if (this._Values != null) {
42  PlotSeries(this._Values);
43  }
44  }
45  }
46 
50  public void ScatterPlot(Vector3[] points) { }
51 
52  /*public override void PlotSeries(float[] points) {
53 
54  }*/
55 
59  public override void PlotSeries(Points.ValuePoint[] points) {
60  #if NEODROID_DEBUG
61  if (this.Debugging) {
62  Debug.Log("Plotting value points");
63  }
64  #endif
65 
66  this._Values = points;
67 
68  foreach (var point in points) {
69  //point._Size
70  switch ((int)point._Val) {
71  case 0:
72  NeodroidDrawingUtilities.ForDebug(point._Pos, Vector3.forward, Color.cyan);
73  break;
74  case 1:
75  NeodroidDrawingUtilities.ForDebug(point._Pos, Vector3.back, Color.cyan);
76  break;
77  case 2:
78  NeodroidDrawingUtilities.ForDebug(point._Pos, Vector3.up, Color.cyan);
79  break;
80  case 3:
81  NeodroidDrawingUtilities.ForDebug(point._Pos, Vector3.down, Color.cyan);
82  break;
83  case 4:
84  NeodroidDrawingUtilities.ForDebug(point._Pos, Vector3.left, Color.cyan);
85  break;
86  case 5:
87  NeodroidDrawingUtilities.ForDebug(point._Pos, Vector3.right, Color.cyan);
88  break;
89  }
90  }
91  }
92  }
93 }