Commit 4520ce3f authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixes from tobias

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12598 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 236eb116
......@@ -402,8 +402,9 @@ void SplatCloudRenderingControlPlugin::slotUpdateContextMenu( int _objectId )
// get splatcloud-object
SplatCloudObject *splatCloud = PluginFunctions::splatCloudObject( object );
// If it is not a splat object, we stop here
if ( splatCloud != 0 ) {
// if object is a SplatCloud...
if( splatCloud )
{
// update context-menu value
menuCullingAction_->setChecked( splatCloud->isBackfaceCullingEnabled() );
}
......@@ -467,19 +468,17 @@ void SplatCloudRenderingControlPlugin::slotToolboxReloadShadersButtonClicked()
PluginFunctions::ObjectIterator objIter( PluginFunctions::ALL_OBJECTS, DATA_SPLATCLOUD );
for( ; objIter != PluginFunctions::objectsEnd(); ++objIter )
{
// get scenegraph splatcloud-node
// get scenegraph splatcloud-object
SplatCloudObject *splatCloud = PluginFunctions::splatCloudObject( *objIter );
// apply update (reload standard and picking shaders)
// apply update (reload standard and picking shaders and re-set uniforms)
splatCloud->reloadShaders();
splatCloud->setPointsizeScale ( splatCloud->pointsizeScale() );
splatCloud->enableBackfaceCulling( splatCloud->isBackfaceCullingEnabled() );
// emit signal that object has to be updated
emit updatedObject( objIter->id(), UPDATE_ALL );
}
// after reloading a shader we have to re-set all uniforms for this shader
slotToolboxPointsizeScaleValueChanged();
slotToolboxBackfaceCullingStateChanged();
}
......@@ -495,14 +494,12 @@ void SplatCloudRenderingControlPlugin::slotToolboxRebuildVBOsButtonClicked()
// get scenegraph splatcloud-node
SplatCloudNode *splatCloudNode = PluginFunctions::splatCloudNode( *objIter );
if ( splatCloudNode != 0) {
// apply update (make vertex-buffer-object invalid so it will be rebuilt the next time the node is drawn (or picked))
splatCloudNode->invalidateVBO();
// emit signal that object has to be updated
emit updatedObject( objIter->id(), UPDATE_ALL );
}
}
}
......@@ -518,7 +515,6 @@ void SplatCloudRenderingControlPlugin::slotToolboxApplyDefaultsButtonClicked()
// get scenegraph splatcloud-node
SplatCloudNode *splatCloudNode = PluginFunctions::splatCloudNode( *objIter );
if ( splatCloudNode ) {
// apply update (this may trigger the VBO to become invalid so it will be rebuilt)
splatCloudNode->setDefaultNormal( SplatCloudNode::Normal( toolboxDefaultNormalX_->value(),
toolboxDefaultNormalY_->value(),
......@@ -531,7 +527,6 @@ void SplatCloudRenderingControlPlugin::slotToolboxApplyDefaultsButtonClicked()
// emit signal that object has to be updated
emit updatedObject( objIter->id(), UPDATE_ALL );
}
}
}
......@@ -555,6 +550,9 @@ void SplatCloudRenderingControlPlugin::slotMenuScaleActionTriggered()
// get splatcloud-object
SplatCloudObject *splatCloud = PluginFunctions::splatCloudObject( object );
// if object is a SplatCloud...
if( splatCloud )
{
// update scale-widget option value
scaleWidgetPointsizeScale_->setValue( splatCloud->pointsizeScale() );
......@@ -564,6 +562,7 @@ void SplatCloudRenderingControlPlugin::slotMenuScaleActionTriggered()
// show scale-widget
scaleWidget_->show();
}
}
......@@ -584,17 +583,21 @@ void SplatCloudRenderingControlPlugin::slotScaleWidgetPointsizeScaleValueChanged
if( ! PluginFunctions::getObject( objectId, object ) )
return;
// get scale-widget option value
float scale = (float) scaleWidgetPointsizeScale_->value();
// get splatcloud-object
SplatCloudObject *splatCloud = PluginFunctions::splatCloudObject( object );
// if object is a SplatCloud...
if( splatCloud )
{
// get scale-widget option value
float scale = (float) scaleWidgetPointsizeScale_->value();
// apply update
splatCloud->setPointsizeScale( scale );
// emit signal that object has to be updated
emit updatedObject( object->id(), UPDATE_ALL );
}
}
......@@ -615,17 +618,21 @@ void SplatCloudRenderingControlPlugin::slotMenuCullingActionTriggered()
if( ! PluginFunctions::getObject( objectId, object ) )
return;
// get context-menu option value
bool enable = menuCullingAction_->isChecked();
// get splatcloud-object
SplatCloudObject *splatCloud = PluginFunctions::splatCloudObject( object );
// if object is a SplatCloud...
if( splatCloud )
{
// get context-menu option value
bool enable = menuCullingAction_->isChecked();
// apply update
splatCloud->enableBackfaceCulling( enable );
// emit signal that the object has to be updated
emit updatedObject( object->id(), UPDATE_ALL );
}
}
......@@ -649,11 +656,17 @@ void SplatCloudRenderingControlPlugin::slotMenuReloadShadersActionTriggered()
// get splatcloud-object
SplatCloudObject *splatCloud = PluginFunctions::splatCloudObject( object );
// apply update (reload standard and picking shaders)
// if object is a SplatCloud...
if( splatCloud )
{
// apply update (reload standard and picking shaders and re-set uniforms)
splatCloud->reloadShaders();
splatCloud->setPointsizeScale ( splatCloud->pointsizeScale() );
splatCloud->enableBackfaceCulling( splatCloud->isBackfaceCullingEnabled() );
// emit signal that object has to be updated
emit updatedObject( object->id(), UPDATE_ALL );
}
}
......@@ -677,7 +690,9 @@ void SplatCloudRenderingControlPlugin::slotMenuRebuildVBOActionTriggered()
// get splatcloud-node
SplatCloudNode *splatCloudNode = PluginFunctions::splatCloudNode( object );
if ( splatCloudNode != 0) {
// if object is a SplatCloud...
if( splatCloudNode )
{
// apply update (make vertex-buffer-object invalid so it will be rebuilt the next time the node is drawn (or picked))
splatCloudNode->invalidateVBO();
......@@ -707,7 +722,9 @@ void SplatCloudRenderingControlPlugin::slotMenuDefaultsActionTriggered()
// get splatcloud-node
SplatCloudNode *splatCloudNode = PluginFunctions::splatCloudNode( object );
if ( splatCloudNode ) {
// if object is a SplatCloud...
if( splatCloudNode )
{
// update defaults-widget option values
defaultsWidgetDefaultNormalX_->setValue( splatCloudNode->defaultNormal()[0] );
defaultsWidgetDefaultNormalY_->setValue( splatCloudNode->defaultNormal()[1] );
......@@ -757,8 +774,9 @@ void SplatCloudRenderingControlPlugin::slotDefaultsWidgetApplyButtonClicked()
// get splatcloud-node
SplatCloudNode *splatCloudNode = PluginFunctions::splatCloudNode( object );
if ( splatCloudNode != 0) {
// if object is a SplatCloud...
if( splatCloudNode )
{
// apply update (this may trigger the VBO to become invalid so it will be rebuilt)
splatCloudNode->setDefaultNormal( SplatCloudNode::Normal( defaultsWidgetDefaultNormalX_->value(),
defaultsWidgetDefaultNormalY_->value(),
......
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