本文整理汇总了C++中GLUI::add_radiobutton_to_group方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUI::add_radiobutton_to_group方法的具体用法?C++ GLUI::add_radiobutton_to_group怎么用?C++ GLUI::add_radiobutton_to_group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLUI
的用法示例。
在下文中一共展示了GLUI::add_radiobutton_to_group方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
atexit(onExit);
/****************************************/
/* Initialize GLUT and create window */
/****************************************/
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowPosition(50, 50);
glutInitWindowSize(500, 500);
main_window = glutCreateWindow("COMP 175 Assignment 2");
glutDisplayFunc(myGlutDisplay);
glutReshapeFunc(myGlutReshape);
/****************************************/
/* Set up OpenGL lighting */
/****************************************/
glClearColor (0.38, 0.38, 0.38, 0.0);
glShadeModel (GL_SMOOTH);
GLfloat light_pos0[] = {0.0f, 0.0f, 1.0f, 0.0f};
GLfloat diffuse[] = {0.5f, 0.5f, 0.5f, 0.0f};
GLfloat ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
glLightfv (GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv (GL_LIGHT0, GL_POSITION, light_pos0);
glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glEnable (GL_COLOR_MATERIAL);
glEnable(GL_LIGHTING);
glEnable (GL_LIGHT0);
glEnable (GL_DEPTH_TEST);
///****************************************/
///* Enable z-buferring */
///****************************************/
glPolygonOffset(1, 1);
/****************************************/
/* Here's the GLUI code */
/****************************************/
GLUI *glui = GLUI_Master.create_glui("GLUI");
GLUI_Panel *render_panel = glui->add_panel("Render");
new GLUI_Checkbox(render_panel, "Wireframe", &wireframe);
new GLUI_Checkbox(render_panel, "Fill", &fill);
new GLUI_Checkbox(render_panel, "Normal", &normal);
(new GLUI_Spinner(render_panel, "Segments X:", &segmentsX))
->set_int_limits(3, 60);
(new GLUI_Spinner(render_panel, "Segments Y:", &segmentsY))
->set_int_limits(3, 60);
GLUI_Panel *camera_panel = glui->add_panel("Camera");
(new GLUI_Spinner(camera_panel, "RotateV:", &camRotV))
->set_int_limits(-179, 179);
(new GLUI_Spinner(camera_panel, "RotateU:", &camRotU))
->set_int_limits(-179, 179);
(new GLUI_Spinner(camera_panel, "RotateW:", &camRotW))
->set_int_limits(-179, 179);
(new GLUI_Spinner(camera_panel, "Angle:", &viewAngle))
->set_int_limits(1, 179);
GLUI_Spinner* eyex_widget = glui->add_spinner_to_panel(camera_panel, "EyeX:", GLUI_SPINNER_FLOAT, &eyeX);
eyex_widget->set_float_limits(-5, 5);
GLUI_Spinner* eyey_widget = glui->add_spinner_to_panel(camera_panel, "EyeY:", GLUI_SPINNER_FLOAT, &eyeY);
eyey_widget->set_float_limits(-5, 5);
GLUI_Spinner* eyez_widget = glui->add_spinner_to_panel(camera_panel, "EyeZ:", GLUI_SPINNER_FLOAT, &eyeZ);
eyez_widget->set_float_limits(-5, 5);
GLUI_Spinner* lookx_widget = glui->add_spinner_to_panel(camera_panel, "LookX:", GLUI_SPINNER_FLOAT, &lookX);
lookx_widget->set_float_limits(-5, 5);
GLUI_Spinner* looky_widget = glui->add_spinner_to_panel(camera_panel, "LookY:", GLUI_SPINNER_FLOAT, &lookY);
looky_widget->set_float_limits(-5, 5);
GLUI_Spinner* lookz_widget = glui->add_spinner_to_panel(camera_panel, "LookZ:", GLUI_SPINNER_FLOAT, &lookZ);
lookz_widget->set_float_limits(-5, 5);
GLUI_Spinner* clipN_widget = glui->add_spinner_to_panel(camera_panel, "Near:", GLUI_SPINNER_FLOAT, &clipNear);
clipN_widget->set_float_limits(0, 10);
GLUI_Spinner* clipF_widget = glui->add_spinner_to_panel(camera_panel, "Far:", GLUI_SPINNER_FLOAT, &clipFar);
clipF_widget->set_float_limits(0, 100);
glui->add_column(true);
GLUI_Panel *obj_panel = glui->add_panel("Object Type");
GLUI_RadioGroup *group1 =
glui->add_radiogroup_to_panel(obj_panel, (int*)(&objType), 3, callback_obj);
glui->add_radiobutton_to_group(group1, "Cube");
glui->add_radiobutton_to_group(group1, "Cylinder");
//.........这里部分代码省略.........
示例2: setGlui
/**
* @brief UI設定関数
*/
void setGlui(void)
{
/* GLUIコントローラーの設定 */
GLUI * glui = GLUI_Master.create_glui("Control Panel", 0);
/* スリットサイズのテキストボックス追加 */
GLUI_EditText * editSlitWidth = new GLUI_EditText(glui, "Slit width (cm)", &slitWidth, NULL, inputChangeSlitWidth);
// 限界値とその処理
//editSlitWidth->set_float_limits(0.0, 1.0, GLUI_LIMIT_CLAMP);
// 初期値
editSlitWidth->set_float_val(0.3);
/* 移動スピードのテキストボックス追加 */
GLUI_EditText * editSlitSpeed = new GLUI_EditText(glui, "Slit speed (cm)/s", &slitSpeed, NULL, inputChangeSlitSpeed);
//editSlitSpeed->set_float_limits(0.0, 1.0, GLUI_LIMIT_CLAMP);
editSlitSpeed->set_float_val(18000);
// 仕切り線
glui->add_separator();
/* モード変更用のラジオボタン */
// テキスト
glui->add_statictext("Move select");
GLUI_RadioGroup * mode_radio = new GLUI_RadioGroup(glui, &mode);
// モード変更の項目設定
glui->add_radiobutton_to_group(mode_radio, "Slit Move");
glui->add_radiobutton_to_group(mode_radio, "Image Move");
// 仕切り線
glui->add_separator();
// スリット色変え
GLUI_RadioGroup * slit_mode_radio = new GLUI_RadioGroup(glui, &slitColor);
glui->add_radiobutton_to_group(slit_mode_radio, "Black");
glui->add_radiobutton_to_group(slit_mode_radio, "White");
glui->add_separator();
// 反復ボタン
new GLUI_Checkbox(glui, "Repetition", &repetition);
glui->add_separator();
/* 画像変更のラジオボタン */
glui->add_statictext("Image select");
GLUI_RadioGroup * imageMode_radio = new GLUI_RadioGroup(glui, &ImageMode);
glui->add_radiobutton_to_group(imageMode_radio, "Dromedary camel - Line drowing black");
glui->add_radiobutton_to_group(imageMode_radio, "Dromedary camel - Line drowing white");
glui->add_radiobutton_to_group(imageMode_radio, "Dromedary camel - Black");
glui->add_radiobutton_to_group(imageMode_radio, "Dromedary camel - White");
glui->add_radiobutton_to_group(imageMode_radio, "Bactrian camel - Line drowing black");
glui->add_radiobutton_to_group(imageMode_radio, "Bactrian camel - Line drowing white");
glui->add_radiobutton_to_group(imageMode_radio, "Bactrian camel - Black");
glui->add_radiobutton_to_group(imageMode_radio, "Bactrian camel - White");
glui->add_radiobutton_to_group(imageMode_radio, "Momotaro");
glui->add_radiobutton_to_group(imageMode_radio, "Circle");
glui->add_radiobutton_to_group(imageMode_radio, "Square");
glui->add_radiobutton_to_group(imageMode_radio, "triangle");
// 仕切り線
glui->add_separator();
/* exitボタン */
glui->add_button("Exit", 0, gluiCallBack);
// idlezコールバック関数はGLUIで登録
GLUI_Master.set_glutIdleFunc(NULL);
}
示例3: createInterface
void createInterface() {
GLUI *glui = GLUI_Master.create_glui("RGBD Effects", 0, 1050, 100);
//Effect Selection
GLUI_Panel *effectSelectionPanel = glui->add_panel("Effect");
GLUI_RadioGroup *effectRadioGroup = glui->add_radiogroup_to_panel(effectSelectionPanel, &selectedEffect, -1, gluiCallback);
glui->add_radiobutton_to_group(effectRadioGroup, "Maps");
glui->add_radiobutton_to_group(effectRadioGroup, "Fog");
glui->add_radiobutton_to_group(effectRadioGroup, "Depth of Field");
glui->add_radiobutton_to_group(effectRadioGroup, "Relighting");
glui->add_radiobutton_to_group(effectRadioGroup, "Cartoon Shading");
//Depth range
glui->add_statictext("");
GLUI_Panel *depthRangePanel = glui->add_panel("Depth Range");
GLUI_Checkbox *adaptiveDepthRangeCheckBox = glui->add_checkbox_to_panel(depthRangePanel, "Adaptive ", &adaptiveDepthRange, -1, gluiCallback);
GLUI_Spinner *nearPlaneSpinner = glui->add_spinner_to_panel(depthRangePanel, "Near Plane ", GLUI_SPINNER_FLOAT, &nearPlane, -1, gluiCallback);
nearPlaneSpinner->set_float_limits(10, 2000);
GLUI_Spinner *farPlaneSpinner = glui->add_spinner_to_panel(depthRangePanel, "Far Plane ", GLUI_SPINNER_FLOAT, &farPlane, -1, gluiCallback);
farPlaneSpinner->set_float_limits(10, 2000);
//View maps
GLUI_Rollout *mapRollout = glui->add_rollout("Maps", 0);
mapRollout->set_w(218);
glui->add_statictext_to_panel(mapRollout, "")->set_w(200);
GLUI_RadioGroup *mapRadioGroup = glui->add_radiogroup_to_panel(mapRollout, &mapEffect->selectedMap, -1, gluiCallback);
glui->add_radiobutton_to_group(mapRadioGroup, "Colour");
glui->add_radiobutton_to_group(mapRadioGroup, "Depth");
glui->add_radiobutton_to_group(mapRadioGroup, "Normals");
GLUI_Panel* mapPreblurPanel = glui->add_panel_to_panel(mapRollout, "Pre-processing");
GLUI_RadioGroup *mapPreblurRadioGroup = glui->add_radiogroup_to_panel(mapPreblurPanel, &mapEffect->selectedPreFilter, -1, gluiCallback);
glui->add_radiobutton_to_group(mapPreblurRadioGroup, "None");
glui->add_radiobutton_to_group(mapPreblurRadioGroup, "Blur");
glui->add_radiobutton_to_group(mapPreblurRadioGroup, "Bilateral");
GLUI_Spinner *mapPreblurPassesSpinner = glui->add_spinner_to_panel(mapPreblurPanel, "Filter Passes ", GLUI_SPINNER_INT, &mapEffect->preblurFilterPasses, -1, gluiCallback);
mapPreblurPassesSpinner->set_int_limits(0, 10);
GLUI_Spinner *mapPreblurKernelSizeSpinner = glui->add_spinner_to_panel(mapPreblurPanel, "Kernel Size ", GLUI_SPINNER_INT, &mapEffect->preblurKernelSize, -1, gluiCallback);
mapPreblurKernelSizeSpinner->set_int_limits(1, 100);
GLUI_Spinner *mapPreblurSigmaSpinner = glui->add_spinner_to_panel(mapPreblurPanel, "Sample Deviation ", GLUI_SPINNER_FLOAT, &mapEffect->preblurSigma, -1, gluiCallback);
mapPreblurSigmaSpinner->set_float_limits(0.001, 0.15);
//FOG
GLUI_Rollout *fogRollout = glui->add_rollout("Fog", 0);
fogRollout->set_w(218);
glui->add_statictext_to_panel(fogRollout, "")->set_w(200);
GLUI_Spinner *fogDensitySpinner = glui->add_spinner_to_panel(fogRollout, "Density ", GLUI_SPINNER_FLOAT, &fogEffect->fogDensity, -1, gluiCallback);
fogDensitySpinner->set_float_limits(0.0, 20.0);
GLUI_Spinner *fogAmountSpinner = glui->add_spinner_to_panel(fogRollout, "Amount ", GLUI_SPINNER_FLOAT, &fogEffect->fogAmount, -1, gluiCallback);
fogAmountSpinner->set_float_limits(0.0, 1);
glui->add_statictext_to_panel(fogRollout, "");
GLUI_Panel* fogPreblurPanel = glui->add_panel_to_panel(fogRollout, "Preblur");
GLUI_Spinner *fogPreblurPassesSpinner = glui->add_spinner_to_panel(fogPreblurPanel, "Filter Passes ", GLUI_SPINNER_INT, &fogEffect->preblurFilterPasses, -1, gluiCallback);
fogPreblurPassesSpinner->set_int_limits(0, 10);
GLUI_Spinner *fogPreblurKernelSizeSpinner = glui->add_spinner_to_panel(fogPreblurPanel, "Kernel Size ", GLUI_SPINNER_INT, &fogEffect->preblurKernelSize, -1, gluiCallback);
fogPreblurKernelSizeSpinner->set_int_limits(1, 100);
GLUI_Spinner *fogPreblurSigmaSpinner = glui->add_spinner_to_panel(fogPreblurPanel, "Sample Deviation ", GLUI_SPINNER_FLOAT, &fogEffect->preblurSigma, -1, gluiCallback);
fogPreblurSigmaSpinner->set_float_limits(0.001, 0.15);
glui->add_statictext_to_panel(fogRollout, "");
GLUI_Panel* fogColourPanel = glui->add_panel_to_panel(fogRollout, "Colour", GLUI_PANEL_EMBOSSED);
GLUI_Spinner *fogColourRedSpinner = glui->add_spinner_to_panel(fogColourPanel, "Red ", GLUI_SPINNER_FLOAT, &fogEffect->fogColourRed, -1, gluiCallback);
fogColourRedSpinner->set_float_limits(0.0, 1);
GLUI_Spinner *fogColourGreenSpinner = glui->add_spinner_to_panel(fogColourPanel, "Green ", GLUI_SPINNER_FLOAT, &fogEffect->fogColourGreen, -1, gluiCallback);
fogColourGreenSpinner->set_float_limits(0.0, 1);
GLUI_Spinner *fogColourBlueSpinner = glui->add_spinner_to_panel(fogColourPanel, "Blue ", GLUI_SPINNER_FLOAT, &fogEffect->fogColourBlue, -1, gluiCallback);
fogColourBlueSpinner->set_float_limits(0.0, 1);
//DEPTH OF FIELD
GLUI_Rollout *DOFRollout = glui->add_rollout("Depth of Field", 0);
DOFRollout->set_w(218);
glui->add_statictext_to_panel(DOFRollout, "")->set_w(200);
GLUI_Spinner *distributionSigmaSpinner = glui->add_spinner_to_panel(DOFRollout, "Sample Deviation ", GLUI_SPINNER_FLOAT, &dofEffect->distributionSigma, -1, gluiCallback);
distributionSigmaSpinner->set_float_limits(0.001, 0.15);
GLUI_Spinner *sampleRadiusSpinner = glui->add_spinner_to_panel(DOFRollout, "Sample Radius ", GLUI_SPINNER_INT, &dofEffect->sampleRadius, -1, gluiCallback);
sampleRadiusSpinner->set_int_limits(1, 40);
GLUI_Spinner *lensDiameterSpinner = glui->add_spinner_to_panel(DOFRollout, "Aperture Size ", GLUI_SPINNER_FLOAT, &dofEffect->lensDiameter, -1, gluiCallback);
lensDiameterSpinner->set_float_limits(0.001, 1);
GLUI_Spinner *focalLengthSpinner = glui->add_spinner_to_panel(DOFRollout, "Focal Length ", GLUI_SPINNER_FLOAT, &dofEffect->focalLength, -1, gluiCallback);
focalLengthSpinner->set_float_limits(0.001, 1);
GLUI_Spinner *focalDepthSpinner = glui->add_spinner_to_panel(DOFRollout, "Focal Depth ", GLUI_SPINNER_FLOAT, &dofEffect->focalPlaneDepth, -1, gluiCallback);
focalDepthSpinner->set_float_limits(0.0, 1);
glui->add_statictext_to_panel(DOFRollout, "");
GLUI_Panel* DOFPreblurPanel = glui->add_panel_to_panel(DOFRollout, "Preblur");
GLUI_Spinner *DOFPreblurPassesSpinner = glui->add_spinner_to_panel(DOFPreblurPanel, "Filter Passes ", GLUI_SPINNER_INT, &dofEffect->preblurFilterPasses, -1, gluiCallback);
DOFPreblurPassesSpinner->set_int_limits(0, 10);
//.........这里部分代码省略.........
示例4: initGlui
// initialize GLUI
int MeshGui::initGlui(void)
{
// create the side subwindow
GLUI *glui = GLUI_Master.create_glui_subwindow(main_window, GLUI_SUBWINDOW_RIGHT);
// radio button group
GLUI_RadioGroup *ot_group = new GLUI_RadioGroup (glui, &radiogroup_item_id, SHADING_MODE, control_cb);
// shading choices
glui->add_radiobutton_to_group( ot_group, "flatShaded" );
glui->add_radiobutton_to_group( ot_group, "smoothShaded" );
glui->add_radiobutton_to_group( ot_group, "wireframe" );
glui->add_radiobutton_to_group( ot_group, "shadedEdges" );
glui->add_radiobutton_to_group( ot_group, "point" );
// load and save smf file
new GLUI_EditText (glui, "smf/", GLUI_EDITTEXT_TEXT, filetext, INPUT_FILE, control_cb);
new GLUI_Button( glui, "open", OPEN_MESH, control_cb );
new GLUI_Button( glui, "save", SAVE_MESH, control_cb );
// A 'quit' button
new GLUI_Button( glui, "Quit", 0,(GLUI_Update_CB)exit );
// some controls for lights
//GLUI_Rollout *roll_lights = new GLUI_Rollout(glui, "Lights", false);
GLUI_Panel *light0 = new GLUI_Panel( glui, "Light 0" );
GLUI_Panel *light1 = new GLUI_Panel( glui, "Light 1" );
new GLUI_Checkbox( light0, "Enabled", &light0_enabled, LIGHT0_ENABLE, control_cb );
light0_spinner = new GLUI_Spinner( light0, "Intensity:", &light0_intensity, LIGHT0_INTENSITY, control_cb );
light0_spinner->set_float_limits( 0.0, 1.0 );
GLUI_Scrollbar *sb;
sb = new GLUI_Scrollbar( light0, "Red",GLUI_SCROLL_HORIZONTAL, &light0_diffuse[0],LIGHT0_INTENSITY,control_cb);
sb->set_float_limits(0,1);
sb = new GLUI_Scrollbar( light0, "Green",GLUI_SCROLL_HORIZONTAL, &light0_diffuse[1],LIGHT0_INTENSITY,control_cb);
sb->set_float_limits(0,1);
sb = new GLUI_Scrollbar( light0, "Blue",GLUI_SCROLL_HORIZONTAL, &light0_diffuse[2],LIGHT0_INTENSITY,control_cb);
sb->set_float_limits(0,1);
new GLUI_Checkbox( light1, "Enabled", &light1_enabled, LIGHT1_ENABLE, control_cb );
light1_spinner = new GLUI_Spinner( light1, "Intensity:", &light1_intensity, LIGHT1_INTENSITY, control_cb );
light1_spinner->set_float_limits( 0.0, 1.0 );
sb = new GLUI_Scrollbar( light1, "Red",GLUI_SCROLL_HORIZONTAL, &light1_diffuse[0],LIGHT1_INTENSITY,control_cb);
sb->set_float_limits(0,1);
sb = new GLUI_Scrollbar( light1, "Green",GLUI_SCROLL_HORIZONTAL, &light1_diffuse[1],LIGHT1_INTENSITY,control_cb);
sb->set_float_limits(0,1);
sb = new GLUI_Scrollbar( light1, "Blue",GLUI_SCROLL_HORIZONTAL, &light1_diffuse[2],LIGHT1_INTENSITY,control_cb);
sb->set_float_limits(0,1);
// edge number to randomly choose from
GLUI_Spinner *edge_spinner = new GLUI_Spinner(glui, "EdgeNumber", &edge_number, EDGE_NUMBER, control_cb );
edge_spinner->set_float_limits(2, 100);
// edge percentage to collapse
GLUI_Spinner *percentage_spinner = new GLUI_Spinner(glui, "CollapsePercentage%", &collapse_percentage, COLLAPSE_NUMBER, control_cb );
percentage_spinner->set_float_limits(1, 100);
new GLUI_Button(glui, "decimate", DECIMATE, control_cb );
// Link windows to GLUI, and register idle callback
glui->set_main_gfx_window( main_window );
// Create the bottom subwindow
GLUI *glui2 = GLUI_Master.create_glui_subwindow( main_window, GLUI_SUBWINDOW_BOTTOM );
glui2->set_main_gfx_window( main_window );
// rotate the world
GLUI_Rotation *view_rot = new GLUI_Rotation(glui2, "Objects", view_rotate );
view_rot->set_spin( 1.0 );
// rotate the model
new GLUI_Column( glui2, false );
GLUI_Rotation *sph_rot = new GLUI_Rotation(glui2, "Model", mesh_rotate );
sph_rot->set_spin( .98 );
// rotate the blue light
new GLUI_Column( glui2, false );
GLUI_Rotation *lights_rot = new GLUI_Rotation(glui2, "Blue Light", lights_rotation );
lights_rot->set_spin( .82 );
// object XY translate
new GLUI_Column( glui2, false );
GLUI_Translation *trans_xy = new GLUI_Translation(glui2, "Objects XY", GLUI_TRANSLATION_XY, obj_pos );
trans_xy->set_speed( .005 );
// object X translate
new GLUI_Column( glui2, false );
GLUI_Translation *trans_x = new GLUI_Translation(glui2, "Objects X", GLUI_TRANSLATION_X, obj_pos );
trans_x->set_speed( .005 );
// object Y translate
new GLUI_Column( glui2, false );
GLUI_Translation *trans_y = new GLUI_Translation( glui2, "Objects Y", GLUI_TRANSLATION_Y, &obj_pos[1] );
trans_y->set_speed( .005 );
// object y translate
new GLUI_Column( glui2, false );
GLUI_Translation *trans_z = new GLUI_Translation( glui2, "Objects Z", GLUI_TRANSLATION_Z, &obj_pos[2] );
trans_z->set_speed( .005 );
return EXIT_SUCCESS;
}