本文整理汇总了C++中GLUI::add_panel_to_panel方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUI::add_panel_to_panel方法的具体用法?C++ GLUI::add_panel_to_panel怎么用?C++ GLUI::add_panel_to_panel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLUI
的用法示例。
在下文中一共展示了GLUI::add_panel_to_panel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PCGetGluiSubwin
//////////////////// CGlutWin methods ////////////////////
void
CPCPView::_InitFunc()
{
_KeepUpdateOn();
/////////////////////////////////////////////
// set up GLUI
GLUI *pcGlui = PCGetGluiSubwin();
GLUI_Panel *pcPanel_Line = pcGlui->add_rollout("Line");
GLUI_Panel *pcPanel_Color = pcGlui->add_panel_to_panel(pcPanel_Line, "Color");
static char* pszChannels[] = {"R", "G", "B", "A"};
float *pfColor = &f4Color.x;
for(int c = 0; c < sizeof(pszChannels)/sizeof(pszChannels[0]); c++)
{
GLUI_Spinner* pcSpinner = pcGlui->add_spinner_to_panel(pcPanel_Color, pszChannels[c], GLUI_SPINNER_FLOAT, &pfColor[c]);
pcSpinner->set_float_limits(0.0f, 1.0f);
}
GLUI_Spinner* pcSpinner_Width = pcGlui->add_spinner_to_panel(pcPanel_Line, "Width", GLUI_SPINNER_FLOAT, &fWidth);
pcSpinner_Width->set_float_limits(1.0f, 16.0f);
cFilter._AddGlui(this, pcGlui, NULL, pcBlockTree->uMaxLevel + 1);
}
示例2: main
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); //double buffering, RGB mode, need depth buffer
glutInitWindowSize(WIDTH,HEIGHT); //width, height of the window
glutInitWindowPosition(0, 0); // location on the screen the window appears
window = glutCreateWindow("Project GUI"); // creates the window
init(); //things to do once, mostly in beginning
glutDisplayFunc(handleDisplay); // tells glut which function to call to render a screen.
glutMotionFunc(handleMotion); // handle when motion (this generally means when mouse is moved with a button pressed)
GLUI_Master.set_glutReshapeFunc( handleReshape );
//Setting opengl lights
GLfloat light0_ambient[] = {0.1f, 0.1f, 0.3f, 1.0f};
GLfloat light0_diffuse[] = {.6f, .6f, 1.0f, 1.0f};
GLfloat light0_position[] = {1.0f, 1.0f, 1.0f, 0.0f};
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
glEnable(GL_DEPTH_TEST); // enabling depth
GLUI *glui = GLUI_Master.create_glui_subwindow(window,
GLUI_SUBWINDOW_RIGHT);
new GLUI_StaticText( glui, "Project GLUI" );
new GLUI_Separator(glui);
glui->set_main_gfx_window( window );
GLUI_Panel *obj_panel = glui->add_panel ("Display option panel");
listbox = new GLUI_Listbox(obj_panel, "Mesh display option", &display_type, 1, controlBlock);
listbox->add_item(FLAT_SHADED, "Flat Shaded");
listbox->add_item(SMOOTH_SHADED, "Smooth Shaded");
listbox->add_item(WIREFRAME, "Wireframe");
listbox->add_item(EDGES_SHADED, "Shaded with mesh edges");
//scale code
GLUI_Spinner *scale_spinner = new GLUI_Spinner( obj_panel, "Scale:", &scale);
scale_spinner->set_float_limits( .2f, 5.0 );
scale_spinner->set_alignment( GLUI_ALIGN_RIGHT );
//rotation code
GLUI_Panel * rotation_panel = glui->add_panel_to_panel(obj_panel, "", GLUI_PANEL_NONE);
GLUI_Rotation *sph_rot =
glui->add_rotation_to_panel(rotation_panel,"Rotate", sphere_rotate,
ROTATION_ID, controlBlock);
sph_rot->set_spin(1.0);
//translation code
GLUI_Panel * translate_panel = glui->add_panel_to_panel(obj_panel, "",
GLUI_PANEL_NONE);
GLUI_Translation * move_z =
glui->add_translation_to_panel(translate_panel,"Object Z",
GLUI_TRANSLATION_Z, &obj_pos[2]);
move_z->scale_factor = 0.1f;
glui->add_column_to_panel(translate_panel, true);
GLUI_Translation * move_around =
glui->add_translation_to_panel(translate_panel,"Object XY",
GLUI_TRANSLATION_XY, obj_pos);
move_around->scale_factor = 0.1f;
GLUI_Panel * decimate_panel = glui->add_panel("Decimate Panel");
glui->add_edittext_to_panel(decimate_panel, "No. of collapse iteration: ", GLUI_EDITTEXT_INT, &collapseCount);
glui->add_edittext_to_panel(decimate_panel, "Random count (k): ", GLUI_EDITTEXT_INT, &KValue);
glui->add_button_to_panel(decimate_panel, "Decimate", DECIMATE_ID, controlBlock);
glui->add_button_to_panel(decimate_panel, "Shape Preserve", SHAPE_PRESERVE_DECIMATE_ID, controlBlock);
glui->add_separator();
GLUI_Panel * shape_panel = glui->add_panel("Shape based Panel");
glui->add_button_to_panel(shape_panel, "Go", SURE_SHAPE_PRESERVE_DECIMATE_ID, controlBlock);
glui->add_separator();
GLUI_Panel * mapping_panel = glui->add_panel("Mapping Panel");
glui->add_button_to_panel(mapping_panel, "Open map file", MAPPING_OPEN_ID, controlBlock);
//other details
glui->add_separator();
glui->add_button("Open", OPEN_ID, controlBlock);
glui->add_button("Save", SAVE_ID, controlBlock);
glui->add_button("Reset", RESET_ID, controlBlock);
glui->add_button("Quit", QUIT_ID, (GLUI_Update_CB)exit);
//.........这里部分代码省略.........
示例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);
//.........这里部分代码省略.........