Exemplo n.º 1
0
 public CurveItemTypePair(CurveItem curve, CurveType type, String name, int nC)
 {
     Curve = curve;
     Type = type;
     Scale = GlobalVars.DEFAULTSCALE(type);
     CurrCoordinates = new CurveItemTypePair.CurrentCoordinates();
     DrawCursorDot = true;
     DrawCursorLines = true;
     HorizontalCursorLine = new LineObj();
     VerticalCursorLine = new LineObj();
     SymbolsOn = true;
     Name = name;
     ComputeInterestingValues();
     CurveObj = new CurveObject((PointPairList)curve.Points, nC);
     CurveObj.XMAX = this.XMax;
     CurveObj.YMAX = this.YMax;
     NCurves = nC;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Given a list of PointPairs and the index of the data location, this method
        /// adds a line graph style curve to the 3D Spectrograph environment.
        /// </summary>
        /// <param name="pl">The PointPairList of PointPairs which represent data from the 
        /// FFT of the particular file.</param>
        /// <param name="zInd">The zIndex of the file, corresponds to the file index, but zIndex
        /// is used to show the disparity of the distance from the origin of the curve.</param>
        private void AddLineGraph(CurveObject co, int zInd)
        {
            if (!Loaded)
                return;
            PointPairList pl = co.PointPairList.ToSlice(xMin, xMax).Stretch(GlobalVars.XACTMAX);
            IEnumerator<PointPair> enumer = pl.GetEnumerator();
            double x = 0.0, y = 0.0, xb4 = 0.0, yb4 = 0.0;

            GL.Color3(0.0f, 1.0f, 0.0f);
            GL.Begin(BeginMode.LineStrip);
            int accum = 0;
            while (enumer.MoveNext())// && accum < co.CurvePercentageToGraph*pl.Count)
            {

                xb4 = x;
                yb4 = y;
                x = enumer.Current.X;
                y = enumer.Current.Y;
                if (y * 750 < 2.5)
                {
                    GL.Color3(0.0, 1.0, 0.0);
                }
                else
                {
                    if (y * 750 < 5.0)
                    {
                        GL.Color3(0.0, 0.0, 1.0);
                    }
                    else
                    {
                        GL.Color3(1.0, 0.0, 0.0);
                    }
                }
                // 9889 GL.Vertex3(x / 1024 * 200, y * 750, zInd * 5);
                //GL.Vertex3(x * (GlobalVars.XACTMAX / GlobalVars.XMAX), y * (GlobalVars.YACTMAX / GlobalVars.YMAX), zInd * GlobalVars.ZWIDTH);
                //GL.Vertex3(x * (GlobalVars.XACTMAX / pl[pl.Count - 1].X), y * (GlobalVars.YACTMAX / GlobalVars.YMAX), zInd * GlobalVars.ZWIDTH);
                GL.Vertex3(x, y * (GlobalVars.YACTMAX / GlobalVars.YMAX), zInd * GlobalVars.ZWIDTH);
                //GL.Vertex3(x / 1024 * 25600, y, zInd * 5);
                accum++;
            }
            GL.End();
        }
Exemplo n.º 3
0
 public void ChangeScale(String scale)
 {
     Scale.ChangeYScale(scale, Type);
     PointPairList pplNew = new PointPairList();
     foreach (PointPair pp in (Curve.Points as PointPairList))
     {
         pplNew.Add(pp.X * Scale.X, pp.Y * Scale.Y-Scale.YOFF);
     }
     Curve = new GraphPane().AddCurve(Name, pplNew, Curve.Color);
     ComputeInterestingValues();
     CurveObj = new CurveObject((PointPairList)Curve.Points, NCurves);
     CurveObj.XMAX = this.XMax;
     CurveObj.YMAX = this.YMax;
 }
Exemplo n.º 4
0
 private void AddCurve(CurveObject co)
 {
     if (MousePressed)
     {
         MouseMovementAccumulator++;
     }
     co.XMax = xMax;
     co.XMin = xMin;
     if (false)//MouseMovementAccumulator > 1)
     {
         co.Render(true);
     }
     else
     {
         co.Render(false);
     }
     //co.Render((MouseMovementAccumulator > 1));
 }