Beispiel #1
0
 public PlotData(Scan scan, Zed.Axes xAxis, Zed.Axes yAxis, Zed.Axes zAxis, bool compare = true)
 {
     Name = scan.Name;
     Zed.Position[] data = ApplyFilters((Zed.Position[])scan.Data.ToArray().Clone());
     X = Zed.getAxis(data, (int)xAxis, FlipX);
     Y = Zed.getAxis(data, (int)yAxis, FlipY);
     Z = Zed.getAxis(data, (int)zAxis, FlipZ);
     if (compare)
     {
         CompareBounds();
     }
     SelectedPoint = scan.SelectedIdx == -1 ? null : new Zed.Position(
         data[scan.SelectedIdx].Time,
         xAxis == Zed.Axes.None ? 0 : X[scan.SelectedIdx],
         yAxis == Zed.Axes.None ? 0 : Y[scan.SelectedIdx],
         zAxis == Zed.Axes.None ? 0 : Z[scan.SelectedIdx],
         0, 0);
 }
Beispiel #2
0
 private Zed.Position[] ApplyFilters(Zed.Position[] data)
 {
     if (RemoveAngle)
     {
         Zed.Plane plane = Zed.getPlane(data);
         for (int i = 0; i < data.Length; i++)
         {
             Zed.Position p = data[i];
             data[i] = new Zed.Position(p.Time, p.X, p.Y, p.Z, p.H - Zed.projectPlane(plane, Zed.posToVec3(data[i])).Z, p.I);
         }
     }
     if (Equalize)
     {
         double equalizer = Zed.getAxis(data, 4, false).Min();
         for (int i = 0; i < data.Length; i++)
         {
             data[i] = new Zed.Position(data[i].Time, data[i].X, data[i].Y, data[i].Z, data[i].H - equalizer, data[i].I);
         }
     }
     return(data);
 }