Commit 04b819b3 authored by Jan Möbius's avatar Jan Möbius
Browse files

Backup via system backup interface and tooltips



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12701 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c7fa0a50
...@@ -71,45 +71,65 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -71,45 +71,65 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
// -------- create toolbox -------- // -------- create toolbox --------
// -------------------------------- // --------------------------------
// ---- options ---- // ---- options tab ----
// pointsizeScale // pointsize scale
toolboxPointsizeScale_ = new QDoubleSpinBox(); toolboxPointsizeScale_ = new QDoubleSpinBox();
toolboxPointsizeScale_->setRange( 0.0, 100.0 ); toolboxPointsizeScale_->setRange( 0.0, 100.0 );
toolboxPointsizeScale_->setDecimals( 4 ); toolboxPointsizeScale_->setDecimals( 4 );
toolboxPointsizeScale_->setSingleStep( 0.1 ); toolboxPointsizeScale_->setSingleStep( 0.1 );
toolboxPointsizeScale_->setValue( 1.0 ); toolboxPointsizeScale_->setValue( 1.0 );
toolboxPointsizeScale_->setToolTip( "The scaling factor of the pointsizes used during the rendering of objects" );
// pointsizeScale layout // pointsize scale layout
QHBoxLayout *toolboxPointsizeScaleLayout = new QHBoxLayout(); QHBoxLayout *toolboxPointsizeScaleLayout = new QHBoxLayout();
toolboxPointsizeScaleLayout->addWidget( new QLabel( "Pointsize Scale:" ) ); toolboxPointsizeScaleLayout->setSpacing( 6 );
toolboxPointsizeScaleLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); toolboxPointsizeScaleLayout->addWidget( new QLabel( "Pointsize Scaling Factor:" ) );
toolboxPointsizeScaleLayout->addWidget( toolboxPointsizeScale_ ); toolboxPointsizeScaleLayout->addWidget( toolboxPointsizeScale_ );
// buttons // buttons
QPushButton *toolboxEnableBackfaceCullingButton = new QPushButton( "Enable Backface Culling" ); QPushButton *toolboxEnableBackfaceCullingButton = new QPushButton( "Enable Backface Culling" );
QPushButton *toolboxDisableBackfaceCullingButton = new QPushButton( "Disable Backface Culling" ); QPushButton *toolboxDisableBackfaceCullingButton = new QPushButton( "Disable Backface Culling" );
QPushButton *toolboxReloadShadersButton = new QPushButton( "Reload Shaders" ); QPushButton *toolboxReloadShadersButton = new QPushButton( "Reload Shaders" );
QPushButton *toolboxRebuildVBOsButton = new QPushButton( "Rebuild VBOs" ); QPushButton *toolboxRebuildVBOsButton = new QPushButton( "Rebuild VBOs" );
toolboxEnableBackfaceCullingButton->setToolTip ( "Enable the culling of backfaces" );
// buttons layout toolboxDisableBackfaceCullingButton->setToolTip( "Disable the culling of backfaces" );
QGridLayout *toolboxButtonsLayout = new QGridLayout(); toolboxReloadShadersButton->setToolTip ( "Reload all shader files" );
toolboxButtonsLayout->setSpacing( 6 ); toolboxRebuildVBOsButton->setToolTip ( "Rebuild all vertex-buffer-objects" );
toolboxButtonsLayout->addWidget( toolboxEnableBackfaceCullingButton, 0, 0 );
toolboxButtonsLayout->addWidget( toolboxDisableBackfaceCullingButton, 0, 1 ); // buttonsA layout
toolboxButtonsLayout->addWidget( toolboxReloadShadersButton, 1, 0 ); QHBoxLayout *toolboxButtonsALayout = new QHBoxLayout();
toolboxButtonsLayout->addWidget( toolboxRebuildVBOsButton, 1, 1 ); toolboxButtonsALayout->setSpacing( 6 );
toolboxButtonsALayout->addWidget( toolboxEnableBackfaceCullingButton );
toolboxButtonsALayout->addWidget( toolboxDisableBackfaceCullingButton );
// separator frame
QFrame *toolboxSeparatorFrame = new QFrame();
toolboxSeparatorFrame->setFrameShape( QFrame::HLine );
toolboxSeparatorFrame->setFrameShadow( QFrame::Sunken );
// buttonsB layout
QHBoxLayout *toolboxButtonsBLayout = new QHBoxLayout();
toolboxButtonsBLayout->setSpacing( 6 );
toolboxButtonsBLayout->addWidget( toolboxReloadShadersButton );
toolboxButtonsBLayout->addWidget( toolboxRebuildVBOsButton );
// options layout // options layout
QVBoxLayout *toolboxOptionsLayout = new QVBoxLayout(); QVBoxLayout *toolboxOptionsLayout = new QVBoxLayout();
toolboxOptionsLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); toolboxOptionsLayout->setSpacing( 6 );
toolboxOptionsLayout->addItem ( toolboxPointsizeScaleLayout ); toolboxOptionsLayout->addItem ( toolboxPointsizeScaleLayout );
toolboxOptionsLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); toolboxOptionsLayout->addItem ( toolboxButtonsALayout );
toolboxOptionsLayout->addItem ( toolboxButtonsLayout ); toolboxOptionsLayout->addWidget( toolboxSeparatorFrame );
toolboxOptionsLayout->addItem ( toolboxButtonsBLayout );
// options widget
QWidget *toolboxOptionsWidget = new QWidget();
toolboxOptionsWidget->setLayout( toolboxOptionsLayout );
toolboxOptionsWidget->setToolTip( "Rendering options" );
// ---- defaults ---- // ---- defaults tab ----
// defaultNormal // default normal
toolboxDefaultNormalX_ = new QDoubleSpinBox(); toolboxDefaultNormalX_ = new QDoubleSpinBox();
toolboxDefaultNormalY_ = new QDoubleSpinBox(); toolboxDefaultNormalY_ = new QDoubleSpinBox();
toolboxDefaultNormalZ_ = new QDoubleSpinBox(); toolboxDefaultNormalZ_ = new QDoubleSpinBox();
...@@ -125,31 +145,19 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -125,31 +145,19 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
toolboxDefaultNormalX_->setValue( 0.0 ); toolboxDefaultNormalX_->setValue( 0.0 );
toolboxDefaultNormalY_->setValue( 0.0 ); toolboxDefaultNormalY_->setValue( 0.0 );
toolboxDefaultNormalZ_->setValue( 1.0 ); toolboxDefaultNormalZ_->setValue( 1.0 );
toolboxDefaultNormalX_->setToolTip( "The default x-component of the normal used when an object has no normals" );
toolboxDefaultNormalY_->setToolTip( "The default y-component of the normal used when an object has no normals" );
toolboxDefaultNormalZ_->setToolTip( "The default z-component of the normal used when an object has no normals" );
// defaultNormal layout // default pointsize
QHBoxLayout *toolboxDefaultNormalLayout = new QHBoxLayout();
toolboxDefaultNormalLayout->addWidget( new QLabel( "Default Normal:" ) );
toolboxDefaultNormalLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalX_ );
toolboxDefaultNormalLayout->addItem ( new QSpacerItem( 6, 6 ) );
toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalY_ );
toolboxDefaultNormalLayout->addItem ( new QSpacerItem( 6, 6 ) );
toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalZ_ );
// defaultPointsize
toolboxDefaultPointsize_ = new QDoubleSpinBox(); toolboxDefaultPointsize_ = new QDoubleSpinBox();
toolboxDefaultPointsize_->setRange( 0.0, 1000.0 ); toolboxDefaultPointsize_->setRange( 0.0, 1000.0 );
toolboxDefaultPointsize_->setDecimals( 4 ); toolboxDefaultPointsize_->setDecimals( 4 );
toolboxDefaultPointsize_->setSingleStep( 0.001 ); toolboxDefaultPointsize_->setSingleStep( 0.001 );
toolboxDefaultPointsize_->setValue( 0.01 ); toolboxDefaultPointsize_->setValue( 0.01 );
toolboxDefaultPointsize_->setToolTip( "The default pointsize used when an object has no pointsizes" );
// defaultPointsize layout // default color
QHBoxLayout *toolboxDefaultPointsizeLayout = new QHBoxLayout();
toolboxDefaultPointsizeLayout->addWidget( new QLabel( "Default Pointsize:" ) );
toolboxDefaultPointsizeLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxDefaultPointsizeLayout->addWidget( toolboxDefaultPointsize_ );
// defaultColor
toolboxDefaultColorR_ = new QSpinBox(); toolboxDefaultColorR_ = new QSpinBox();
toolboxDefaultColorG_ = new QSpinBox(); toolboxDefaultColorG_ = new QSpinBox();
toolboxDefaultColorB_ = new QSpinBox(); toolboxDefaultColorB_ = new QSpinBox();
...@@ -162,37 +170,55 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -162,37 +170,55 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
toolboxDefaultColorR_->setValue( 255 ); toolboxDefaultColorR_->setValue( 255 );
toolboxDefaultColorG_->setValue( 255 ); toolboxDefaultColorG_->setValue( 255 );
toolboxDefaultColorB_->setValue( 255 ); toolboxDefaultColorB_->setValue( 255 );
toolboxDefaultColorR_->setToolTip( "The default red-component of the color used when an object has no colors" );
toolboxDefaultColorG_->setToolTip( "The default green-component of the color used when an object has no colors" );
toolboxDefaultColorB_->setToolTip( "The default blue-component of the color used when an object has no colors" );
// default normal layout
QHBoxLayout *toolboxDefaultNormalLayout = new QHBoxLayout();
toolboxDefaultNormalLayout->setSpacing( 6 );
toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalX_ );
toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalY_ );
toolboxDefaultNormalLayout->addWidget( toolboxDefaultNormalZ_ );
// default pointsize layout
QHBoxLayout *toolboxDefaultPointsizeLayout = new QHBoxLayout();
toolboxDefaultPointsizeLayout->setSpacing( 6 );
toolboxDefaultPointsizeLayout->addWidget( toolboxDefaultPointsize_ );
// defaultColor layout // default color layout
QHBoxLayout *toolboxDefaultColorLayout = new QHBoxLayout(); QHBoxLayout *toolboxDefaultColorLayout = new QHBoxLayout();
toolboxDefaultColorLayout->addWidget( new QLabel( "Default Color:" ) ); toolboxDefaultColorLayout->setSpacing( 6 );
toolboxDefaultColorLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); toolboxDefaultColorLayout->addWidget( toolboxDefaultColorR_ );
toolboxDefaultColorLayout->addWidget( toolboxDefaultColorR_ ); toolboxDefaultColorLayout->addWidget( toolboxDefaultColorG_ );
toolboxDefaultColorLayout->addItem ( new QSpacerItem( 6, 6 ) ); toolboxDefaultColorLayout->addWidget( toolboxDefaultColorB_ );
toolboxDefaultColorLayout->addWidget( toolboxDefaultColorG_ );
toolboxDefaultColorLayout->addItem ( new QSpacerItem( 6, 6 ) ); // default options layout
toolboxDefaultColorLayout->addWidget( toolboxDefaultColorB_ ); QGridLayout *toolboxDefaultOptionsLayout = new QGridLayout();
toolboxDefaultOptionsLayout->setSpacing( 6 );
// applyDefaults button toolboxDefaultOptionsLayout->addWidget( new QLabel( "Default Normal:" ), 0, 0 );
toolboxDefaultOptionsLayout->addWidget( new QLabel( "Default Pointsize:" ), 1, 0 );
toolboxDefaultOptionsLayout->addWidget( new QLabel( "Default Color:" ), 2, 0 );
toolboxDefaultOptionsLayout->addItem ( toolboxDefaultNormalLayout, 0, 1 );
toolboxDefaultOptionsLayout->addItem ( toolboxDefaultPointsizeLayout, 1, 1 );
toolboxDefaultOptionsLayout->addItem ( toolboxDefaultColorLayout, 2, 1 );
// apply defaults button
QPushButton *toolboxApplyDefaultsButton = new QPushButton( "Apply Defaults" ); QPushButton *toolboxApplyDefaultsButton = new QPushButton( "Apply Defaults" );
toolboxApplyDefaultsButton->setToolTip( "Apply the changes made" );
// defaults layout // defaults layout
QVBoxLayout *toolboxDefaultsLayout = new QVBoxLayout(); QVBoxLayout *toolboxDefaultsLayout = new QVBoxLayout();
toolboxDefaultsLayout->addItem ( toolboxDefaultNormalLayout ); toolboxDefaultsLayout->setSpacing( 6 );
toolboxDefaultsLayout->addItem ( toolboxDefaultPointsizeLayout ); toolboxDefaultsLayout->addItem ( toolboxDefaultOptionsLayout );
toolboxDefaultsLayout->addItem ( toolboxDefaultColorLayout ); toolboxDefaultsLayout->addWidget( toolboxApplyDefaultsButton );
toolboxDefaultsLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxDefaultsLayout->addWidget( toolboxApplyDefaultsButton );
// ----
// options widget
QWidget *toolboxOptionsWidget = new QWidget();
toolboxOptionsWidget->setLayout( toolboxOptionsLayout );
// defaults widget // defaults widget
QWidget *toolboxDefaultsWidget = new QWidget(); QWidget *toolboxDefaultsWidget = new QWidget();
toolboxDefaultsWidget->setLayout( toolboxDefaultsLayout ); toolboxDefaultsWidget->setLayout( toolboxDefaultsLayout );
toolboxDefaultsWidget->setToolTip( "Default values" );
// ----
// tab widget // tab widget
QTabWidget *toolboxTabWidget = new QTabWidget(); QTabWidget *toolboxTabWidget = new QTabWidget();
...@@ -201,12 +227,16 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -201,12 +227,16 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
// toolbox layout // toolbox layout
QVBoxLayout *toolboxLayout = new QVBoxLayout(); QVBoxLayout *toolboxLayout = new QVBoxLayout();
toolboxLayout->setSpacing( 6 );
toolboxLayout->addWidget( toolboxTabWidget ); toolboxLayout->addWidget( toolboxTabWidget );
// toolbox // toolbox
QWidget *toolbox = new QWidget(); QWidget *toolbox = new QWidget();
toolbox->setLayout( toolboxLayout ); toolbox->setLayout( toolboxLayout );
// toolbox icon
QIcon *toolboxIcon = new QIcon( OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "SplatCloudType.png" );
// ---- // ----
// connect events to slots // connect events to slots
...@@ -218,74 +248,67 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -218,74 +248,67 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
connect( toolboxApplyDefaultsButton, SIGNAL( clicked() ), this, SLOT( slotToolboxApplyDefaultsButtonClicked() ) ); connect( toolboxApplyDefaultsButton, SIGNAL( clicked() ), this, SLOT( slotToolboxApplyDefaultsButtonClicked() ) );
// emit signal to add the new toolbox // emit signal to add the new toolbox
toolBoxIcon_ = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"SplatCloudType.png"); emit addToolbox( tr("SplatCloud Rendering Control") , toolbox , toolboxIcon );
emit addToolbox( tr("SplatCloud Rendering Control") , toolbox , toolBoxIcon_);
// ------------------------------------- // -------------------------------------
// -------- create context menu -------- // -------- create context menu --------
// ------------------------------------- // -------------------------------------
// scale action // actions
menuScaleAction_ = new QAction( tr("Pointsize Scale..."), this ); contextScaleAction_ = new QAction( tr( "Pointsize Scaling Factor..."), this );
contextCullingAction_ = new QAction( tr( "Backface Culling" ), this );
// culling action contextDefaultsAction_ = new QAction( tr( "Defaults..." ), this );
menuCullingAction_ = new QAction( tr("Backface Culling"), this ); contextReloadShadersAction_ = new QAction( tr( "Reload Shaders" ), this );
menuCullingAction_->setCheckable( true ); contextRebuildVBOAction_ = new QAction( tr( "Rebuild VBO" ), this );
contextCullingAction_->setCheckable( true );
// defaults action
menuDefaultsAction_ = new QAction( tr("Defaults..."), this ); // context menu
QMenu *contextMenu = new QMenu( "SplatCloud Rendering Control" );
// reloadShaders action contextMenu->addAction( contextScaleAction_ );
menuReloadShadersAction_ = new QAction( tr("Reload Shaders"), this ); contextMenu->addAction( contextCullingAction_ );
contextMenu->addSeparator();
// rebuildVBO action contextMenu->addAction( contextDefaultsAction_ );
menuRebuildVBOAction_ = new QAction( tr("Rebuild VBO"), this ); contextMenu->addSeparator();
contextMenu->addAction( contextReloadShadersAction_ );
// menu contextMenu->addAction( contextRebuildVBOAction_ );
QMenu *menu = new QMenu( "SplatCloud Rendering Control" );
menu->addAction( menuScaleAction_ );
menu->addAction( menuCullingAction_ );
menu->addSeparator();
menu->addAction( menuDefaultsAction_ );
menu->addSeparator();
menu->addAction( menuReloadShadersAction_ );
menu->addAction( menuRebuildVBOAction_ );
// ---- // ----
// connect events to slots // connect events to slots
connect( menuScaleAction_, SIGNAL( triggered() ), this, SLOT( slotMenuScaleActionTriggered() ) ); connect( contextScaleAction_, SIGNAL( triggered() ), this, SLOT( slotContextScaleActionTriggered() ) );
connect( menuCullingAction_, SIGNAL( triggered() ), this, SLOT( slotMenuCullingActionTriggered() ) ); connect( contextCullingAction_, SIGNAL( triggered() ), this, SLOT( slotContextCullingActionTriggered() ) );
connect( menuDefaultsAction_, SIGNAL( triggered() ), this, SLOT( slotMenuDefaultsActionTriggered() ) ); connect( contextDefaultsAction_, SIGNAL( triggered() ), this, SLOT( slotContextDefaultsActionTriggered() ) );
connect( menuReloadShadersAction_, SIGNAL( triggered() ), this, SLOT( slotMenuReloadShadersActionTriggered() ) ); connect( contextReloadShadersAction_, SIGNAL( triggered() ), this, SLOT( slotContextReloadShadersActionTriggered() ) );
connect( menuRebuildVBOAction_, SIGNAL( triggered() ), this, SLOT( slotMenuRebuildVBOActionTriggered() ) ); connect( contextRebuildVBOAction_, SIGNAL( triggered() ), this, SLOT( slotContextRebuildVBOActionTriggered() ) );
// emit signal to add the new contest menu // emit signal to add the new context menu
emit addContextMenuItem( menu->menuAction(), DATA_SPLATCLOUD, CONTEXTOBJECTMENU ); emit addContextMenuItem( contextMenu->menuAction(), DATA_SPLATCLOUD, CONTEXTOBJECTMENU );
// ------------------------------------- // -------------------------------------
// -------- create scale widget -------- // -------- create scale widget --------
// ------------------------------------- // -------------------------------------
// pointsizeScale // pointsize scale
scaleWidgetPointsizeScale_ = new QDoubleSpinBox(); scaleWidgetPointsizeScale_ = new QDoubleSpinBox();
scaleWidgetPointsizeScale_->setRange( 0.0, 100.0 ); scaleWidgetPointsizeScale_->setRange( 0.0, 100.0 );
scaleWidgetPointsizeScale_->setDecimals( 4 ); scaleWidgetPointsizeScale_->setDecimals( 4 );
scaleWidgetPointsizeScale_->setSingleStep( 0.1 ); scaleWidgetPointsizeScale_->setSingleStep( 0.1 );
scaleWidgetPointsizeScale_->setToolTip( "The scaling factor of the pointsizes used during the rendering of the picked object" );
// pointsizeScale layout // pointsize scale layout
QHBoxLayout *scaleWidgetPointsizeScaleLayout = new QHBoxLayout(); QHBoxLayout *scaleWidgetPointsizeScaleLayout = new QHBoxLayout();
scaleWidgetPointsizeScaleLayout->addWidget( new QLabel( "Pointsize Scale:" ) ); scaleWidgetPointsizeScaleLayout->setSpacing( 6 );
scaleWidgetPointsizeScaleLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); scaleWidgetPointsizeScaleLayout->addWidget( new QLabel( "Pointsize Scaling Factor:" ) );
scaleWidgetPointsizeScaleLayout->addWidget( scaleWidgetPointsizeScale_ ); scaleWidgetPointsizeScaleLayout->addWidget( scaleWidgetPointsizeScale_ );
// widget layout // widget layout
QVBoxLayout *scaleWidgetLayout = new QVBoxLayout(); QVBoxLayout *scaleWidgetLayout = new QVBoxLayout();
scaleWidgetLayout->setSpacing( 6 );
scaleWidgetLayout->addItem( scaleWidgetPointsizeScaleLayout ); scaleWidgetLayout->addItem( scaleWidgetPointsizeScaleLayout );
// widget // widget
scaleWidget_ = new QWidget(); scaleWidget_ = new QWidget();
scaleWidget_->setWindowTitle( "Pointsize Scale" ); scaleWidget_->setWindowTitle( "Pointsize Scaling Factor" );
scaleWidget_->setLayout( scaleWidgetLayout ); scaleWidget_->setLayout( scaleWidgetLayout );
// ---- // ----
...@@ -297,7 +320,7 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -297,7 +320,7 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
// -------- create defaults widget -------- // -------- create defaults widget --------
// ---------------------------------------- // ----------------------------------------
// defaultNormal // default normal
defaultsWidgetDefaultNormalX_ = new QDoubleSpinBox(); defaultsWidgetDefaultNormalX_ = new QDoubleSpinBox();
defaultsWidgetDefaultNormalY_ = new QDoubleSpinBox(); defaultsWidgetDefaultNormalY_ = new QDoubleSpinBox();
defaultsWidgetDefaultNormalZ_ = new QDoubleSpinBox(); defaultsWidgetDefaultNormalZ_ = new QDoubleSpinBox();
...@@ -310,30 +333,18 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -310,30 +333,18 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
defaultsWidgetDefaultNormalX_->setSingleStep( 0.1 ); defaultsWidgetDefaultNormalX_->setSingleStep( 0.1 );
defaultsWidgetDefaultNormalY_->setSingleStep( 0.1 ); defaultsWidgetDefaultNormalY_->setSingleStep( 0.1 );
defaultsWidgetDefaultNormalZ_->setSingleStep( 0.1 ); defaultsWidgetDefaultNormalZ_->setSingleStep( 0.1 );
defaultsWidgetDefaultNormalX_->setToolTip( "The default x-component of the normal used when the picked object has no normals" );
defaultsWidgetDefaultNormalY_->setToolTip( "The default y-component of the normal used when the picked object has no normals" );
defaultsWidgetDefaultNormalZ_->setToolTip( "The default z-component of the normal used when the picked object has no normals" );
// defaultNormal layout // default pointsize
QHBoxLayout *defaultsWidgetDefaultNormalLayout = new QHBoxLayout();
defaultsWidgetDefaultNormalLayout->addWidget( new QLabel( "Default Normal:" ) );
defaultsWidgetDefaultNormalLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
defaultsWidgetDefaultNormalLayout->addWidget( defaultsWidgetDefaultNormalX_ );
defaultsWidgetDefaultNormalLayout->addItem ( new QSpacerItem( 6, 6 ) );
defaultsWidgetDefaultNormalLayout->addWidget( defaultsWidgetDefaultNormalY_ );
defaultsWidgetDefaultNormalLayout->addItem ( new QSpacerItem( 6, 6 ) );
defaultsWidgetDefaultNormalLayout->addWidget( defaultsWidgetDefaultNormalZ_ );
// defaultPointsize
defaultsWidgetDefaultPointsize_ = new QDoubleSpinBox(); defaultsWidgetDefaultPointsize_ = new QDoubleSpinBox();
defaultsWidgetDefaultPointsize_->setRange( 0.0, 1000.0 ); defaultsWidgetDefaultPointsize_->setRange( 0.0, 1000.0 );
defaultsWidgetDefaultPointsize_->setDecimals( 4 ); defaultsWidgetDefaultPointsize_->setDecimals( 4 );
defaultsWidgetDefaultPointsize_->setSingleStep( 0.001 ); defaultsWidgetDefaultPointsize_->setSingleStep( 0.001 );
defaultsWidgetDefaultPointsize_->setToolTip( "The default pointsize used when the picked object has no pointsizes" );
// defaultPointsize layout // default color
QHBoxLayout *defaultsWidgetDefaultPointsizeLayout = new QHBoxLayout();
defaultsWidgetDefaultPointsizeLayout->addWidget( new QLabel( "Default Pointsize:" ) );
defaultsWidgetDefaultPointsizeLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
defaultsWidgetDefaultPointsizeLayout->addWidget( defaultsWidgetDefaultPointsize_ );
// defaultColor
defaultsWidgetDefaultColorR_ = new QSpinBox(); defaultsWidgetDefaultColorR_ = new QSpinBox();
defaultsWidgetDefaultColorG_ = new QSpinBox(); defaultsWidgetDefaultColorG_ = new QSpinBox();
defaultsWidgetDefaultColorB_ = new QSpinBox(); defaultsWidgetDefaultColorB_ = new QSpinBox();
...@@ -343,34 +354,56 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -343,34 +354,56 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
defaultsWidgetDefaultColorR_->setSingleStep( 1 ); defaultsWidgetDefaultColorR_->setSingleStep( 1 );
defaultsWidgetDefaultColorG_->setSingleStep( 1 ); defaultsWidgetDefaultColorG_->setSingleStep( 1 );
defaultsWidgetDefaultColorB_->setSingleStep( 1 ); defaultsWidgetDefaultColorB_->setSingleStep( 1 );
defaultsWidgetDefaultColorR_->setToolTip( "The default red-component of the color used when the picked object has no colors" );
defaultsWidgetDefaultColorG_->setToolTip( "The default green-component of the color used when the picked object has no colors" );
defaultsWidgetDefaultColorB_->setToolTip( "The default blue-component of the color used when the picked object has no colors" );
// defaultColor layout // default normal layout
QHBoxLayout *defaultsWidgetDefaultNormalLayout = new QHBoxLayout();
defaultsWidgetDefaultNormalLayout->setSpacing( 6 );
defaultsWidgetDefaultNormalLayout->addWidget( defaultsWidgetDefaultNormalX_ );
defaultsWidgetDefaultNormalLayout->addWidget( defaultsWidgetDefaultNormalY_ );
defaultsWidgetDefaultNormalLayout->addWidget( defaultsWidgetDefaultNormalZ_ );
// default pointsize layout
QHBoxLayout *defaultsWidgetDefaultPointsizeLayout = new QHBoxLayout();
defaultsWidgetDefaultPointsizeLayout->setSpacing( 6 );
defaultsWidgetDefaultPointsizeLayout->addWidget( defaultsWidgetDefaultPointsize_ );
// default color layout
QHBoxLayout *defaultsWidgetDefaultColorLayout = new QHBoxLayout(); QHBoxLayout *defaultsWidgetDefaultColorLayout = new QHBoxLayout();
defaultsWidgetDefaultColorLayout->addWidget( new QLabel( "Default Color:" ) ); defaultsWidgetDefaultColorLayout->setSpacing( 6 );
defaultsWidgetDefaultColorLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); defaultsWidgetDefaultColorLayout->addWidget( defaultsWidgetDefaultColorR_ );
defaultsWidgetDefaultColorLayout->addWidget( defaultsWidgetDefaultColorR_ ); defaultsWidgetDefaultColorLayout->addWidget( defaultsWidgetDefaultColorG_ );
defaultsWidgetDefaultColorLayout->addItem ( new QSpacerItem( 6, 6 ) ); defaultsWidgetDefaultColorLayout->addWidget( defaultsWidgetDefaultColorB_ );
defaultsWidgetDefaultColorLayout->addWidget( defaultsWidgetDefaultColorG_ );
defaultsWidgetDefaultColorLayout->addItem ( new QSpacerItem( 6, 6 ) ); // default options layout
defaultsWidgetDefaultColorLayout->addWidget( defaultsWidgetDefaultColorB_ ); QGridLayout *defaultsWidgetDefaultOptionsLayout = new QGridLayout();
defaultsWidgetDefaultOptionsLayout->setSpacing( 6 );
defaultsWidgetDefaultOptionsLayout->addWidget( new QLabel( "Default Normal:" ), 0, 0 );
defaultsWidgetDefaultOptionsLayout->addWidget( new QLabel( "Default Pointsize:" ), 1, 0 );
defaultsWidgetDefaultOptionsLayout->addWidget( new QLabel( "Default Color:" ), 2, 0 );
defaultsWidgetDefaultOptionsLayout->addItem ( defaultsWidgetDefaultNormalLayout, 0, 1 );
defaultsWidgetDefaultOptionsLayout->addItem ( defaultsWidgetDefaultPointsizeLayout, 1, 1 );
defaultsWidgetDefaultOptionsLayout->addItem ( defaultsWidgetDefaultColorLayout, 2, 1 );
// cancel and apply buttons // cancel and apply buttons
QPushButton *defaultsWidgetCancelButton = new QPushButton( "Cancel" ); QPushButton *defaultsWidgetCancelButton = new QPushButton( "Cancel" );
QPushButton *defaultsWidgetApplyButton = new QPushButton( "Apply" ); QPushButton *defaultsWidgetApplyButton = new QPushButton( "Apply" );
defaultsWidgetCancelButton->setToolTip( "Return without applying any changes" );
defaultsWidgetApplyButton->setToolTip ( "Apply the changes made and return" );
// buttons layout // buttons layout
QHBoxLayout *defaultsWidgetButtonsLayout = new QHBoxLayout(); QHBoxLayout *defaultsWidgetButtonsLayout = new QHBoxLayout();
defaultsWidgetButtonsLayout->setSpacing( 6 );
defaultsWidgetButtonsLayout->addWidget( defaultsWidgetCancelButton ); defaultsWidgetButtonsLayout->addWidget( defaultsWidgetCancelButton );
defaultsWidgetButtonsLayout->addItem ( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
defaultsWidgetButtonsLayout->addWidget( defaultsWidgetApplyButton ); defaultsWidgetButtonsLayout->addWidget( defaultsWidgetApplyButton );
// widget layout // widget layout
QVBoxLayout *defaultsWidgetLayout = new QVBoxLayout(); QVBoxLayout *defaultsWidgetLayout = new QVBoxLayout();
defaultsWidgetLayout->addItem( defaultsWidgetDefaultNormalLayout ); defaultsWidgetLayout->setSpacing( 6 );
defaultsWidgetLayout->addItem( defaultsWidgetDefaultPointsizeLayout ); defaultsWidgetLayout->addItem( defaultsWidgetDefaultOptionsLayout );
defaultsWidgetLayout->addItem( defaultsWidgetDefaultColorLayout ); defaultsWidgetLayout->addItem( defaultsWidgetButtonsLayout );
defaultsWidgetLayout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
defaultsWidgetLayout->addItem( defaultsWidgetButtonsLayout );
// widget // widget
defaultsWidget_ = new QWidget(); defaultsWidget_ = new QWidget();
...@@ -391,10 +424,9 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -391,10 +424,9 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
void SplatCloudRenderingControlPlugin::slotUpdateContextMenu( int _objectId ) void SplatCloudRenderingControlPlugin::slotUpdateContextMenu( int _objectId )
{ {
// get object by id // get object by id
if( _objectId == -1 ) if( _objectId == -1 )
return; return;
//
BaseObjectData *object; BaseObjectData *object;
if( ! PluginFunctions::getObject( _objectId, object ) ) if( ! PluginFunctions::getObject( _objectId, object ) )
return; return;
...@@ -405,8 +437,8 @@ void SplatCloudRenderingControlPlugin::slotUpdateContextMenu( int _objectId ) ...@@ -405,8 +437,8 @@ void SplatCloudRenderingControlPlugin::slotUpdateContextMenu( int _objectId )
// if object is a SplatCloud... // if object is a SplatCloud...
if( splatCloud ) if( splatCloud )
{ {
// update context-menu value // update context menu value
menuCullingAction_->setChecked( splatCloud->isBackfaceCullingEnabled() ); contextCullingAction_->setChecked( splatCloud->isBackfaceCullingEnabled() );
} }
} }
...@@ -551,16 +583,13 @@ void SplatCloudRenderingControlPlugin::slotToolboxApplyDefaultsButtonClicked() ...@@ -551,16 +583,13 @@ void SplatCloudRenderingControlPlugin::slotToolboxApplyDefaultsButtonClicked()
//---------------------------------------------------------------- //----------------------------------------------------------------
void SplatCloudRenderingControlPlugin::slotMenuScaleActionTriggered() void SplatCloudRenderingControlPlugin::slotContextScaleActionTriggered()
{ {
// get picked object // get picked object by id
int objectId = contextScaleAction_->data().toInt();
QVariant contextObject = menuScaleAction_->data();
int objectId = contextObject.toInt();
if( objectId == -1 ) if( objectId == -1 )
return; return;
//
BaseObjectData *object; BaseObjectData *object;
if( ! PluginFunctions::getObject( objectId, object ) )