Commit ed7cbbac authored by Christopher Tenter's avatar Christopher Tenter

- add points and dot rendermode

- add option to toggle between gl_PointSize or quad extrusion in geometry shader
parent f6804123
...@@ -126,14 +126,20 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -126,14 +126,20 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
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" );
QRadioButton *toolboxPointSizeButton = new QRadioButton( "Use gl_PointSize" );
QRadioButton *toolboxGeometryShaderButton = new QRadioButton( "Use Geometry Shader" );
toolboxEnableBackfaceCullingButton->setToolTip ( "Enable the culling of backfaces" ); toolboxEnableBackfaceCullingButton->setToolTip ( "Enable the culling of backfaces" );
toolboxDisableBackfaceCullingButton->setToolTip( "Disable the culling of backfaces" ); toolboxDisableBackfaceCullingButton->setToolTip( "Disable the culling of backfaces" );
toolboxReloadShadersButton->setToolTip ( "Reload all shader files" ); toolboxReloadShadersButton->setToolTip ( "Reload all shader files" );
toolboxRebuildVBOsButton->setToolTip ( "Rebuild all vertex-buffer-objects" ); toolboxRebuildVBOsButton->setToolTip ( "Rebuild all vertex-buffer-objects" );
toolboxPointSizeButton->setToolTip ( "Set gl_PointSize in vertex shader" );
toolboxGeometryShaderButton->setToolTip ( "Create quads in geometry shader" );
toolboxPointSizeButton->setChecked(true);
// buttonsA layout // buttonsA layout
QHBoxLayout *toolboxButtonsALayout = new QHBoxLayout(); QHBoxLayout *toolboxButtonsALayout = new QHBoxLayout();
...@@ -152,6 +158,17 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -152,6 +158,17 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
toolboxButtonsBLayout->addWidget( toolboxReloadShadersButton ); toolboxButtonsBLayout->addWidget( toolboxReloadShadersButton );
toolboxButtonsBLayout->addWidget( toolboxRebuildVBOsButton ); toolboxButtonsBLayout->addWidget( toolboxRebuildVBOsButton );
// separator frame
QFrame *toolboxSeparatorFrameBC = new QFrame();
toolboxSeparatorFrameBC->setFrameShape(QFrame::HLine);
toolboxSeparatorFrameBC->setFrameShadow(QFrame::Sunken);
// buttonsC layout
QHBoxLayout *toolboxButtonsCLayout = new QHBoxLayout();
toolboxButtonsCLayout->setSpacing(6);
toolboxButtonsCLayout->addWidget(toolboxPointSizeButton);
toolboxButtonsCLayout->addWidget(toolboxGeometryShaderButton);
// options layout // options layout
QVBoxLayout *toolboxOptionsLayout = new QVBoxLayout(); QVBoxLayout *toolboxOptionsLayout = new QVBoxLayout();
toolboxOptionsLayout->setAlignment( Qt::AlignTop ); toolboxOptionsLayout->setAlignment( Qt::AlignTop );
...@@ -161,12 +178,15 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -161,12 +178,15 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
toolboxOptionsLayout->addItem ( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding ) ); toolboxOptionsLayout->addItem ( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxOptionsLayout->addWidget( toolboxSeparatorFrame ); toolboxOptionsLayout->addWidget( toolboxSeparatorFrame );
toolboxOptionsLayout->addItem ( toolboxButtonsBLayout ); toolboxOptionsLayout->addItem ( toolboxButtonsBLayout );
toolboxOptionsLayout->addItem ( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxOptionsLayout->addWidget( toolboxSeparatorFrameBC );
toolboxOptionsLayout->addItem ( toolboxButtonsCLayout );
// options widget // options widget
QWidget *toolboxOptionsWidget = new QWidget(); QWidget *toolboxOptionsWidget = new QWidget();
toolboxOptionsWidget->setLayout( toolboxOptionsLayout ); toolboxOptionsWidget->setLayout( toolboxOptionsLayout );
toolboxOptionsWidget->setToolTip( "Rendering options" ); toolboxOptionsWidget->setToolTip( "Rendering options" );
// ---- defaults tab ---- // ---- defaults tab ----
// default color // default color
...@@ -283,6 +303,8 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -283,6 +303,8 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
connect( toolboxDisableBackfaceCullingButton, SIGNAL( clicked() ), this, SLOT( slotToolboxDisableBackfaceCullingButtonClicked() ) ); connect( toolboxDisableBackfaceCullingButton, SIGNAL( clicked() ), this, SLOT( slotToolboxDisableBackfaceCullingButtonClicked() ) );
connect( toolboxReloadShadersButton, SIGNAL( clicked() ), this, SLOT( slotToolboxReloadShadersButtonClicked() ) ); connect( toolboxReloadShadersButton, SIGNAL( clicked() ), this, SLOT( slotToolboxReloadShadersButtonClicked() ) );
connect( toolboxRebuildVBOsButton, SIGNAL( clicked() ), this, SLOT( slotToolboxRebuildVBOsButtonClicked() ) ); connect( toolboxRebuildVBOsButton, SIGNAL( clicked() ), this, SLOT( slotToolboxRebuildVBOsButtonClicked() ) );
connect( toolboxPointSizeButton, SIGNAL( toggled(bool) ), this, SLOT( slotToolboxPointSizeButtonClicked() ) );
connect( toolboxGeometryShaderButton, SIGNAL( toggled(bool) ), this, SLOT( slotToolboxGeometryShaderButtonClicked() ) );
// emit signal to add the new toolbox // emit signal to add the new toolbox
emit addToolbox( tr("SplatCloud Rendering Control") , toolbox , toolboxIcon ); emit addToolbox( tr("SplatCloud Rendering Control") , toolbox , toolboxIcon );
...@@ -318,7 +340,7 @@ void SplatCloudRenderingControlPlugin::initializePlugin() ...@@ -318,7 +340,7 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
connect( contextDefaultsAction_, SIGNAL( triggered() ), this, SLOT( slotContextDefaultsActionTriggered() ) ); connect( contextDefaultsAction_, SIGNAL( triggered() ), this, SLOT( slotContextDefaultsActionTriggered() ) );
connect( contextReloadShadersAction_, SIGNAL( triggered() ), this, SLOT( slotContextReloadShadersActionTriggered() ) ); connect( contextReloadShadersAction_, SIGNAL( triggered() ), this, SLOT( slotContextReloadShadersActionTriggered() ) );
connect( contextRebuildVBOAction_, SIGNAL( triggered() ), this, SLOT( slotContextRebuildVBOActionTriggered() ) ); connect( contextRebuildVBOAction_, SIGNAL( triggered() ), this, SLOT( slotContextRebuildVBOActionTriggered() ) );
// emit signal to add the new context menu // emit signal to add the new context menu
emit addContextMenuItem( contextMenu->menuAction(), DATA_SPLATCLOUD, CONTEXTOBJECTMENU ); emit addContextMenuItem( contextMenu->menuAction(), DATA_SPLATCLOUD, CONTEXTOBJECTMENU );
...@@ -726,6 +748,40 @@ void SplatCloudRenderingControlPlugin::slotToolboxRebuildVBOsButtonClicked() ...@@ -726,6 +748,40 @@ void SplatCloudRenderingControlPlugin::slotToolboxRebuildVBOsButtonClicked()
} }
} }
//----------------------------------------------------------------
void SplatCloudRenderingControlPlugin::slotToolboxPointSizeButtonClicked()
{
// for all splatcloud-objects...
PluginFunctions::ObjectIterator objIter(PluginFunctions::ALL_OBJECTS, DATA_SPLATCLOUD);
for (; objIter != PluginFunctions::objectsEnd(); ++objIter)
{
// get splatcloud-object
SplatCloudObject *splatCloudObject = PluginFunctions::splatCloudObject(*objIter);
// apply update
splatCloudObject->enableGeometryShaderQuads(false);
}
}
//----------------------------------------------------------------
void SplatCloudRenderingControlPlugin::slotToolboxGeometryShaderButtonClicked()
{
// for all splatcloud-objects...
PluginFunctions::ObjectIterator objIter(PluginFunctions::ALL_OBJECTS, DATA_SPLATCLOUD);
for (; objIter != PluginFunctions::objectsEnd(); ++objIter)
{
// get splatcloud-object
SplatCloudObject *splatCloudObject = PluginFunctions::splatCloudObject(*objIter);
// apply update
splatCloudObject->enableGeometryShaderQuads(true);
}
}
//---------------------------------------------------------------- //----------------------------------------------------------------
......
...@@ -179,6 +179,8 @@ private slots: ...@@ -179,6 +179,8 @@ private slots:
void slotToolboxDisableBackfaceCullingButtonClicked(); void slotToolboxDisableBackfaceCullingButtonClicked();
void slotToolboxReloadShadersButtonClicked(); void slotToolboxReloadShadersButtonClicked();
void slotToolboxRebuildVBOsButtonClicked(); void slotToolboxRebuildVBOsButtonClicked();
void slotToolboxPointSizeButtonClicked();
void slotToolboxGeometryShaderButtonClicked();
// slots called when a context menu action was triggered // slots called when a context menu action was triggered
void slotContextScaleActionTriggered(); void slotContextScaleActionTriggered();
......
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