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()
toolboxPointsizeScaleLayout->addWidget( toolboxPointsizeScale_ );
// buttons
QPushButton *toolboxEnableBackfaceCullingButton = new QPushButton( "Enable Backface Culling" );
QPushButton *toolboxDisableBackfaceCullingButton = new QPushButton( "Disable Backface Culling" );
QPushButton *toolboxReloadShadersButton = new QPushButton( "Reload Shaders" );
QPushButton *toolboxRebuildVBOsButton = new QPushButton( "Rebuild VBOs" );
QPushButton *toolboxEnableBackfaceCullingButton = new QPushButton ( "Enable Backface Culling" );
QPushButton *toolboxDisableBackfaceCullingButton = new QPushButton ( "Disable Backface Culling" );
QPushButton *toolboxReloadShadersButton = new QPushButton ( "Reload Shaders" );
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" );
toolboxDisableBackfaceCullingButton->setToolTip( "Disable the culling of backfaces" );
toolboxReloadShadersButton->setToolTip ( "Reload all shader files" );
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
QHBoxLayout *toolboxButtonsALayout = new QHBoxLayout();
......@@ -152,6 +158,17 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
toolboxButtonsBLayout->addWidget( toolboxReloadShadersButton );
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
QVBoxLayout *toolboxOptionsLayout = new QVBoxLayout();
toolboxOptionsLayout->setAlignment( Qt::AlignTop );
......@@ -161,12 +178,15 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
toolboxOptionsLayout->addItem ( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxOptionsLayout->addWidget( toolboxSeparatorFrame );
toolboxOptionsLayout->addItem ( toolboxButtonsBLayout );
toolboxOptionsLayout->addItem ( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding ) );
toolboxOptionsLayout->addWidget( toolboxSeparatorFrameBC );
toolboxOptionsLayout->addItem ( toolboxButtonsCLayout );
// options widget
QWidget *toolboxOptionsWidget = new QWidget();
toolboxOptionsWidget->setLayout( toolboxOptionsLayout );
toolboxOptionsWidget->setToolTip( "Rendering options" );
// ---- defaults tab ----
// default color
......@@ -283,6 +303,8 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
connect( toolboxDisableBackfaceCullingButton, SIGNAL( clicked() ), this, SLOT( slotToolboxDisableBackfaceCullingButtonClicked() ) );
connect( toolboxReloadShadersButton, SIGNAL( clicked() ), this, SLOT( slotToolboxReloadShadersButtonClicked() ) );
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 addToolbox( tr("SplatCloud Rendering Control") , toolbox , toolboxIcon );
......@@ -318,7 +340,7 @@ void SplatCloudRenderingControlPlugin::initializePlugin()
connect( contextDefaultsAction_, SIGNAL( triggered() ), this, SLOT( slotContextDefaultsActionTriggered() ) );
connect( contextReloadShadersAction_, SIGNAL( triggered() ), this, SLOT( slotContextReloadShadersActionTriggered() ) );
connect( contextRebuildVBOAction_, SIGNAL( triggered() ), this, SLOT( slotContextRebuildVBOActionTriggered() ) );
// emit signal to add the new context menu
emit addContextMenuItem( contextMenu->menuAction(), DATA_SPLATCLOUD, CONTEXTOBJECTMENU );
......@@ -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:
void slotToolboxDisableBackfaceCullingButtonClicked();
void slotToolboxReloadShadersButtonClicked();
void slotToolboxRebuildVBOsButtonClicked();
void slotToolboxPointSizeButtonClicked();
void slotToolboxGeometryShaderButtonClicked();
// slots called when a context menu action was triggered
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