GLMotif::PopupMenu* VruiAppTemplate::createMainMenu(void)
	{
	/* Create a popup shell to hold the main menu: */
	GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
	mainMenuPopup->setTitle("Vrui App Template");
	
	/* Create the main menu itself: */
	GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
	
	/* Create a button: */
	GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation");
	
	/* Add a callback to the button: */
	resetNavigationButton->getSelectCallbacks().add(this,&VruiAppTemplate::resetNavigationCallback);
	
	/*********************************************************************
	Enable the following code to create a submenu to change rendering
	modes:
	*********************************************************************/
	
	#if 1
	
	/* Create a cascade button to show the "Rendering Modes" submenu: */
	GLMotif::CascadeButton* renderingModesCascade=new GLMotif::CascadeButton("RenderingModesCascade",mainMenu,"Rendering Modes");
	renderingModesCascade->setPopup(createRenderingModesMenu());
	
	#endif
	
	/* Finish building the main menu: */
	mainMenu->manageChild();
	
	return mainMenuPopup;
	}
示例#2
0
GLMotif::PopupMenu* VideoViewer::createMainMenu(void)
{
    /* Create a popup shell to hold the main menu: */
    GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
    mainMenuPopup->setTitle("Video Viewer");

    /* Create the main menu itself: */
    GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);

    /* Create a button to reset navigation back to full-frame view: */
    GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation");
    resetNavigationButton->getSelectCallbacks().add(this,&VideoViewer::resetNavigationCallback);

    if(videoControlPanel!=0)
    {
        /* Create a button to pop up the video control panel: */
        GLMotif::Button* showControlPanelButton=new GLMotif::Button("ShowControlPanelButton",mainMenu,"Show Video Device Controls");
        showControlPanelButton->getSelectCallbacks().add(this,&VideoViewer::showControlPanelCallback);
    }

    /* Finish building the main menu: */
    mainMenu->manageChild();

    return mainMenuPopup;
}
示例#3
0
GLMotif::PopupMenu* KinectViewer::createMainMenu(void)
	{
	/* Create a popup shell to hold the main menu: */
	GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
	mainMenuPopup->setTitle("Kinect Viewer");
	
	/* Create the main menu itself: */
	GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
	
	/* Create a submenu for each Kinect streamer: */
	for(size_t i=0;i<streamers.size();++i)
		{
		/* Create the submenu's top-level shell: */
		GLMotif::Popup* streamerPopup=new GLMotif::Popup("StreamerPopup",Vrui::getWidgetManager());
		GLMotif::SubMenu* streamerMenu=new GLMotif::SubMenu("StreamerMenu",streamerPopup,false);
		
		/* Create a toggle button to enable / disable the streamer: */
		GLMotif::ToggleButton* enableToggle=new GLMotif::ToggleButton("EnableToggle",streamerMenu,"Enabled");
		enableToggle->setToggle(streamers[i]->enabled);
		enableToggle->getValueChangedCallbacks().add(this,&KinectViewer::enableStreamerCallback,i);
		
		/* Create a button to view from camera's point of view: */
		GLMotif::Button* viewCameraButton=new GLMotif::Button("ViewCameraButton",streamerMenu,"View from Camera");
		viewCameraButton->getSelectCallbacks().add(this,&KinectViewer::viewCameraCallback,i);
		
		/* Create a button to capture background frames: */
		GLMotif::Button* captureBackgroundButton=new GLMotif::Button("CaptureBackgroundButton",streamerMenu,"Capture Background");
		captureBackgroundButton->getSelectCallbacks().add(this,&KinectViewer::captureBackgroundCallback,i);
		
		/* Create a toggle button to enable/disable background removal: */
		GLMotif::ToggleButton* removeBackgroundToggle=new GLMotif::ToggleButton("RemoveBackgroundToggle",streamerMenu,"Remove Background");
		removeBackgroundToggle->setToggle(streamers[i]->camera->getRemoveBackground());
		removeBackgroundToggle->getValueChangedCallbacks().add(this,&KinectViewer::removeBackgroundCallback,i);
		
		streamerMenu->manageChild();
		
		/* Create a cascade button to show the Kinect streamer's submenu: */
		char streamerName[40];
		snprintf(streamerName,sizeof(streamerName),"StreamerCascade%u",(unsigned int)i);
		char streamerLabel[40];
		snprintf(streamerLabel,sizeof(streamerLabel),"Streamer %u",(unsigned int)(i+1));
		GLMotif::CascadeButton* streamerCascade=new GLMotif::CascadeButton(streamerName,mainMenu,streamerLabel);
		streamerCascade->setPopup(streamerPopup);
		}
	
	/* Finish building the main menu: */
	mainMenu->manageChild();
	
	return mainMenuPopup;
	}
示例#4
0
GLMotif::PopupMenu* CaveApp::createMainMenu() {

      /* Create a popup shell to hold the main menu */
    GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
    mainMenuPopup->setBorderWidth(0.0f);
    mainMenuPopup->setBorderType(GLMotif::Widget::RAISED);
    mainMenuPopup->setBorderColor(Vrui::getUiBgColor());
    mainMenuPopup->setBackgroundColor(Vrui::getUiBgColor());
    mainMenuPopup->setForegroundColor(Vrui::getUiFgColor());
    mainMenuPopup->setMarginWidth(Vrui::getUiSize());
    mainMenuPopup->setTitleSpacing(Vrui::getUiSize());
    mainMenuPopup->setTitle("NetVR",Vrui::getUiFont());
        
    /* Create the main menu itself */
    GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
    mainMenu->setBorderWidth(0.0f);
    mainMenu->setOrientation(GLMotif::Menu::VERTICAL);
    mainMenu->setNumMinorWidgets(1);
    mainMenu->setMarginWidth(0.0f);
    mainMenu->setSpacing(Vrui::getUiSize());

    /* Create buttons and assign callback methods */       
    GLMotif::CascadeButton* layoutTogglesCascade=new GLMotif::CascadeButton("LayoutTogglesCascade",
                                                                            mainMenu,
                                                                            "Layouts",
                                                                            Vrui::getUiFont());
    layoutTogglesCascade->setPopup(createLayoutTogglesMenu());

    GLMotif::CascadeButton* viewTogglesCascade=new GLMotif::CascadeButton("ViewTogglesCascade",
                                                                          mainMenu,
                                                                          "View",
                                                                          Vrui::getUiFont());
    viewTogglesCascade->setPopup(createViewTogglesMenu());


    GLMotif::CascadeButton* selectionTogglesCascade=new GLMotif::CascadeButton("SelectionTogglesCascade",
                                                                               mainMenu,
                                                                               "Node Selection",
                                                                               Vrui::getUiFont());
    selectionTogglesCascade->setPopup(createSelectionTogglesMenu());


    GLMotif::ToggleButton* showStudentInfoToggleButton=new GLMotif::ToggleButton("ShowStudentInfoToggleButton",
                                                                                 mainMenu,
                                                                                 "Show Student Info Dialog",
                                                                                 Vrui::getUiFont());

    GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation",Vrui::getUiFont());
    resetNavigationButton->getSelectCallbacks().add(this,&CaveApp::resetNavigationCallback);

    GLMotif::Button* quitApplicationButton=new GLMotif::Button("QuitApplicationButton",mainMenu,"Quit",Vrui::getUiFont());
    
    mainMenu->manageChild();
    return mainMenuPopup;
}
示例#5
0
GLMotif::PopupMenu* VruiDemo::createMainMenu(void)
	{
	/* Create a popup shell to hold the main menu: */
	GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
	mainMenuPopup->setTitle("Vrui Demonstration");
	
	/* Create the main menu itself: */
	GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
	
	/* Create a button: */
	GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation");
	
	/* Add a callback to the button: */
	resetNavigationButton->getSelectCallbacks().add(this,&VruiDemo::resetNavigationCallback);
	
	/* Finish building the main menu: */
	mainMenu->manageChild();
	
	return mainMenuPopup;
	}
示例#6
0
GLMotif::PopupMenu* VRMeshEditor::createMainMenu(void)
{
    GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
    mainMenuPopup->setBorderWidth(0.0f);
    mainMenuPopup->setBorderType(GLMotif::Widget::RAISED);
    mainMenuPopup->setBorderColor(Vrui::getUiBgColor());
    mainMenuPopup->setBackgroundColor(Vrui::getUiBgColor());
    mainMenuPopup->setForegroundColor(Vrui::getUiFgColor());
    mainMenuPopup->setMarginWidth(Vrui::getUiSize());
    mainMenuPopup->setTitleSpacing(Vrui::getUiSize());
    mainMenuPopup->setTitle("Liquid Metal Editing",Vrui::getUiFont());

    GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
    mainMenu->setBorderWidth(0.0f);
    mainMenu->setOrientation(GLMotif::RowColumn::VERTICAL);
    mainMenu->setNumMinorWidgets(1);
    mainMenu->setMarginWidth(0.0f);
    mainMenu->setSpacing(Vrui::getUiSize());

    GLMotif::Button* centerDisplayButton=new GLMotif::Button("CenterDisplayButton",mainMenu,"Center Display",Vrui::getUiFont());
    centerDisplayButton->getSelectCallbacks().add(this,&VRMeshEditor::centerDisplayCallback);

    GLMotif::CascadeButton* draggerTypesCascade=new GLMotif::CascadeButton("DraggerTypesCascade",mainMenu,"Dragger Types",Vrui::getUiFont());
    draggerTypesCascade->setPopup(createDraggerTypesMenu());

    GLMotif::CascadeButton* influenceActionsCascade=new GLMotif::CascadeButton("InfluenceActionsCascade",mainMenu,"Influence Actions",Vrui::getUiFont());
    influenceActionsCascade->setPopup(createInfluenceActionsMenu());

    GLMotif::Button* createMorphBoxButton=new GLMotif::Button("CreateMorphBoxButton",mainMenu,"Create Morph Box",Vrui::getUiFont());
    createMorphBoxButton->getSelectCallbacks().add(this,&VRMeshEditor::createMorphBoxCallback);

    GLMotif::Button* deleteMorphBoxButton=new GLMotif::Button("DeleteMorphBoxButton",mainMenu,"Delete Morph Box",Vrui::getUiFont());
    deleteMorphBoxButton->getSelectCallbacks().add(this,&VRMeshEditor::deleteMorphBoxCallback);

    GLMotif::CascadeButton* settingsCascade=new GLMotif::CascadeButton("SettingsCascade",mainMenu,"Settings",Vrui::getUiFont());
    settingsCascade->setPopup(createSettingsMenu());

    GLMotif::Button* createInputDeviceButton=new GLMotif::Button("CreateInputDeviceButton",mainMenu,"Create Input Device",Vrui::getUiFont());
    createInputDeviceButton->getSelectCallbacks().add(this,&VRMeshEditor::createInputDeviceCallback);

    mainMenu->manageChild();

    return mainMenuPopup;
}