Commit e8422d58 authored by Mike Kremer's avatar Mike Kremer

Offering option to hide/show light sources in data control tree view.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8957 383ad7c9-94d9-4d36-a494-682f7c89f535
parent de2f104b
......@@ -64,6 +64,8 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <ObjectTypes/Light/Light.hh>
//******************************************************************************
const ACG::Vec4f base_color (0.0,0.0,0.5,1.0);
......@@ -125,6 +127,9 @@ void DataControlPlugin::pluginsInitialized() {
PluginFunctions::setDefaultViewObjectMarker (&objectMarker);
PluginFunctions::setViewObjectMarker (&objectMarker);
connect(tool_->lightSources, SIGNAL(stateChanged(int)), this, SLOT(slotShowLightSources(int)));
slotShowLightSources(tool_->lightSources->checkState());
}
......@@ -314,6 +319,8 @@ void DataControlPlugin::fileOpened(int _id){
if ( PluginFunctions::getObject(_id, obj) )
model_->objectAdded(obj);
slotShowLightSources(tool_->lightSources->checkState());
}
......@@ -439,6 +446,20 @@ void DataControlPlugin::slotMoveBaseObject(int _id, int _newParentId){
}
//******************************************************************************
void DataControlPlugin::slotShowLightSources( int _state ) {
int rows = model_->rowCount();
for(int i = 0; i < rows; ++i) {
TreeItem* item = model_->getItem(model_->index(i,0));
if(item->dataType() == DATA_LIGHT) {
view_->setRowHidden(i, model_->parent(model_->index(i,0)), !(_state == Qt::Checked));
}
}
}
//******************************************************************************
/** \brief Load Groups from ini file
......
......@@ -212,6 +212,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
///Called when the material properties were changed inside the material dialog
void slotNodeChanged( ACG::SceneGraph::BaseNode* _node );
/// Hide/Show all light sources if checkbox has been checked
void slotShowLightSources( int _state );
private :
/// Index where a popup has been opened
......
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