Commit 495b0f99 authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt
Browse files

Removed confusing chekboxes in global rendering menu

Added entry in global rendering menu to globally set mipmapping
Fixed a few documentation typos

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9999 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 34c841f4
......@@ -633,17 +633,20 @@ public:
QAction* perspectiveProjectionAction_;
QAction* orthogonalProjectionAction_;
/// Action to globally set Animation
/// Action to globally set animation
QAction* globalAnimationAction_;
/// Action to globally set backface culling
QAction* globalBackfaceCullingAction_;
/// Action to globally set Two-Sided lighting
/// Action to globally set two-sided lighting
QAction* globalTwosidedLightingAction_;
/// Action to globally set multisampling
QAction* globalMultisamplingAction_;
/// Action to globally set mipmapping
QAction* globalMipmappingAction_;
ACG::SceneGraph::DrawModes::DrawMode activeDrawModes_;
......@@ -978,55 +981,76 @@ public:
void slotGlobalViewAll();
/// Toggle projection Mode of the active viewer.
/// Toggle projection mode of the active viewer.
void slotContextSwitchProjection();
/// Toggle projection Mode of all viewers to perspective projection
/// Toggle projection mode of all viewers to perspective projection
void slotGlobalPerspectiveProjection();
/// Toggle projection Mode of all viewers to orthographic projection
/// Toggle projection mode of all viewers to orthographic projection
void slotGlobalOrthographicProjection();
/// Change the Viewing direction from context-menu
/// Change the viewing direction from context-menu
void slotSetViewingDirection(QAction* _action);
/// Lock rotation in current examiner widget
void slotLockRotation(bool _lock);
/// Set the animation Mode for all viewers
/// If animation is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void slotGlobalToggleAnimation();
/// Set the animation mode for all viewers
void slotGlobalChangeAnimation(bool _animation);
/// Set the animation Mode for active viewer
/// Set the animation mode for active viewer
void slotLocalChangeAnimation(bool _animation);
/// If backface culling is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void slotGlobalToggleBackFaceCulling();
/// Set Backface culling for all viewers
/// Set backface culling for all viewers
void slotGlobalChangeBackFaceCulling(bool _backFaceCulling);
/// Set Backface culling for active viewer
/// Set backface culling for active viewer
void slotLocalChangeBackFaceCulling(bool _backFaceCulling);
/// Set two sided lighting for all viewers
/// If two-sided lighting is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void slotGlobalToggleTwoSidedLighting();
/// Set two-sided lighting for all viewers
void slotGlobalChangeTwoSidedLighting(bool _lighting);
/// Set two sided lighting for active viewer
/// Set two-sided lighting for active viewer
void slotLocalChangeTwoSidedLighting(bool _lighting);
/// Set Multisampling for all viewers
void slotGlobalChangeMultisampling(bool _multisampling);
/// If multisampling is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void slotGlobalToggleMultisampling();
/// Set Mipmapping for all viewers
void slotLocalChangeMipmapping(bool _mipmapping);
/// Set multisampling for all viewers
void slotGlobalChangeMultisampling(bool _multisampling);
/// Set Multisampling for active viewer
/// Set multisampling for active viewer
void slotLocalChangeMultisampling(bool _multisampling);
/// If mipmapping is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void slotGlobalToggleMipmapping();
/// Set mipmapping for all viewers
void slotGlobalChangeMipmapping(bool _multisampling);
/// Set mipmapping for active viewer
void slotLocalChangeMipmapping(bool _mipmapping);
/// When using first person mode move backward
void moveBack();
......
......@@ -236,7 +236,7 @@ void CoreWidget::setupMenuBar()
// Rendering options Menu
//============================================================================================================
QMenu* renderingOptionsMenu = new QMenu(tr("Rendering Options"),viewMenu_);
QMenu* renderingOptionsMenu = new QMenu(tr("Global Rendering Options"),viewMenu_);
renderingOptionsMenu->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"core_renderingOptions.png") );
viewMenu_->addMenu(renderingOptionsMenu);
......@@ -260,32 +260,33 @@ void CoreWidget::setupMenuBar()
// =====================
globalAnimationAction_ = renderingOptionsMenu->addAction(tr("Animation"));
globalAnimationAction_->setCheckable( true );
globalAnimationAction_ = renderingOptionsMenu->addAction(tr("Global Animation"));
globalAnimationAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"animation.png") );
connect(globalAnimationAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalChangeAnimation(bool) ) );
connect(globalAnimationAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleAnimation() ) );
//======================
globalBackfaceCullingAction_ = renderingOptionsMenu->addAction(tr("Backface Culling"));
globalBackfaceCullingAction_->setCheckable( true );
globalBackfaceCullingAction_ = renderingOptionsMenu->addAction(tr("Global Backface Culling"));
globalBackfaceCullingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"backFaceCulling.png") );
connect(globalBackfaceCullingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalChangeBackFaceCulling(bool) ) );
connect(globalBackfaceCullingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleBackFaceCulling() ) );
//======================
globalTwosidedLightingAction_ = renderingOptionsMenu->addAction(tr("Two-sided Lighting"));
globalTwosidedLightingAction_->setCheckable( true );
globalTwosidedLightingAction_ = renderingOptionsMenu->addAction(tr("Global Two-sided Lighting"));
globalTwosidedLightingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"twosidedLighting.png") );
connect(globalTwosidedLightingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalChangeTwoSidedLighting(bool) ) );
connect(globalTwosidedLightingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleTwoSidedLighting() ) );
//======================
globalMultisamplingAction_ = renderingOptionsMenu->addAction(tr("Multisampling"));
globalMultisamplingAction_->setCheckable( true );
// TODO:Icon for multisampling
// globalMultisamplingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"twosidedLighting.png") );
connect(globalMultisamplingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalChangeMultisampling(bool)) );
globalMultisamplingAction_ = renderingOptionsMenu->addAction(tr("Global Multisampling"));
globalMultisamplingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"multisampling.png") );
connect(globalMultisamplingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleMultisampling()) );
//======================
globalMipmappingAction_ = renderingOptionsMenu->addAction(tr("Global Mipmapping"));
globalMipmappingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"mipmapping.png") );
connect(globalMipmappingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleMipmapping()) );
//============================================================================================================
// Other toplevel actions
......@@ -483,27 +484,17 @@ void CoreWidget::setupMenuBar()
void CoreWidget::slotViewMenuAboutToShow() {
uint enabledCount = 0;
uint disabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).animation() )
enabledCount++;
else
disabledCount++;
}
if ( enabledCount != 0 && disabledCount != 0 ) {
globalAnimationAction_->setChecked(Qt::PartiallyChecked);
globalAnimationAction_->setToolTip(tr("Disable animation for all viewers"));
globalAnimationAction_->setStatusTip(tr("Disable animation for all viewers"));
globalAnimationAction_->setText(tr("Disable animation"));
} else if ( enabledCount == 4 ) {
globalAnimationAction_->setChecked( Qt::Checked );
if ( enabledCount != 0 ) {
globalAnimationAction_->setToolTip(tr("Disable animation for all viewers"));
globalAnimationAction_->setStatusTip(tr("Disable animation for all viewers"));
globalAnimationAction_->setText(tr("Disable animation"));
} else {
globalAnimationAction_->setChecked( Qt::Unchecked );
globalAnimationAction_->setToolTip(tr("Enable animation for all viewers"));
globalAnimationAction_->setStatusTip(tr("Enable animation for all viewers"));
globalAnimationAction_->setText(tr("Enable animation"));
......@@ -512,27 +503,17 @@ void CoreWidget::slotViewMenuAboutToShow() {
//=============================================================================================================================
enabledCount = 0;
disabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).backFaceCulling() )
enabledCount++;
else
disabledCount++;
}
if ( enabledCount != 0 && disabledCount != 0 ) {
globalBackfaceCullingAction_->setChecked(Qt::PartiallyChecked);
globalBackfaceCullingAction_->setToolTip(tr("Disable backface culling for all viewers"));
globalBackfaceCullingAction_->setStatusTip(tr("Disable backface culling for all viewers"));
globalBackfaceCullingAction_->setText(tr("Disable backface culling"));
} else if ( enabledCount == 4 ) {
globalBackfaceCullingAction_->setChecked( Qt::Checked );
if ( enabledCount != 0 ) {
globalBackfaceCullingAction_->setToolTip(tr("Disable backface culling for all viewers"));
globalBackfaceCullingAction_->setStatusTip(tr("Disable backface culling for all viewers"));
globalBackfaceCullingAction_->setText(tr("Disable backface culling"));
} else {
globalBackfaceCullingAction_->setChecked( Qt::Unchecked );
globalBackfaceCullingAction_->setToolTip(tr("Enable backface culling for all viewers"));
globalBackfaceCullingAction_->setStatusTip(tr("Enable backface culling for all viewers"));
globalBackfaceCullingAction_->setText(tr("Enable backface culling"));
......@@ -541,27 +522,17 @@ void CoreWidget::slotViewMenuAboutToShow() {
//=============================================================================================================================
enabledCount = 0;
disabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).twoSidedLighting() )
enabledCount++;
else
disabledCount++;
}
if ( enabledCount != 0 && disabledCount != 0 ) {
globalTwosidedLightingAction_->setChecked(Qt::PartiallyChecked);
globalTwosidedLightingAction_->setToolTip(tr("Disable two-sided lighting for all viewers"));
globalTwosidedLightingAction_->setStatusTip(tr("Disable two-sided lighting for all viewers"));
globalTwosidedLightingAction_->setText(tr("Disable two-sided lighting"));
} else if ( enabledCount == 4 ) {
globalTwosidedLightingAction_->setChecked( Qt::Checked );
if ( enabledCount != 0 ) {
globalTwosidedLightingAction_->setToolTip(tr("Disable two-sided lighting for all viewers"));
globalTwosidedLightingAction_->setStatusTip(tr("Disable two-sided lighting for all viewers"));
globalTwosidedLightingAction_->setText(tr("Disable two-sided lighting"));
} else {
globalTwosidedLightingAction_->setChecked( Qt::Unchecked );
globalTwosidedLightingAction_->setToolTip(tr("Enable two-sided lighting for all viewers"));
globalTwosidedLightingAction_->setStatusTip(tr("Enable two-sided lighting for all viewers"));
globalTwosidedLightingAction_->setText(tr("Enable two-sided lighting"));
......@@ -570,33 +541,43 @@ void CoreWidget::slotViewMenuAboutToShow() {
//=============================================================================================================================
enabledCount = 0;
disabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).multisampling() )
enabledCount++;
else
disabledCount++;
}
if ( enabledCount != 0 && disabledCount != 0 ) {
globalMultisamplingAction_->setChecked(Qt::PartiallyChecked);
globalMultisamplingAction_->setToolTip(tr("Disable Multisampling for all viewers"));
globalMultisamplingAction_->setStatusTip(tr("Disable Multisampling for all viewers"));
globalMultisamplingAction_->setText(tr("Disable Multisampling"));
} else if ( enabledCount == 4 ) {
globalMultisamplingAction_->setChecked( Qt::Checked );
globalMultisamplingAction_->setToolTip(tr("Disable Multisampling for all viewers"));
globalMultisamplingAction_->setStatusTip(tr("Disable Multisampling for all viewers"));
globalMultisamplingAction_->setText(tr("Disable Multisampling"));
if ( enabledCount != 0 ) {
globalMultisamplingAction_->setToolTip(tr("Disable multisampling for all viewers"));
globalMultisamplingAction_->setStatusTip(tr("Disable multisampling for all viewers"));
globalMultisamplingAction_->setText(tr("Disable multisampling"));
} else {
globalMultisamplingAction_->setToolTip(tr("Enable multisampling for all viewers"));
globalMultisamplingAction_->setStatusTip(tr("Enable multisampling for all viewers"));
globalMultisamplingAction_->setText(tr("Enable multisampling"));
}
//=============================================================================================================================
enabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).mipmapping() )
enabledCount++;
}
if ( enabledCount != 0 ) {
globalMipmappingAction_->setToolTip(tr("Disable mipmapping for all viewers"));
globalMipmappingAction_->setStatusTip(tr("Disable mipmapping for all viewers"));
globalMipmappingAction_->setText(tr("Disable mipmapping"));
} else {
globalMultisamplingAction_->setChecked( Qt::Unchecked );
globalMultisamplingAction_->setToolTip(tr("Enable Multisampling for all viewers"));
globalMultisamplingAction_->setStatusTip(tr("Enable Multisampling for all viewers"));
globalMultisamplingAction_->setText(tr("Enable Multisampling"));
globalMipmappingAction_->setToolTip(tr("Enable mipmapping for all viewers"));
globalMipmappingAction_->setStatusTip(tr("Enable mipmapping for all viewers"));
globalMipmappingAction_->setText(tr("Enable mipmapping"));
}
//=============================================================================================================================
int perspectiveCount = 0;
int orthogonalCount = 0;
......
......@@ -164,70 +164,140 @@ void CoreWidget::slotGlobalViewAll() {
examiner_widgets_[i]->viewAll();
}
/// Toggle projection Mode of the active viewer
/// Toggle projection mode of the active viewer
void CoreWidget::slotContextSwitchProjection() {
examiner_widgets_[PluginFunctions::activeExaminer()]->toggleProjectionMode();
}
/// Toggle projection Mode of all viewers to perspective projection
/// Toggle projection mode of all viewers to perspective projection
void CoreWidget::slotGlobalPerspectiveProjection() {
for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i )
examiner_widgets_[i]->perspectiveProjection();
}
/// Toggle projection Mode of all viewers to orthogonal projection
/// Toggle projection mode of all viewers to orthogonal projection
void CoreWidget::slotGlobalOrthographicProjection() {
for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i )
examiner_widgets_[i]->orthographicProjection();
}
/// Set the animation Mode for all viewers
/// If animation is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void CoreWidget::slotGlobalToggleAnimation() {
int enabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).animation() )
enabledCount++;
}
slotGlobalChangeAnimation (enabledCount == 0);
}
/// Set the animation mode for all viewers
void CoreWidget::slotGlobalChangeAnimation(bool _animation){
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).animation(_animation);
}
/// Set the animation Mode for active viewer
/// Set the animation mode for active viewer
void CoreWidget::slotLocalChangeAnimation(bool _animation){
PluginFunctions::viewerProperties().animation(_animation);
}
/// Set Backface culling for all viewers
/// If backface culling is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void CoreWidget::slotGlobalToggleBackFaceCulling() {
int enabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).backFaceCulling() )
enabledCount++;
}
slotGlobalChangeBackFaceCulling (enabledCount == 0);
}
/// Set backface culling for all viewers
void CoreWidget::slotGlobalChangeBackFaceCulling(bool _backFaceCulling){
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).backFaceCulling(_backFaceCulling);
}
/// Set Backface culling for active viewer
/// Set backface culling for active viewer
void CoreWidget::slotLocalChangeBackFaceCulling(bool _backFaceCulling){
PluginFunctions::viewerProperties().backFaceCulling(_backFaceCulling);
}
/// Set two sided lighting for all viewers
/// If two-sided lighting is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void CoreWidget::slotGlobalToggleTwoSidedLighting() {
int enabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).twoSidedLighting() )
enabledCount++;
}
slotGlobalChangeTwoSidedLighting (enabledCount == 0);
}
/// Set two-sided lighting for all viewers
void CoreWidget::slotGlobalChangeTwoSidedLighting(bool _lighting) {
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).twoSidedLighting(_lighting);
}
/// Set two sided lighting for active viewer
/// Set two-sided lighting for active viewer
void CoreWidget::slotLocalChangeTwoSidedLighting(bool _lighting) {
PluginFunctions::viewerProperties().twoSidedLighting(_lighting);
}
/// Set Multisampling for all viewers
/// If multisampling is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void CoreWidget::slotGlobalToggleMultisampling() {
int enabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).multisampling() )
enabledCount++;
}
slotGlobalChangeMultisampling (enabledCount == 0);
}
/// Set multisampling for all viewers
void CoreWidget::slotGlobalChangeMultisampling(bool _multisampling) {
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).multisampling( _multisampling );
}
/// Set Multisampling for active viewer
/// Set multisampling for active viewer
void CoreWidget::slotLocalChangeMultisampling(bool _multisampling) {
PluginFunctions::viewerProperties().multisampling( _multisampling );
}
/// Set Mipmapping for active viewer
/// If mipmapping is disabled in all viewers, enable it in all viewers. Otherwise disable it.
void CoreWidget::slotGlobalToggleMipmapping() {
int enabledCount = 0;
for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
if ( PluginFunctions::viewerProperties(i).mipmapping() )
enabledCount++;
}
slotGlobalChangeMipmapping (enabledCount == 0);
}
/// Set mipmapping for all viewers
void CoreWidget::slotGlobalChangeMipmapping(bool _mipmapping) {
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
PluginFunctions::viewerProperties(i).mipmapping( _mipmapping );
}
/// Set mipmapping for active viewer
void CoreWidget::slotLocalChangeMipmapping(bool _mipmapping) {
PluginFunctions::viewerProperties().mipmapping( _mipmapping );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment