Commit 08d60a7b authored by Jan Möbius's avatar Jan Möbius

ContextMenu and Menubar reorganization

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5234 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 09876ff5
......@@ -130,8 +130,11 @@ Core() :
//init ViewerProperties (always for 4 Viewers!)
std::vector< Viewer::ViewerProperties* > viewerProperties;
for (int i=0; i < 4; i++)
viewerProperties.push_back( new Viewer::ViewerProperties() );
for (int i=0; i < 4; i++) {
Viewer::ViewerProperties* viewerProperty = new Viewer::ViewerProperties();
viewerProperty->snapshotBaseFileName("snap-Viewer-" + QString::number(i) + ".png");
viewerProperties.push_back( viewerProperty );
}
PluginFunctions::setViewerProperties(viewerProperties);
......
......@@ -81,8 +81,137 @@ void CoreWidget::updatePopupMenuCoordsysNode(QMenu* _menu , const int _part) {
std::cerr << "Coordsys part was : " << _part << std::endl;
QAction* typeEntry = new QAction("Viewer Settings",_menu);
_menu->addAction( typeEntry );
_menu->addSeparator();
//====================================================================================================
// DrawModes
//====================================================================================================
slotUpdateViewerDrawMenu();
_menu->addMenu( viewerDrawMenu_ );
//====================================================================================================
// RenderingOptions
//====================================================================================================
QMenu* renderingOptionsMenu = new QMenu("Rendering Options",_menu);
renderingOptionsMenu->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"renderingOptions.png"));
_menu->addMenu(renderingOptionsMenu);
QAction* projectionAction = 0;
if ( examiner_widgets_[PluginFunctions::activeExaminer() ]->projectionMode() == glViewer::PERSPECTIVE_PROJECTION ) {
projectionAction = new QAction( "Switch to Orthogonal Projection", renderingOptionsMenu );
projectionAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"orthogonal.png") );
projectionAction->setToolTip( "Switch to perspective orthogonal mode.");
} else {
projectionAction = new QAction( "Switch to Perspective Projection", renderingOptionsMenu );
projectionAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"perspective.png") );
projectionAction->setToolTip( "Switch to perspective projection mode.");
}
projectionAction->setCheckable( false );
projectionAction->setToolTip( "Switch between <b>perspective</b> and "
"<b>parrallel</b> projection mode.");
projectionAction->setWhatsThis( "Switch projection modes<br><br>"
"Switch between <b>perspective</b> and "
"<b>parrallel</b> projection mode.");
connect( projectionAction,SIGNAL( triggered() ), this, SLOT( slotContextSwitchProjection() ) );
renderingOptionsMenu->addAction( projectionAction );
QAction* animation = renderingOptionsMenu->addAction("Animation");
animation->setToolTip("Animate rotation of objects");
animation->setCheckable( true );
animation->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"animation.png") );
animation->setChecked( PluginFunctions::viewerProperties(PluginFunctions::activeExaminer()).animation() );
connect(animation, SIGNAL(triggered(bool)), this , SLOT( slotLocalChangeAnimation(bool) ) );
//====================================================================================================
QAction* backfaceCulling = renderingOptionsMenu->addAction("Backface Culling");
backfaceCulling->setToolTip("Enable backface culling");
backfaceCulling->setCheckable( true );
backfaceCulling->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"backFaceCulling.png") );
backfaceCulling->setChecked( PluginFunctions::viewerProperties().backFaceCulling() );
connect(backfaceCulling, SIGNAL(triggered(bool)), this , SLOT( slotLocalChangeBackFaceCulling(bool) ) );
//====================================================================================================
QAction* twoSidedLighting = renderingOptionsMenu->addAction("Two-sided Lighting");
twoSidedLighting->setToolTip("Enable two-sided lighting");
twoSidedLighting->setCheckable( true );
twoSidedLighting->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"twosidedLighting.png") );
twoSidedLighting->setChecked( PluginFunctions::viewerProperties().twoSidedLighting() );
connect(twoSidedLighting, SIGNAL(triggered(bool)), this , SLOT( slotLocalChangeTwoSidedLighting(bool) ) );
//====================================================================================================
// Other Toplevel Action
//====================================================================================================
_menu->addSeparator();
//====================================================================================================
QAction* homeAction = new QAction("Restore home view",_menu);
homeAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"go-home.png") );
homeAction->setCheckable( false );
homeAction->setToolTip("Restore <b>home</b> view.");
homeAction->setWhatsThis( "Restore home view<br><br>"
"Resets the view to the home view");
_menu->addAction( homeAction );
connect( homeAction,SIGNAL( triggered() ), this, SLOT( slotContextHomeView() ) );
QAction* setHomeAction = new QAction( "Set Home View" , _menu );
setHomeAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"set-home.png") );
setHomeAction->setCheckable( false );
setHomeAction->setToolTip("Set <b>home</b> view");
setHomeAction->setWhatsThis( "Store home view<br><br>"
"Stores the current view as the home view");
_menu->addAction( setHomeAction);
connect( setHomeAction,SIGNAL( triggered() ), this, SLOT( slotContextSetHomeView() ) );
QAction* viewAllAction = new QAction( "View all", _menu );
viewAllAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"viewall.png") );
viewAllAction->setCheckable( false );
viewAllAction->setToolTip("View all.");
viewAllAction->setWhatsThis( "View all<br><br>"
"Move the objects in the scene so that"
" the whole scene is visible.");
connect( viewAllAction,SIGNAL( triggered() ), this, SLOT( slotContextViewAll() ) );
_menu->addAction( viewAllAction);
_menu->addSeparator();
//====================================================================================================
QAction* copyView = _menu->addAction("Copy View");
copyView->setToolTip("Copy current view to clipboard");
copyView->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"copyView.png") );
connect(copyView, SIGNAL(triggered()), this, SLOT(slotCopyView()) );
//====================================================================================================
QAction* pasteView = _menu->addAction("Paste View");
pasteView->setToolTip("Paste current view from clipboard");
pasteView->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"pasteView.png") );
connect(pasteView, SIGNAL(triggered()), this , SLOT( slotPasteView( ) ) );
//====================================================================================================
QAction* snapshot = _menu->addAction("Snapshot");
snapshot->setToolTip("Make a snapshot");
snapshot->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"snapshot.png") );
connect(snapshot, SIGNAL(triggered()), this, SLOT( slotSnapshot() ) );
//====================================================================================================
QAction* snapshotName = _menu->addAction("Set Snapshot Name");
snapshotName->setToolTip("Set a name for snapshots");
snapshotName->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"snapshotName.png") );
connect(snapshotName, SIGNAL(triggered()), this, SLOT(slotSnapshotName()) );
}
......@@ -103,7 +232,7 @@ void CoreWidget::updatePopupMenuBackground(QMenu* _menu , const QPoint& _point)
action->setStatusTip(tr("Set the background color for the current viewer"));
action->setWhatsThis(tr("Set the background color for the current viewer"));
action->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"BackgroundColor.png") );
connect(action, SIGNAL(triggered()), this, SLOT(slotSetLocalBackgroundColor()) );
connect(action, SIGNAL(triggered()), this, SLOT(slotSetContextBackgroundColor()) );
//====================================================================================================
......@@ -172,6 +301,7 @@ void CoreWidget::updatePopupMenu(const QPoint& _point) {
switch (context) {
case BACKGROUNDCONTEXT:
updatePopupMenuBackground(contextMenu_,_point);
return;
break;
case OBJECTCONTEXT:
typeEntry = new QAction("Object",contextMenu_);
......@@ -179,6 +309,7 @@ void CoreWidget::updatePopupMenu(const QPoint& _point) {
break;
case COORDSYSCONTEXT:
updatePopupMenuCoordsysNode(contextMenu_,target_idx);
return;
break;
}
......@@ -286,74 +417,9 @@ void CoreWidget::updatePopupMenu(const QPoint& _point) {
}
}
// Add a functions menu
QAction* action;
if ( functionMenu_ == 0 ){
functionMenu_ = new QMenu("&Functions",contextMenu_);
//====================================================================================================
action = functionMenu_->addAction("Snapshot");
action->setToolTip("Make a snapshot");
connect(action, SIGNAL(triggered()), this, SLOT( slotSnapshot() ) );
//====================================================================================================
action = functionMenu_->addAction("Set Snapshot Name");
action->setToolTip("Set a name for snapshots");
connect(action, SIGNAL(triggered()), this, SLOT(slotSnapshotName()) );
//====================================================================================================
functionMenu_->addSeparator();
//====================================================================================================
action = functionMenu_->addAction("Copy View");
action->setToolTip("Copy current view to clipboard");
connect(action, SIGNAL(triggered()), this, SLOT(slotCopyView()) );
//====================================================================================================
action = functionMenu_->addAction("Paste View");
action->setToolTip("Paste current view from clipboard");
connect(action, SIGNAL(triggered()), this , SLOT( slotPasteView( ) ) );
//====================================================================================================
functionMenu_->addSeparator();
//====================================================================================================
action = functionMenu_->addAction("Animation");
action->setToolTip("Animate rotation of objects");
action->setCheckable( true );
action->setChecked( PluginFunctions::viewerProperties().animation() );
connect(action, SIGNAL(triggered(bool)), this , SLOT( slotChangeAnimation(bool) ) );
//====================================================================================================
action = functionMenu_->addAction("Backface Culling");
action->setToolTip("Enable backface culling");
action->setCheckable( true );
action->setChecked( PluginFunctions::viewerProperties().backFaceCulling() );
connect(action, SIGNAL(triggered(bool)), this , SLOT( slotChangeBackFaceCulling(bool) ) );
//====================================================================================================
action = functionMenu_->addAction("Two-sided Lighting");
action->setToolTip("Enable two-sided lighting");
action->setCheckable( true );
action->setChecked( PluginFunctions::viewerProperties().twoSidedLighting() );
connect(action, SIGNAL(triggered(bool)), this , SLOT( slotChangeTwoSidedLighting(bool) ) );
functionMenu_->setTearOffEnabled(true);
}
contextMenu_->addMenu(functionMenu_ );
}
void CoreWidget::slotSnapshotName() {
std::cerr << "Todo : slotSnapShotName only sets name for current viewer" << std::endl;
......@@ -372,42 +438,6 @@ void CoreWidget::slotSnapshotName() {
}
void CoreWidget::slotChangeAnimation(bool _animation){
if ( shiftPressed_ ){
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).animation(_animation);
}else
PluginFunctions::viewerProperties().animation(_animation);
}
void CoreWidget::slotChangeBackFaceCulling(bool _backFaceCulling){
if ( shiftPressed_ ){
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).backFaceCulling(_backFaceCulling);
}else
PluginFunctions::viewerProperties().backFaceCulling(_backFaceCulling);
}
void CoreWidget::slotChangeTwoSidedLighting(bool _lighting){
if ( shiftPressed_ ){
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).twoSidedLighting(_lighting);
}else
PluginFunctions::viewerProperties().twoSidedLighting(_lighting);
}
void CoreWidget::slotSnapshot() {
examiner_widgets_[PluginFunctions::activeExaminer()]->snapshot();
}
void CoreWidget::slotPasteView( ) {
examiner_widgets_[PluginFunctions::activeExaminer()]->actionPasteView();
}
void CoreWidget::slotCopyView( ) {
examiner_widgets_[PluginFunctions::activeExaminer()]->actionCopyView();
}
void CoreWidget::slotAddContextMenu(QMenu* _menu) {
MenuInfo info;
info.menu = _menu;
......@@ -424,4 +454,86 @@ void CoreWidget::slotAddContextMenu( QMenu* _menu , DataType _dataType ,ContextM
contextMenus_.push_back(info);
}
void CoreWidget::slotUpdateViewerDrawMenu() {
if ( drawGroupViewer_ ) {
disconnect( drawGroupViewer_ , SIGNAL( triggered( QAction * ) ),
this , SLOT( slotViewerDrawMenu( QAction * ) ) );
delete( drawGroupViewer_ );
drawGroupViewer_ = 0;
}
// Recreate drawGroup
drawGroupViewer_ = new QActionGroup( this );
drawGroupViewer_->setExclusive( false );
connect( drawGroupViewer_ , SIGNAL( triggered( QAction * ) ),
this , SLOT( slotViewerDrawMenu( QAction * ) ) );
if ( !viewerDrawMenu_ ) {
QIcon icon;
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"drawModes.png");
viewerDrawMenu_ = new QMenu("Set Draw Mode");
viewerDrawMenu_->setTearOffEnabled(true);
viewerDrawMenu_->setIcon(icon);
connect(viewerDrawMenu_,SIGNAL(aboutToShow () ) , this, SLOT(slotUpdateGlobalDrawMenu() ) );
}
// Collect available draw Modes
ACG::SceneGraph::CollectDrawModesAction actionAvailable;
ACG::SceneGraph::traverse( PluginFunctions::getRootNode() , actionAvailable);
availableGlobalDrawModes_ = actionAvailable.drawModes();
// Get currently active drawModes (first viewer only )
// TODO: create combination from all viewers!
int activeDrawModes = PluginFunctions::drawMode();
// Convert to ids
std::vector< unsigned int > availDrawModeIds;
availDrawModeIds = ACG::SceneGraph::DrawModes::getDrawModeIDs( availableGlobalDrawModes_ );
viewerDrawMenu_->clear();
for ( unsigned int i = 0; i < availDrawModeIds.size(); ++i )
{
unsigned int id = availDrawModeIds[i];
std::string descr = ACG::SceneGraph::DrawModes::description( id );
QAction * action = new QAction( descr.c_str(), drawGroupViewer_ );
action->setCheckable( true );
action->setChecked( ACG::SceneGraph::DrawModes::containsId( activeDrawModes, id ) );
}
viewerDrawMenu_->addActions( drawGroupViewer_->actions() );
}
void CoreWidget::slotViewerDrawMenu(QAction * _action) {
//======================================================================================
// Get the mode toggled
//======================================================================================
unsigned int mode = 0;
std::vector< unsigned int > availDrawModeIds;
availDrawModeIds = ACG::SceneGraph::DrawModes::getDrawModeIDs( availableGlobalDrawModes_ );
for ( unsigned int i = 0; i < availDrawModeIds.size(); ++i )
{
QString descr = QString( ACG::SceneGraph::DrawModes::description( availDrawModeIds[i] ).c_str() );
if ( descr == _action->text() ) {
mode = availDrawModeIds[i];
break;
}
}
if ( qApp->keyboardModifiers() & Qt::ShiftModifier )
PluginFunctions::viewerProperties().drawMode( PluginFunctions::viewerProperties().drawMode() ^ mode );
else
PluginFunctions::viewerProperties().drawMode(mode );
}
//=============================================================================
......@@ -76,10 +76,10 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
helpMenu_(0),
sceneGraphDialog_(0),
fileMenu_(0),
viewMenu_(0),
viewMenu_(0),
toolsMenu_(0),
fileMenuEnd_(0),
stereoButton_(0),
projectionButton_(0),
moveButton_(0),
lightButton_(0),
pickButton_(0),
......@@ -87,11 +87,13 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
globalDrawMenu_(0),
drawGroup_(0),
viewGroup_(0),
perspectiveProjectionAction_(0),
activeDrawModes_(0),
availableGlobalDrawModes_(0),
contextMenu_(0),
functionMenu_(0),
contextSelectionMenu_(0),
drawGroupViewer_(0),
viewerDrawMenu_(0),
stackMenu_(0),
helpBrowserDeveloper_(0),
helpBrowserUser_(0),
......@@ -193,7 +195,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glViewer* examinerWidget = new glViewer(glScene_,
glWidget_,
PluginFunctions::viewerProperties(0),
PluginFunctions::viewerProperties(0),
centerWidget_,
"Examiner Widget",
statusBar_);
......@@ -211,7 +213,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
glViewer* newWidget = new glViewer(glScene_,
glWidget_,
PluginFunctions::viewerProperties(i),
PluginFunctions::viewerProperties(i),
centerWidget_,
"Examiner Widget",
statusBar_);
......@@ -333,95 +335,9 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
connect( questionButton_,SIGNAL( clicked() ), &PluginFunctions::viewerProperties(i), SLOT( setQuestionMode() ) );
viewerToolbar_->addWidget( questionButton_)->setText("Question");
viewerToolbar_->addSeparator();
QToolButton* homeButton = new QToolButton( viewerToolbar_ );
homeButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"go-home.png") );
homeButton->setMinimumSize( 16, 16 );
homeButton->setMaximumSize( 32, 32 );
homeButton->setCheckable( false );
homeButton->setToolTip("Restore <b>home</b> view.");
homeButton->setWhatsThis(
"Restore home view<br><br>"
"Resets the view to the home view");
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
connect( homeButton,SIGNAL( clicked() ), examiner_widgets_[i], SLOT( home() ) );
viewerToolbar_->addWidget( homeButton)->setText("Home");
QToolButton* setHomeButton = new QToolButton( viewerToolbar_ );
setHomeButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"set-home.png") );
setHomeButton->setMinimumSize( 16, 16 );
setHomeButton->setMaximumSize( 32, 32 );
setHomeButton->setCheckable( false );
setHomeButton->setToolTip("Set <b>home</b> view");
setHomeButton->setWhatsThis(
"Store home view<br><br>"
"Stores the current view as the home view");
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
connect( setHomeButton,SIGNAL( clicked() ), examiner_widgets_[i], SLOT( setHome() ) );
viewerToolbar_->addWidget( setHomeButton)->setText("Set Home");
QToolButton* viewAllButton = new QToolButton( viewerToolbar_ );
viewAllButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"viewall.png") );
viewAllButton->setMinimumSize( 16, 16 );
viewAllButton->setMaximumSize( 32, 32 );
viewAllButton->setCheckable( false );
viewAllButton->setToolTip("View all.");
viewAllButton->setWhatsThis(
"View all<br><br>"
"Move the objects in the scene so that"
" the whole scene is visible.");
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
connect( viewAllButton,SIGNAL( clicked() ), examiner_widgets_[i], SLOT( viewAll() ) );
viewerToolbar_->addWidget( viewAllButton)->setText("View all");
projectionButton_ = new QToolButton( viewerToolbar_ );
projectionButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"perspective.png") );
projectionButton_->setMinimumSize( 16, 16 );
projectionButton_->setMaximumSize( 32, 32 );
projectionButton_->setCheckable( false );
projectionButton_->setToolTip(
"Switch between <b>perspective</b> and "
"<b>parrallel</b> projection mode.");
projectionButton_->setWhatsThis(
"Switch projection modes<br><br>"
"Switch between <b>perspective</b> and "
"<b>parrallel</b> projection mode.");
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
connect( projectionButton_,SIGNAL( clicked() ), examiner_widgets_[i], SLOT( toggleProjectionMode() ) );
connect( examiner_widgets_[i],SIGNAL( projectionModeChanged( bool ) ), this , SLOT( slotProjectionModeChanged( bool ) ) );
}
viewerToolbar_->addWidget( projectionButton_)->setText( "Projection" );
viewerToolbar_->addSeparator();
QToolButton* sceneGraphButton = new QToolButton( viewerToolbar_ );
sceneGraphButton->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"scenegraph.png") );
sceneGraphButton->setMinimumSize( 16, 16 );
sceneGraphButton->setMaximumSize( 32, 32 );
sceneGraphButton->setCheckable( false );
sceneGraphButton->setToolTip("Toggle scene graph viewer.");
sceneGraphButton->setWhatsThis(
"Toggle scene graph viewer<br><br>"
"The scene graph viewer enables you to examine the "
"displayed scene graph and to modify certain nodes.<br><br>"
"There are three modi for the scene graph viewer:"
"<ul><li><b>hidden</b></li>"
"<li><b>split</b>: share space</li>"
"<li><b>dialog</b>: own dialog window</li></ul>"
"This button toggles between these modi.");
QObject::connect( sceneGraphButton, SIGNAL( clicked() ),
this, SLOT( slotShowSceneGraphDialog() ) );
viewerToolbar_->addWidget( sceneGraphButton)->setText( "SceneGraph" );
if (OpenFlipper::Options::stereo())
{
stereoButton_ = new QToolButton( viewerToolbar_ );
......
......@@ -465,6 +465,9 @@ public:
/// View Menu
QMenu *viewMenu_;
/// Tools Menu
QMenu *toolsMenu_;
/// First entry after all relevant parts of the File Menu
QAction* fileMenuEnd_;
......@@ -481,7 +484,6 @@ public:
int toolbarCount_;
QToolButton* stereoButton_;
QToolButton* projectionButton_;
QToolButton* moveButton_;
QToolButton* lightButton_;
QToolButton* pickButton_;
......@@ -501,6 +503,9 @@ public:
private slots:
/// Called when the global drawMode is selected
void slotGlobalDrawMenu(QAction * _action);
/// Called before the view Menu is shown
void slotViewMenuAboutToShow();
private:
/// This variable holds the global draw menu
......@@ -511,6 +516,9 @@ public:
/// Group for all menu items
QActionGroup* viewGroup_;
QAction* perspectiveProjectionAction_;
QAction* orthogonalProjectionAction_;
int activeDrawModes_;
int availableGlobalDrawModes_;
......@@ -536,15 +544,6 @@ public:
/// called by plugins to add a real context menu depending on DataType
void slotAddContextMenu( QMenu* _menu , DataType _dataType ,ContextMenuType type_);
/// change the animation setting
void slotChangeAnimation(bool _animation);
/// change the backFaceCulling setting
void slotChangeBackFaceCulling(bool _backFaceCulling);
/// change the twoSidedLighting setting
void slotChangeTwoSidedLighting(bool _lighting);
/// Paste the view to the last active examiner
void slotPasteView( );
......@@ -556,6 +555,12 @@ public:
/// Set the snapShot name for all examiners
void slotSnapshotName();
/// Called when a coordsys drawMode has been changed
void slotViewerDrawMenu( QAction * _action );
/// Creates a draw Menu for the currently active Viewer
void slotUpdateViewerDrawMenu();
private :
/** Update the contextmenu for the given position inside an examiner widget
......@@ -572,9 +577,6 @@ public:
/// context Menu for the gl area
QMenu* contextMenu_;
/// Function Menu
QMenu* functionMenu_;
/// Context Menu containing all selection elements
QMenu* contextSelectionMenu_;
......@@ -583,6 +585,12 @@ public:
/// All real context menu entries
std::vector< MenuInfo > contextMenus_;
/// DrawGroup for per Viewer Draw Modes
QActionGroup* drawGroupViewer_;
/// Draw Menu for per Viewer Draw Modes
QMenu* viewerDrawMenu_;
/** @} */
......@@ -738,20 +746,73 @@ public:
/// Enable or disable Stereo
void slotToggleStereoMode();
/// Change icons if the stereo mode has changed in the examiner
void slotProjectionModeChanged( bool _ortho );
/// Change Icons if action mode is changed in an examiner
void slotActionModeChanged( Viewer::ActionMode _mode );
/// Called when the functionMenu has to be updated
void slotFunctionMenuUpdate();
/// Set Background Color for all viewers at once.
void slotSetGlobalBackgroundColor();
/// Set Background Color for one viewer.
void slotSetLocalBackgroundColor();
void slotSetContextBackgroundColor();
/// Set the active viewer to home position
void slotContextHomeView();
/// Set the viewer to home position
void slotGlobalHomeView();
/// Set the active viewers home position
void slotContextSetHomeView();
/// Set the home position for all viewers
void slotGlobalSetHomeView();
/// Change view on active viewer to view complete scene
void slotContextViewAll();
/// Change view on all viewers to view complete scene
void slotGlobalViewAll();
/// Toggle projection Mode of the active viewer.
void slotContextSwitchProjection();
/// Toggle projection Mode of all viewers to perspective projection
void slotGlobalPerspectiveProjection();
/// Toggle projection Mode of all viewers to orthographic projection
void slotGlobalOrthographicProjection();
/// Set the animation Mode for all viewers
void slotGlobalChangeAnimation(bool _animation);
/// Set the animation Mode for active viewer
void slotLocalChangeAnimation(bool _animation);
/// Set Backface culling for all viewers
void slotGlobalChangeBackFaceCulling(bool _backFaceCulling);
/// Set Backface culling for active viewer
void slotLocalChangeBackFaceCulling(bool _backFaceCulling);
/// Set two sided lighting for all viewers
void slotGlobalChangeTwoSidedLighting(bool _lighting);
/// Set two sided lighting for active viewer
void slotLocalChangeTwoSidedLighting(bool _lighting);
private :
bool stereoActive_;
......
......@@ -81,27 +81,12 @@ void CoreWidget::setupMenuBar()
// ======================================================================
fileMenu_ = new QMenu(tr("&File"));
menuBar()->addMenu(fileMenu_ );
viewMenu_ = new QMenu(tr("&View"));
menuBar()->addMenu(viewMenu_ );
QIcon icon;
QAction* setGlobalBackgroundColor = new QAction(tr("&Background Color"), this);;
setGlobalBackgroundColor->setToolTip(tr("Set Background Color for all viewers"));
setGlobalBackgroundColor->setStatusTip(tr("Set Background Color for all viewers"));