当前位置: 首页>>代码示例>>C++>>正文


C++ GLUI_Spinner::set_int_val方法代码示例

本文整理汇总了C++中GLUI_Spinner::set_int_val方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUI_Spinner::set_int_val方法的具体用法?C++ GLUI_Spinner::set_int_val怎么用?C++ GLUI_Spinner::set_int_val使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GLUI_Spinner的用法示例。


在下文中一共展示了GLUI_Spinner::set_int_val方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
		(panel[1], "Mesh Detail", GLUI_SPINNER_FLOAT,
		&meshPrecision, -1, changeMeshPrecision);
	meshPrecisionSpinner->set_float_limits(0.01, 10);
#endif

#ifdef TRACK
	GLUI_RadioGroup* shapeRadioGroup = new GLUI_RadioGroup(panel[1],
		&trackShape, 0, changeTrackShape);
	new GLUI_RadioButton(shapeRadioGroup, "Line");
	new GLUI_RadioButton(shapeRadioGroup, "Tube");
	new GLUI_RadioButton(shapeRadioGroup, "Superquadric");

	GLUI_RadioGroup* encodingRadioGroup = new GLUI_RadioGroup(panel[1],
		&tractEncoding, 0, changeTractEncoding);
	new GLUI_RadioButton(encodingRadioGroup, "Boy's");
	new GLUI_RadioButton(encodingRadioGroup, "Color");
	new GLUI_RadioButton(encodingRadioGroup, "Size");
	new GLUI_RadioButton(encodingRadioGroup, "Texture");

	tubeParameterPanel = new GLUI_Panel(panel[1], "Tube Parameters");
	new GLUI_StaticText(tubeParameterPanel, "Tube Radius");
	GLUI_Scrollbar* tubeRadiusSlider = new GLUI_Scrollbar
		(tubeParameterPanel, "Tube Radius", GLUI_SCROLL_HORIZONTAL,
		&(track.mTrackRadius), -1, reRender);
	tubeRadiusSlider->set_float_limits(0, 1);
	GLUI_Spinner* boxOpacitySpinner = new GLUI_Spinner(
		tubeParameterPanel, "Opacity Index", GLUI_SPINNER_INT,
		&boxOpacityIndex, -1, reRender);
	boxOpacitySpinner->set_int_limits(0, 2);
	GLUI_Spinner* trackFaceSpinner = new GLUI_Spinner(
		tubeParameterPanel, "Number Faces", GLUI_SPINNER_INT,
		&trackFaces, -1, changeTrackShape);
	trackFaceSpinner->set_int_limits(2, 20);
	trackFaceSpinner->set_int_val(track.GetNumberFaces());
#endif

	// ssao pass
	panel[2] = new GLUI_Panel(glui, "SSAO Pass");
	new GLUI_Button(panel[2], "Reset", 1, resetRenderingParameters);
	new GLUI_StaticText(panel[2], "Sample Radius");
	GLUI_Scrollbar* sampleRadiusSlider = new GLUI_Scrollbar
		(panel[2], "Sample Radius", GLUI_SCROLL_HORIZONTAL,
		&(ssaoPass.mSampleRadius), -1, reRender);
	sampleRadiusSlider->set_float_limits(0, 100);
	new GLUI_StaticText(panel[2], "Occlusion Power");
	GLUI_Scrollbar* occulusioPowerSlider = new GLUI_Scrollbar
		(panel[2], "Occlusion Power", GLUI_SCROLL_HORIZONTAL,
		&(ssaoPass.mOcclusionPower), -1, reRender);
	occulusioPowerSlider->set_float_limits(0, 4);

	// blur pass
	panel[3] = new GLUI_Panel(glui, "Blur Pass");
	new GLUI_Button(panel[3], "Reset", 2, resetRenderingParameters);
	GLUI_Spinner* blurRadiusSpinner = new GLUI_Spinner
		(panel[3], "Blur Radius (Pixel)", GLUI_SPINNER_INT,
		&(blurPass.mBlurRadius), -1, reRender);
	blurRadiusSpinner->set_int_limits(0, 20);

	// lighting pass
	lightingPass.mAmbient = 0.4;
	lightingPass.mDiffuse = 0.6;
	lightingPass.mSpecular = 0;
	lightingPass.mUseSsao = 1;
	panel[4] = new GLUI_Panel(glui, "Lighting Pass");
	new GLUI_Button(panel[4], "Reset", 3, resetRenderingParameters);
	new GLUI_Checkbox(panel[4], "Normalize Intensity",
开发者ID:edgeofmoon,项目名称:Rendering,代码行数:67,代码来源:parameterTest.cpp

示例2: UpdateDriverSpinnerGUI

 void UpdateDriverSpinnerGUI()
 {
   driver_spinner->set_int_val(cur_driver);
   //driver_spinner->set_int_val(cur_driver);
   UpdateDriverInfoGUI();
 }
开发者ID:panjia1983,项目名称:Klampt,代码行数:6,代码来源:test.cpp

示例3: main

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);  
	glutInitWindowPosition(50, 50);
	glutInitWindowSize(WIN_WIDTH, WIN_HEIGHT);

	main_window = glutCreateWindow("OBJ Loader");
	glutDisplayFunc(myGlutDisplay);
	glutReshapeFunc(myGlutReshape);  
	glutMouseFunc(myGlutMouse);
	glutMotionFunc(myGlutMotion);

	initScene();
	Objects.push_back(Object());

	glui = GLUI_Master.create_glui("OBJ Loader GUI", 0, 600, 50);

	GLUI_Panel *objPanel = glui->add_panel("");
	GLUI_Panel *objPanel2 = glui->add_panel_to_panel(objPanel, "", 0);
	objFileNameTextField = glui->add_edittext_to_panel(objPanel2, "Filename:",GLUI_EDITTEXT_TEXT,NULL,OBJ_TEXTFIELD,textCB);
	objFileNameTextField->set_text("cow");
	glui->add_button_to_panel(objPanel2, "Load", LOAD_BUTTON, buttonCB);
	glui->add_button_to_panel(objPanel2, "Screenshot (or it didn't happen)", SCREENSHOT, buttonCB);

	glui->add_column_to_panel(objPanel, 0);

	GLUI_Panel *projPanel = glui->add_panel_to_panel(objPanel, "", 0);
	GLUI_RadioGroup *projGroup = glui->add_radiogroup_to_panel(projPanel, (int*) &projType, -1, projCB);
	glui->add_radiobutton_to_group(projGroup, "Orthographic");
	glui->add_radiobutton_to_group(projGroup, "Perspective");
	projGroup->set_int_val(ORTHO);

	GLUI_Spinner *fovSpinner = glui->add_spinner_to_panel(projPanel, "FOV", GLUI_SPINNER_INT, &fov, FOV, projCB);
	fovSpinner->set_int_limits(FOVMIN, FOVMAX);
	fovSpinner->set_int_val(30);

	glui->add_column_to_panel(projPanel, 0);

	GLUI_Translation *scale = glui->add_translation_to_panel(projPanel, "Scale", GLUI_TRANSLATION_Y , &scaleFactor, -1, (GLUI_Update_CB) projCB);
	scale->set_speed(0.005f);

	GLUI_Panel *lightingPanel = glui->add_panel("", 0);

	GLUI_Panel *objMaterialPanel = glui->add_panel_to_panel(lightingPanel, "Object material");

	GLUI_Panel *objDiffusePanel = glui->add_panel_to_panel(objMaterialPanel, "Diffuse");
	GLUI_Spinner *kdRedValue = glui->add_spinner_to_panel(objDiffusePanel, "Red", GLUI_SPINNER_FLOAT, &objectMat.diffuse[0], 0, colorCB);
	kdRedValue->set_float_limits(0.f, 1.f);
	kdRedValue->set_float_val(1.f);
	GLUI_Spinner *kdGreenValue = glui->add_spinner_to_panel(objDiffusePanel, "Green", GLUI_SPINNER_FLOAT, &objectMat.diffuse[1], 0, colorCB);
	kdGreenValue->set_float_limits(0.f, 1.f);
	kdGreenValue->set_float_val(1.f);
	GLUI_Spinner *kdBlueValue = glui->add_spinner_to_panel(objDiffusePanel, "Blue", GLUI_SPINNER_FLOAT, &objectMat.diffuse[2], 0, colorCB);
	kdBlueValue->set_float_limits(0.f, 1.f);
	kdBlueValue->set_float_val(1.f);

	GLUI_Panel *objAmbientPanel = glui->add_panel_to_panel(objMaterialPanel, "Ambient");
	GLUI_Spinner *kaRedValue = glui->add_spinner_to_panel(objAmbientPanel, "Red", GLUI_SPINNER_FLOAT, &objectMat.ambient[0], 0, colorCB);
	kaRedValue->set_float_limits(0.f, 1.f);
	kaRedValue->set_float_val(1.f);
	GLUI_Spinner *kaGreenValue = glui->add_spinner_to_panel(objAmbientPanel, "Green", GLUI_SPINNER_FLOAT, &objectMat.ambient[1], 0, colorCB);
	kaGreenValue->set_float_limits(0.f, 1.f);
	kaGreenValue->set_float_val(1.f);
	GLUI_Spinner *kaBlueValue = glui->add_spinner_to_panel(objAmbientPanel, "Blue", GLUI_SPINNER_FLOAT, &objectMat.ambient[2], 0, colorCB);
	kaBlueValue->set_float_limits(0.f, 1.f);
	kaBlueValue->set_float_val(1.f);

	GLUI_Panel *objSpecularPanel = glui->add_panel_to_panel(objMaterialPanel, "Specular");
	GLUI_Spinner *ksRedValue = glui->add_spinner_to_panel(objSpecularPanel, "Red", GLUI_SPINNER_FLOAT, &objectMat.specular[0], 0, colorCB);
	ksRedValue->set_float_limits(0.f, 1.f);
	ksRedValue->set_float_val(1.f);
	GLUI_Spinner *ksGreenValue = glui->add_spinner_to_panel(objSpecularPanel, "Green", GLUI_SPINNER_FLOAT, &objectMat.specular[1], 0, colorCB);
	ksGreenValue->set_float_limits(0.f, 1.f);
	ksGreenValue->set_float_val(1.f);
	GLUI_Spinner *ksBlueValue = glui->add_spinner_to_panel(objSpecularPanel, "Blue", GLUI_SPINNER_FLOAT, &objectMat.specular[2], 0, colorCB);
	ksBlueValue->set_float_limits(0.f, 1.f);
	ksBlueValue->set_float_val(1.f);

	glui->add_column_to_panel(lightingPanel,0);
	GLUI_Panel *lightPanel = glui->add_panel_to_panel(lightingPanel, "Light source");

	GLUI_Panel *lightDiffusePanel = glui->add_panel_to_panel(lightPanel, "Diffuse");
	GLUI_Spinner *ldRedValue = glui->add_spinner_to_panel(lightDiffusePanel, "Red", GLUI_SPINNER_FLOAT, &lightCoeffs.diffuse[0], -1, colorCB);
	ldRedValue->set_float_limits(0.f, 1.f);
	ldRedValue->set_float_val(1.f);
	GLUI_Spinner *ldGreenValue = glui->add_spinner_to_panel(lightDiffusePanel, "Green", GLUI_SPINNER_FLOAT, &lightCoeffs.diffuse[1], -1, colorCB);
	ldGreenValue->set_float_limits(0.f, 1.f);
	ldGreenValue->set_float_val(1.f);
	GLUI_Spinner *ldBlueValue = glui->add_spinner_to_panel(lightDiffusePanel, "Blue", GLUI_SPINNER_FLOAT, &lightCoeffs.diffuse[2], -1, colorCB);
	ldBlueValue->set_float_limits(0.f, 1.f);
	ldBlueValue->set_float_val(1.f);

	GLUI_Panel *lightAmbientPanel = glui->add_panel_to_panel(lightPanel, "Ambient");
	GLUI_Spinner *laRedValue = glui->add_spinner_to_panel(lightAmbientPanel, "Red", GLUI_SPINNER_FLOAT, &lightCoeffs.ambient[0], -1, colorCB);
	laRedValue->set_float_limits(0.f, 1.f);
	laRedValue->set_float_val(1.f);
	GLUI_Spinner *laGreenValue = glui->add_spinner_to_panel(lightAmbientPanel, "Green", GLUI_SPINNER_FLOAT, &lightCoeffs.ambient[1], -1, colorCB);
	laGreenValue->set_float_limits(0.f, 1.f);
	laGreenValue->set_float_val(1.f);
//.........这里部分代码省略.........
开发者ID:russellhaering,项目名称:cs450-project4,代码行数:101,代码来源:prog4.cpp

示例4: UpdateLinkSpinnerGUI

 void UpdateLinkSpinnerGUI()
 {
   link_spinner->set_int_val(cur_link);
   UpdateLinkInfoGUI();
   //driver_spinner->set_int_val(cur_driver);
 }
开发者ID:panjia1983,项目名称:Klampt,代码行数:6,代码来源:test.cpp


注:本文中的GLUI_Spinner::set_int_val方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。