Ejemplo n.º 1
0
MandelGizmoWindow::MandelGizmoWindow(
	const unsigned char* image1,
	const unsigned char* image2,
	int width,
	int height)
{
	GLOW_DEBUGSCOPE("MandelGizmoWindow::MandelGizmoWindow");
	
	// Initialize window

	//	char dumpmsg[80];

	if(gizmocounter==0)
	{
          width = 500;
          height = 500;
	  Init("Growth: 1st Glow Window", 250, 200,
		width, height, Glow::rgbBuffer, Glow::allEvents);
	  gizmowindname=GlutWindowNum(); 

	  cout << "gizmowindname is " << gizmowindname << "\n";
	  Refresh();

	  //	  Glow::SetIdleFunc(&MandelGizmoWindow::Refresh);
	}
        else
	{
	  width=400;
          height=400;
 	   Init("Growth: Popup Glow Window", GlowWindow::autoPosition, GlowWindow::autoPosition, width, height, Glow::rgbBuffer, Glow::allEvents);
	}

	// Create widget panel with close button and frame rate indicator.
	// Note that we use a margin of 0
	_widgetsPanel = new GlowQuickPaletteSubwindow(this, 0, 0, width, 25,
		GlowQuickPalette::horizontal, GlowQuickPalette::alignLeft, 10, 5, 5);

        GlowQuickPanelWidget* vpanel1 = _widgetsPanel->AddArrangingPanel(
		GlowQuickPanelWidget::vertical);
        vpanel1->SetBackColor(GlowColor::white);
	vpanel1->AddDismissPushButton("Close", this);
	// Note that we provide initial text for the label widget so its
	// computed width is wide enough to display any fps we want.
	GlowLabelWidget* fpsIndicator = vpanel1->AddLabel("00.00 fps");
	GlowLabelWidget* xaxisIndicator = vpanel1->AddLabel("X-axis: Red");
        xaxisIndicator->SetTextColor(GlowColor::red);
        GlowLabelWidget* yaxisIndicator = vpanel1->AddLabel("Y-axis: Green"); 
        yaxisIndicator->SetTextColor(GlowColor::green);
        GlowLabelWidget* zaxisIndicator = vpanel1->AddLabel("Z-axis: Blue");
        zaxisIndicator->SetTextColor(GlowColor::blue);
	
        GlowQuickPanelWidget* vpanel2 = _widgetsPanel->AddArrangingPanel(
		GlowQuickPanelWidget::vertical);
	
	// First we have a few general controls

           GlowQuickPanelWidget* panel = vpanel2->AddPanel(
	        GlowQuickPanelWidget::loweredStyle, "",
		GlowQuickPanelWidget::horizontal);
	// Add a new panel that will contain text - Glow seems easier for
	// text than straight OpenGl.

       GlowLabelWidget* dumpID = panel->AddLabel("Frame 000");


        panel->AddSeparator();
 
       GlowLabelWidget* ctime = panel->AddLabel("Time is 00.0");

// Another  panel for zmax, nodes, etc.

	/*	_textPanel = new GlowQuickPaletteSubwindow(this, 0, 25, width, 25,
		GlowQuickPalette::horizontal, GlowQuickPalette::alignCenter, 10, 0, 0); */

	//       panel->AddSeparator();
          
                panel = vpanel2->AddPanel(
	        GlowQuickPanelWidget::loweredStyle, "",
		GlowQuickPanelWidget::horizontal);

        GlowLabelWidget* zmax = panel->AddLabel("Max Height is 00.000");
  
	   //        _widgetsPanel->AddSeparator();
 	//       	_widgetsPanel->AddLabel(dumpmsg);

        panel->AddSeparator();
	
       GlowLabelWidget* nodes = panel->AddLabel("000,000 Nodes");
	
        panel->AddSeparator();

       GlowLabelWidget* area = panel->AddLabel("Area is 00.000");

       // new sub-panel for Xmin, Xmax 

                panel = vpanel2->AddPanel(
	        GlowQuickPanelWidget::loweredStyle, "",
		GlowQuickPanelWidget::horizontal);

           GlowLabelWidget* morphmin = panel->AddLabel("X Minimum is 0.000");
  
	   //        _widgetsPanel->AddSeparator();
 	//       	_widgetsPanel->AddLabel(dumpmsg);

        panel->AddSeparator();
	
	 GlowLabelWidget* morphmax = panel->AddLabel("X Maximum is 0.000");

	_widgetsPanel->Pack(true);

	/*_colourPanel = new GlowSubwindow(this, 0, _widgetsPanel->Height(), width, 200, Glow::rgbBuffer, Glow::noEvents);
       
	 glClearColor(1.0, 1.0, 1.0, 0.0);
	 glClear(GL_COLOR_BUFFER_BIT); 

          

	//       give_color_bar(common_rgbmap);

	// Flush the pipeline
	      glFlush();    
	     //   Glow::SwapBuffers();
	     Refresh();*/
       

    //_colourPanel = new MandelGizmoSubwindow(this, width, _widgetsPanel->Height(), image1, width, height, fpsIndicator, dumpID, area, nodes, zmax, ctime, morphmin, morphmax);

	//Reshape(width, height+_widgetsPanel->Height());


	//   Create the subwindow that will contain the main plant image

        _gizmoPanel = new MandelGizmoSubwindow(this, width, _widgetsPanel->Height()+height, image2, width, height, fpsIndicator, dumpID, area, nodes, zmax, ctime, morphmin, morphmax);

	    Reshape(width, height+_widgetsPanel->Height());
	  gizmosubwindname=GlutWindowNum();
          cout << "subwindname is" << gizmosubwindname << "\n"; 

}