Commit 1b29fe75 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 35d20c7c 92ffaad3
......@@ -30,7 +30,7 @@
#include "WGEViewerEffectHorizon.h"
WGEViewerEffectHorizon::WGEViewerEffectHorizon():
WGEViewerEffect( "Horizon", "Configurable horizon background effect." )
WGEViewerEffect( "Horizon Background", "Configurable horizon background effect." )
{
WPropColor bottom1Color = m_properties->addProperty( "First Bottom Color", "Bottom color gradient: first color.",
WColor( 0.65, 0.65, 0.65, 1.0 ) );
......@@ -39,7 +39,7 @@ WGEViewerEffectHorizon::WGEViewerEffectHorizon():
WPropColor top1Color = m_properties->addProperty( "First Top Color", "Top color gradient: first color.",
WColor( 1.0, 1.0, 1.0, 1.0 ) );
WPropColor top2Color = m_properties->addProperty( "Second Top Color", "Top color gradient: second color.",
WColor( 1.0, 1.0, 1.0, 1.0 ) );
WColor( 0.95, 0.95, 0.95, 0.95 ) );
WPropDouble horizonLine = m_properties->addProperty( "Horizon in %", "Horizon line in percent.", 33.0 );
horizonLine->setMin( 0.0 );
......
......@@ -43,7 +43,7 @@ WGEViewerEffectImageOverlay::WGEViewerEffectImageOverlay():
WPropFilename imageFn = m_properties->addProperty( "Image", "The Image to use.", WPathHelper::getSharePath() / "GE" / "overlay.png" );
WPropDouble scale = m_properties->addProperty( "Scale", "Scale the image in percent.", 50.0 );
scale->setMin( 0.0 );
scale->setMax( 100.0 );
scale->setMax( 200.0 );
WPropBool moveToTop = m_properties->addProperty( "Move to Top", "Move the image to the top.", false );
WPropBool moveToRight = m_properties->addProperty( "Move to Right", "Move the image to the right.", true );
......@@ -53,7 +53,7 @@ WGEViewerEffectImageOverlay::WGEViewerEffectImageOverlay():
// some logo
osg::ref_ptr< osg::Texture2D > logoTexture = new osg::Texture2D;
osg::Image* logoImage = osgDB::readImageFile( ( WPathHelper::getSharePath() / "GE" / "overlay.png" ).string() );
osg::Image* logoImage = osgDB::readImageFile( imageFn->get().string() );
if( logoImage )
{
// Assign the texture to the image we read from file:
......
......@@ -33,7 +33,7 @@ WGEViewerEffectVignette::WGEViewerEffectVignette():
WGEViewerEffect( "Vignette", "Provide a basic vignette effect." )
{
// WPropDouble vignetteIntensity = m_properties->addProperty( "", "", 0.5 );
WPropDouble vignetteIntensity = m_properties->addProperty( "Strength", "Define dominance of vignette effect.", 0.5 );
WPropDouble vignetteIntensity = m_properties->addProperty( "Strength", "Define dominance of vignette effect.", 0.33 );
vignetteIntensity->setMin( 0.0 );
vignetteIntensity->setMax( 2.0 );
m_state->addUniform( new WGEPropertyUniform< WPropDouble >( "u_vignetteIntensity", vignetteIntensity ) );
......
......@@ -32,12 +32,15 @@
#include <QtGui/QToolButton>
#include <QtGui/QToolBar>
#include "core/graphicsEngine/WGEViewerEffect.h"
#include "WQt4Gui.h"
#include "WMainWindow.h"
#include "WSettingAction.h"
#include "guiElements/WQtDockWidget.h"
#include "controlPanel/WQtPropertyGroupWidget.h"
#include "WQtGLDockWidget.h"
#include "WQtGLDockWidget.moc"
......@@ -73,6 +76,44 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
// all view docks have a screen capture object
m_screenCapture = new WQtGLScreenCapture( this );
// get the viewer background effect
WGEViewerEffect::SPtr bkEffect = m_glWidget->getViewer()->getBackground();
WGEViewerEffect::SPtr vignetteEffect = m_glWidget->getViewer()->getVignette();
WGEViewerEffect::SPtr overlayEffect = m_glWidget->getViewer()->getImageOverlay();
// create property widgets for each effect
QWidget* bkWidget = WQtPropertyGroupWidget::createPropertyGroupBox( bkEffect->getProperties() );
QWidget* vignetteWidget = WQtPropertyGroupWidget::createPropertyGroupBox( vignetteEffect->getProperties() );
QWidget* overlayWidget = WQtPropertyGroupWidget::createPropertyGroupBox( overlayEffect->getProperties() );
// create container for all the config widgets
QWidget* viewConfigWidget = new QWidget();
QVBoxLayout* viewConfigLayout = new QVBoxLayout();
viewConfigLayout->setAlignment( Qt::AlignTop );
viewConfigWidget->setLayout( viewConfigLayout );
// force the widget to shrink when the content shrinks.
QSizePolicy sizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
sizePolicy.setHorizontalStretch( 0 );
sizePolicy.setVerticalStretch( 0 );
viewConfigWidget->setSizePolicy( sizePolicy );
// add the property widgets to container
viewConfigLayout->addWidget( bkWidget );
viewConfigLayout->addWidget( vignetteWidget );
viewConfigLayout->addWidget( overlayWidget );
// Create the toolbutton and the menu containing the config widgets
QWidgetAction* viewerConfigWidgetAction = new QWidgetAction( this );
viewerConfigWidgetAction->setDefaultWidget( viewConfigWidget );
QMenu* viewerConfigMenu = new QMenu();
viewerConfigMenu->addAction( viewerConfigWidgetAction );
QToolButton* viewerConfigBtn = new QToolButton( parent );
viewerConfigBtn->setPopupMode( QToolButton::InstantPopup );
viewerConfigBtn->setIcon( WQt4Gui::getMainWindow()->getIconManager()->getIcon( "configure" ) );
viewerConfigBtn->setToolTip( "Configure View" );
viewerConfigBtn->setMenu( viewerConfigMenu );
// screen capture trigger
QWidgetAction* screenCaptureWidgetAction = new QWidgetAction( this );
screenCaptureWidgetAction->setDefaultWidget( m_screenCapture );
......@@ -105,6 +146,7 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
// add them to the title
addTitleButton( screenShotBtn );
addTitleButton( presetBtn );
addTitleButton( viewerConfigBtn );
addTitleButton( settingsBtn );
}
......
......@@ -305,11 +305,17 @@ QWidget* WQtPropertyGroupWidget::createPropertyGroupBox( WPropertyGroupBase::SPt
sizePolicy.setHorizontalStretch( 0 );
sizePolicy.setVerticalStretch( 0 );
QString titleCorrected = title;
if( title == "" )
{
titleCorrected = QString::fromStdString( group->getName() );
}
WQtPropertyGroupWidget* propWidget = new WQtPropertyGroupWidget( group, depth, parent );
propWidget->setName( title );
QWidget* tab = WQtPropertyGroupWidget::createPropertyGroupBox( propWidget, false, parent, title );
propWidget->setName( titleCorrected );
QWidget* tab = WQtPropertyGroupWidget::createPropertyGroupBox( propWidget, false, parent, titleCorrected );
tab->setSizePolicy( sizePolicy );
tab->setWindowTitle( title );
tab->setWindowTitle( titleCorrected );
return tab;
}
......
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