Esempio n. 1
0
void GraphSceneUI::initShadersPanel() {
	char* text = new char[256];

	strcpy(text, "Shaders");
	GLUI_Panel* shadersPanel = addPanel(text);

	strcpy(text, "Wind");
	addSpinnerToPanel(shadersPanel, text, 2, &GraphScene::WIND, WIND_SPINNER);
}
Esempio n. 2
0
void TPinterface::initGUI()
{

	pgraph = &(((LightingScene*) scene)->pgraph);

	int* wire = &(((LightingScene*) scene)->wire);

	int* wind = &(((LightingScene*) scene)->wind);

	int * cam = &(((LightingScene*) scene)->activCam);

	// Check CGFinterface.h and GLUI documentation for the types of controls available
	GLUI_Panel *varPanel= addPanel("Settings:", 1);


	GLUI_Panel *modepanel = addPanelToPanel(varPanel, "Mode", 1);
	GLUI_RadioGroup* wireFrameGroup = addRadioGroupToPanel(modepanel,wire);
	addRadioButtonToGroup(wireFrameGroup, "\tFill");
	addRadioButtonToGroup(wireFrameGroup, "\tWire");
	addRadioButtonToGroup(wireFrameGroup, "\tPoint");
	
	addColumnToPanel(varPanel);
	GLUI_Panel *cammodel = addPanelToPanel(varPanel, "Camera", 1);
	GLUI_RadioGroup* camerasGroup = addRadioGroupToPanel(cammodel,cam);
	for(int i = 0; i < cameras.size();i++)
	{

		addRadioButtonToGroup(camerasGroup, (char *)cameras[i].c_str());
	}
	addRadioButtonToGroup(camerasGroup, "Free Camera");
	

	addColumnToPanel(varPanel);
	GLUI_Panel *lightspanel = addPanelToPanel(varPanel, "Lights", 1);
	for(int i = 0; i < pgraph->getLights().size();i++)
	{
		if (pgraph->getLights()[i].enabled)
			addCheckboxToPanel(lightspanel,
			(char*)pgraph->getLights()[i].id.c_str(), NULL, i)->set_int_val(
			1);
		else
			addCheckboxToPanel(lightspanel,
			(char*)pgraph->getLights()[i].id.c_str(), NULL, i)->set_int_val(
			0);
	}

	addColumnToPanel(varPanel);
	GLUI_Panel *windpanel = addPanelToPanel(varPanel, "Wind", 1);
	GLUI_Spinner *spin=   addSpinnerToPanel(windpanel,"wind",GLUI_SPINNER_INT,wind,11);

	spin->set_int_limits(0,11,GLUI_LIMIT_WRAP);	

}
Esempio n. 3
0
void DemoInterface::initGUI()
{
	// Check CGFinterface.h and GLUI documentation for the types of controls available
	GLUI_Panel *varPanel= addPanel("Teapot Shader", 1);
	addSpinnerToPanel(varPanel, "normScale", 2,NULL, 1);
	
	addColumn();

	varPanel= addPanel("Display List", 1);
	addCheckboxToPanel(varPanel, "Use", &(((DemoScene*) scene)->myDLObj->usingDL), 2);

	addColumn();
	
	varPanel= addPanel("Animations", 1);
	addButtonToPanel(varPanel, "Reset", 3);

	addColumn();

	addCheckbox( "Wireframe", &(((DemoScene*) scene)->wireframe), 4);
}
Esempio n. 4
0
void Interface::initGUI()
{
	GLUI_Panel *geral =addPanel("Opcoes", 1);
	addColumnToPanel(geral);
	GLUI_Panel *luzesPanel = addPanelToPanel(geral,"Luzes", 1);

	for(unsigned int i=0;i<((ANFScene *) scene)->parser.lights.size();i++){

		string str=((ANFScene *) scene)->parser.lights[i]->id;
		char * writable = new char[str.size() + 1];
		copy(str.begin(), str.end(), writable);
		writable[str.size()] = '\0';


		if(((ANFScene *) scene)->parser.lights[i]->enabled==true){
			addCheckboxToPanel(luzesPanel,writable,NULL,i)->set_int_val(1);
		}
		else{
			addCheckboxToPanel(luzesPanel,writable,NULL,i)->set_int_val(0);
		}
		delete[] writable;

	}

	addColumnToPanel(geral);
	GLUI_Panel *camerasPanel = addPanelToPanel(geral,"Camaras", 1);
	GLUI_RadioGroup *cameraList = addRadioGroupToPanel(camerasPanel,&(((ANFScene *) scene)->parser.activeCam));
	
	for(unsigned int i=0;i<((ANFScene *) scene)->parser.cameras.size();i++){

		string str=((ANFScene *) scene)->parser.cameras[i]->id;
		char * writable = new char[str.size() + 1];
		copy(str.begin(), str.end(), writable);
		writable[str.size()] = '\0';

		if(i == ((ANFScene *) scene)->parser.activeCam)
			addRadioButtonToGroup(cameraList, writable)->set_int_val(1);
		else
			addRadioButtonToGroup(cameraList, writable);

		delete[] writable;

	}
	addRadioButtonToGroup(cameraList, "Default");

	addColumnToPanel(geral);
	GLUI_Panel *drawPanel = addPanelToPanel(geral,"Draw Mode", 1);
	GLUI_RadioGroup *drawList = addRadioGroupToPanel(drawPanel,&(((ANFScene *) scene)->parser.globals->drawing.mode));
	addRadioButtonToGroup(drawList, "Fill");
	addRadioButtonToGroup(drawList, "Line");
	addRadioButtonToGroup(drawList, "Point");

	addColumnToPanel(geral);
	GLUI_Panel *windPanel = addPanelToPanel(geral,"Wind Value", 1);

	GLUI_Spinner *spinner = addSpinnerToPanel(windPanel, "windScale",GLUI_SPINNER_INT,&(((ANFScene *) scene)->parser.wind),9);
	
	spinner->set_speed(0.5);
	spinner->set_int_limits(0,10,GLUI_LIMIT_WRAP);

	
	GLUI_Panel *varPanel= addPanelToPanel(geral,"Animations", 1);
	addButtonToPanel(varPanel, "Reset", 8);
}