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

Dennis: Datacontrol Use-View-Marker-interface-in-DataControl

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6637 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7de01624
...@@ -98,6 +98,9 @@ void DataControlPlugin::pluginsInitialized() { ...@@ -98,6 +98,9 @@ void DataControlPlugin::pluginsInitialized() {
connect (material, SIGNAL( triggered() ), this, SLOT ( slotMaterialProperties() )); connect (material, SIGNAL( triggered() ), this, SLOT ( slotMaterialProperties() ));
emit addContextMenuItem(material , DATA_ALL , CONTEXTOBJECTMENU); emit addContextMenuItem(material , DATA_ALL , CONTEXTOBJECTMENU);
PluginFunctions::setDefaultViewObjectMarker (&objectMarker);
PluginFunctions::setViewObjectMarker (&objectMarker);
} }
...@@ -167,35 +170,9 @@ void DataControlPlugin::slotObjectSelectionChanged( int _identifier ) ...@@ -167,35 +170,9 @@ void DataControlPlugin::slotObjectSelectionChanged( int _identifier )
BaseObjectData* obj = 0; BaseObjectData* obj = 0;
if ( PluginFunctions::getObject( _identifier, obj) ){ if ( PluginFunctions::getObject( _identifier, obj) )
updateBoundingBox (obj); updateBoundingBox (obj);
if ( obj->target() ) {
obj->materialNode()->disable_blending();
OpenMesh::Vec4f base_color = obj->materialNode()->base_color();
base_color[3] = 1.0;
obj->materialNode()->set_base_color(base_color);
OpenMesh::Vec4f ambient_color = obj->materialNode()->ambient_color();
ambient_color[3] = 1.0;
obj->materialNode()->set_ambient_color(ambient_color);
OpenMesh::Vec4f diffuse_color = obj->materialNode()->diffuse_color();
diffuse_color[3] = 1.0;
obj->materialNode()->set_diffuse_color(diffuse_color);
} else {
obj->materialNode()->enable_blending();
OpenMesh::Vec4f base_color = obj->materialNode()->base_color();
base_color[3] = 0.4;
obj->materialNode()->set_base_color(base_color);
OpenMesh::Vec4f ambient_color = obj->materialNode()->ambient_color();
ambient_color[3] = 0.4;
obj->materialNode()->set_ambient_color(ambient_color);
OpenMesh::Vec4f diffuse_color = obj->materialNode()->diffuse_color();
diffuse_color[3] = 0.4;
obj->materialNode()->set_diffuse_color(diffuse_color);
}
}
model_->objectChanged( _identifier ); model_->objectChanged( _identifier );
//check for changes in the tree //check for changes in the tree
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "Toolbox.hh" #include "Toolbox.hh"
#include "TreeModel.hh" #include "TreeModel.hh"
#include "DefaultObjectMarker.hh"
/** Plugin for controlling the Object data structures (Show,hide Object, Target, Source selection /** Plugin for controlling the Object data structures (Show,hide Object, Target, Source selection
...@@ -142,6 +143,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -142,6 +143,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
/// Pointer to the header to the view widget /// Pointer to the header to the view widget
QHeaderView * viewHeader_; QHeaderView * viewHeader_;
/// Default marker to visualize "source" and "target" object flags
DefaultObjectMarker objectMarker;
//=========================================================================== //===========================================================================
/** @name Slots which are called if data changed /** @name Slots which are called if data changed
......
Supports Markdown
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