Example #1
0
    public void RenderScene(Graphics gdi, World world, int w, int h)
    {
        //RenderTimings(gdi, world, w, h);
        //return;
        int i, j;
        int x, y;
        selectedCell = null;
        if (world.pointx != -1)
        {
            //selectedCell = PointToCell(world.pointx, world.pointy);
        }

        DrawAxes(gdi, Pens.Black, w, h);

        double tmax = 0;
        y = 0;
//        for (y = 0; y < world.ynum; y++)
            for (x = 0; x < world.xnum; x++)
            {
                RenderParent(gdi, x, y, 1, tmax);
            }

        RenderTimings(gdi, world, w, h);


        //DrawCellInfo(gdi, world);

    }
Example #2
0
    public void RenderTimings(Graphics gdi, World world, int w, int h)
    {
        //TimeUtil tu = TimeUtil.Instance();

        string doubleformat = "0.0";

        int x =0;
        int y = -50;
        int rownum = 0;
        int fonth = 20;
        int valueoffset = 100;
        double allcalc = world.timers[0].CalcAverageMicro()/1000.0;
        
        DrawString(gdi, "Calc Time =", font, textBrush, x, y + rownum * fonth);
        DrawString(gdi, allcalc.ToString(doubleformat), font, textBrush, x + valueoffset, y + rownum * fonth);
    }
Example #3
0
    public void RenderScene(Graphics gdi, World world, int w, int h)
    {
        //RenderTimings(gdi, world, w, h);
        //return;
        int i, j;
        int x, y;
        selectedCell = null;
        if (world.pointx != -1)
        {
            //selectedCell = PointToCell(world.pointx, world.pointy);
        }

//        DrawAxes(gdi, Pens.Black, w, h);

        double tmax = 0;
        y = 0;
        for (x = 0; x < world.xnum; x++)
        {
            RenderParent(gdi, x, tmax);
        }

        for (x = 0; x < world.xnum; x++)
        {
            Element elem = fluid.elements[x];
            if (drawinfo)
                PrintElementInfo(gdi, elem);
        }


        RenderTimings(gdi, world, w, h);


        //DrawCellInfo(gdi, world);

    }
Example #4
0
 public World GetScene()
 {
   World world = new World();
   fluid.GetDomainSize(ref world.xnum, ref world.ynum);
   TimeUtil tu = TimeUtil.Instance();
   tu.timers[0].Copy(world.timers[0]);
   return world;
 }
Example #5
0
    private void ReceiveWorkerThread_ProgressChanged(object sender, ProgressChangedEventArgs e)
    {
      if (!run)
        return;
      ThreadParam p = (ThreadParam)e.UserState;
      world=p.world;
//      timers = p.timers;
//      world.timers[0] = timers;
      Draw(g);
      //g.Clear(Color.White);
      //Invalidate();
      //panel1.Invalidate();
      //      scene.RenderScene(g, world, this.ClientRectangle.Width, this.ClientRectangle.Height);
      isdraw = false;
      //e.Graphics.Clear(Color.White);
      //    scene.Render(e.Graphics, this.ClientRectangle.Width, this.ClientRectangle.Height);
    }