#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
- -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+ACLOCAL_AMFLAGS = -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
if GUI_ENABLE_CORBA
IDLDIR = idl
LXLIB=""
fi
-LOCAL_INCLUDES="$OGL_INCLUDES"
+LOCAL_INCLUDES="$OGL_INCLUDES -DVTK_EXCLUDE_STRSTREAM_HEADERS"
LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $LXLIB -lX11 -lXt"
TRY_LINK_LIBS="-lvtkCommon $LXLIB -lX11 -lXt"
../LogWindow/libLogWindow.la $(CAS_KERNEL) \
../Prs/libSalomePrs.la ../ObjBrowser/libObjBrowser.la ../Style/libSalomeStyle.la \
../Event/libEvent.la \
- $(HDF5_LIBS) $(KERNEL_LDFLAGS) -lSalomeHDFPersist -lSALOMELocalTrace
+ $(KERNEL_LDFLAGS) -lSalomeHDFPersist -lSALOMELocalTrace
if ENABLE_SALOMEOBJECT
libLightApp_la_LIBADD += ../OBJECT/libSalomeObject.la
#include <SALOME_InteractiveObject.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
+#include <sys/time.h>
+static long tt0;
+static long tcount=0;
+static long cumul;
+#define START_TIMING timeval tv; gettimeofday(&tv,0);tt0=tv.tv_usec+tv.tv_sec*1000000;
+#define END_TIMING(NUMBER) \
+ tcount=tcount+1;gettimeofday(&tv,0);cumul=cumul+tv.tv_usec+tv.tv_sec*1000000 -tt0; \
+ if(tcount==NUMBER){ std::cerr << __FILE__ << __LINE__ << " temps CPU(mus): " << cumul << std::endl; tcount=0;cumul=0; }
+
+timeval tv;
/*!
\class SALOMEGUI_Swig
\brief Python interface module for SALOME GUI.
*/
void SALOMEGUI_Swig::updateObjBrowser( bool /*updateSelection*/ )
{
+ gettimeofday(&tv,0);tt0=tv.tv_usec+tv.tv_sec*1000000;
class TEvent: public SALOME_Event
{
public:
TEvent() {}
virtual void Execute()
{
+ END_TIMING(1);
if ( LightApp_Application* anApp = getApplication() ) {
anApp->updateObjectBrowser();
anApp->updateActions(); //SRN: added in order to update the toolbar
*/
void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
{
- std::cerr << " updateTree from SUIT_DataBrowser" << std::endl;
+ //std::cerr << " updateTree from SUIT_DataBrowser" << std::endl;
SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
if ( m ) {
m->updateTree( obj );
#include "SUIT_DataObject.h"
#include "SUIT_DataObjectKey.h"
#include <cstdio>
+#include <iostream>
SUIT_DataObject::Signal* SUIT_DataObject::mySignal = 0;
int pos = position < 0 ? myChildren.count() : position;
myChildren.insert( qMin( pos, (int)myChildren.count() ), obj );
obj->setParent( this );
- signal()->emitInserted( obj, this );
+ if(pos == 0)
+ signal()->emitInserted( obj, this ,0);
+ else
+ signal()->emitInserted( obj, this ,myChildren.at(pos-1));
}
/*!
*/
void SUIT_DataObject::removeChild( SUIT_DataObject* obj, const bool del )
{
+ //std::cerr << "removeChild " << del << std::endl;
if ( !obj )
return;
}
}
+void SUIT_DataObject::Signal::emitUpdated( SUIT_DataObject* object )
+{
+ emit( updated( object) );
+}
+
/*!
\brief Emit signal about data object adding to the parent data object.
\param object data object being added
\param parent parent data object
*/
-void SUIT_DataObject::Signal::emitInserted( SUIT_DataObject* object, SUIT_DataObject* parent )
+void SUIT_DataObject::Signal::emitInserted( SUIT_DataObject* object, SUIT_DataObject* parent,SUIT_DataObject* after )
{
- emit( inserted( object, parent ) );
+ emit( inserted( object, parent ,after) );
}
/*!
}
}
+void SUIT_DataObject::updateItem()
+{
+ signal()->emitUpdated(this);
+}
+
/*!
\brief Updates necessary internal fields of data object
*/
virtual bool isOpen() const;
virtual void setOpen( const bool );
+ virtual void updateItem();
virtual void update();
virtual bool customSorting( const int = NameId ) const;
virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
private:
void emitCreated( SUIT_DataObject* );
void emitDestroyed( SUIT_DataObject* );
- void emitInserted( SUIT_DataObject*, SUIT_DataObject* );
+ void emitInserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* );
+ void emitUpdated( SUIT_DataObject*);
void emitRemoved( SUIT_DataObject*, SUIT_DataObject* );
void deleteLater( SUIT_DataObject* );
signals:
void created( SUIT_DataObject* );
void destroyed( SUIT_DataObject* );
- void inserted( SUIT_DataObject*, SUIT_DataObject* );
+ void updated( SUIT_DataObject* );
+ void inserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* );
void removed( SUIT_DataObject*, SUIT_DataObject* );
friend class SUIT_DataObject;
#include "SUIT_TreeModel.h"
#include "SUIT_TreeSync.h"
#include "SUIT_DataObject.h"
+#include <iostream>
#include <QApplication>
#include <QHash>
SUIT_TreeModel::~SUIT_TreeModel()
{
if ( autoDeleteTree() ) {
- SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ),
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( updated( SUIT_DataObject* ) ), this, SLOT( onUpdated( SUIT_DataObject* ) ) );
delete myRoot;
}
return;
if ( autoDeleteTree() ) {
- SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ,SUIT_DataObject*) ),
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( updated( SUIT_DataObject* ) ), this, SLOT( onUpdated( SUIT_DataObject* ) ) );
delete myRoot;
}
*/
QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
{
+// std::cerr << "SUIT_TreeModel::data " << role << std::endl;
if ( !index.isValid() )
return QVariant();
if ( myAutoUpdate == on )
return;
- SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ),
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( updated( SUIT_DataObject* ) ), this, SLOT( onUpdated( SUIT_DataObject* ) ) );
myAutoUpdate = on;
if ( myAutoUpdate ) {
- SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ),
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ,SUIT_DataObject*) ) );
SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::connect( SIGNAL( updated( SUIT_DataObject* ) ), this, SLOT( onUpdated( SUIT_DataObject* ) ) );
updateTree();
}
*/
void SUIT_TreeModel::initialize()
{
- SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ,SUIT_DataObject*) ),
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::disconnect( SIGNAL( updated( SUIT_DataObject* ) ), this, SLOT( onUpdated( SUIT_DataObject* ) ) );
if ( autoUpdate() ) {
- SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ),
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject* ) ) );
SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ SUIT_DataObject::connect( SIGNAL( updated( SUIT_DataObject* ) ), this, SLOT( onUpdated( SUIT_DataObject* ) ) );
}
myItems.clear(); // ????? is it really necessary
SUIT_TreeModel::TreeItem* parent,
SUIT_TreeModel::TreeItem* after )
{
- std::cerr << " SUIT_TreeModel::createItem " << std::endl;
+ //std::cerr << " SUIT_TreeModel::createItem " << pthread_self() << std::endl;
if ( !obj )
return 0;
return myItems[ obj ];
}
+void SUIT_TreeModel::createItem( SUIT_DataObject* obj, SUIT_DataObject* parent, SUIT_DataObject* after )
+{
+ if ( !treeItem(parent))
+ return;
+ createItem(obj,treeItem(parent),treeItem(after));
+}
+
/*!
\brief Update tree item.
\param item tree item to be updated
void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item )
{
- std::cerr << " SUIT_TreeModel::updateItem " << std::endl;
+ //std::cerr << " SUIT_TreeModel::updateItem " << std::endl;
if ( !item )
return;
*/
void SUIT_TreeModel::updateItem( SUIT_DataObject* obj)
{
- std::cerr << " SUIT_TreeModel::updateItem from SuitObj " << std::endl;
+ //std::cerr << " SUIT_TreeModel::updateItem from SuitObj " << std::endl;
if ( !treeItem(obj))
return;
*/
void SUIT_TreeModel::removeItem( SUIT_TreeModel::TreeItem* item )
{
- std::cerr << " SUIT_TreeModel::removeItem " << std::endl;
+ //std::cerr << " SUIT_TreeModel::removeItem " << std::endl;
if ( !item )
return;
endRemoveRows();
}
+void SUIT_TreeModel::onUpdated( SUIT_DataObject* object)
+{
+ updateItem(object);
+}
+
/*!
\brief Called when the data object is inserted to the tree.
\param object data object being inserted
\param parent parent data object
*/
-void SUIT_TreeModel::onInserted( SUIT_DataObject* /*object*/, SUIT_DataObject* parent )
+void SUIT_TreeModel::onInserted( SUIT_DataObject* object, SUIT_DataObject* parent,SUIT_DataObject* after )
{
+ //std::cerr << "SUIT_TreeModel::onInserted" << std::endl;
+ createItem(object,parent,after);
+ emit modelUpdated();
+ /*
if ( autoUpdate() )
updateTree( parent );
+ */
}
/*!
\param object data object being removed
\param parent parent data object
*/
-void SUIT_TreeModel::onRemoved( SUIT_DataObject* /*object*/, SUIT_DataObject* parent )
+void SUIT_TreeModel::onRemoved( SUIT_DataObject* object, SUIT_DataObject* parent )
{
+ //std::cerr << "onRemoved" << std::endl;
+ removeItem( treeItem(object) );
+ emit modelUpdated();
+ /*
if ( autoUpdate() )
updateTree( parent );
+ */
}
/*!
#include <iostream>
void SUIT_ProxyModel::updateTree( const QModelIndex& index )
{
- std::cerr << "updateTree with QModelIndex from SUIT_ProxyModel" << std::endl;
+ //std::cerr << "updateTree with QModelIndex from SUIT_ProxyModel" << std::endl;
if ( treeModel() )
treeModel()->updateTree( mapToSource( index ) );
}
*/
void SUIT_ProxyModel::updateTree( SUIT_DataObject* obj )
{
- std::cerr << "updateTree with SUIT_DataObj from SUIT_ProxyModel" << std::endl;
+ //std::cerr << "updateTree with SUIT_DataObj from SUIT_ProxyModel" << std::endl;
if ( treeModel() )
treeModel()->updateTree( obj );
}
+void SUIT_ProxyModel::createItem( SUIT_DataObject* obj ,SUIT_DataObject* parent, SUIT_DataObject* after)
+{
+ //std::cerr << "createItem with SUIT_DataObj from SUIT_ProxyModel" << std::endl;
+ if ( treeModel() )
+ treeModel()->createItem( obj , parent, after);
+}
+
void SUIT_ProxyModel::updateItem( SUIT_DataObject* obj )
{
- std::cerr << "updateItem with SUIT_DataObj from SUIT_ProxyModel" << std::endl;
+ //std::cerr << "updateItem with SUIT_DataObj from SUIT_ProxyModel" << std::endl;
if ( treeModel() )
treeModel()->updateItem( obj );
}
virtual void updateTree( const QModelIndex& ) = 0;
virtual void updateTree( SUIT_DataObject* = 0 ) = 0;
virtual void updateItem( SUIT_DataObject* ) = 0;
+ virtual void createItem( SUIT_DataObject*,SUIT_DataObject*,SUIT_DataObject* ) = 0;
virtual void registerColumn( const int group_id, const QString& name, const int custom_id ) = 0;
virtual void unregisterColumn( const int group_id, const QString& name ) = 0;
virtual void updateTree( const QModelIndex& );
virtual void updateTree( SUIT_DataObject* = 0 );
virtual void updateItem( SUIT_DataObject* );
+ virtual void createItem( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject*);
signals:
void modelUpdated();
void removeItem( TreeItem* );
private slots:
- void onInserted( SUIT_DataObject*, SUIT_DataObject* );
+ void onUpdated( SUIT_DataObject*);
+ void onInserted( SUIT_DataObject*, SUIT_DataObject* ,SUIT_DataObject*);
void onRemoved( SUIT_DataObject*, SUIT_DataObject* );
private:
virtual void updateTree( const QModelIndex& );
virtual void updateTree( SUIT_DataObject* = 0 );
virtual void updateItem( SUIT_DataObject* );
+ virtual void createItem( SUIT_DataObject*, SUIT_DataObject*,SUIT_DataObject*);
void setSortingEnabled( bool );
signals:
3. update object browser if it exists */
void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
{
- MESSAGE("UpdateObjBrowser");
+ //MESSAGE("UpdateObjBrowser");
return;
+
+
// update "non-existing" (not loaded yet) data models
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
if ( study )
*/
QPixmap SalomeApp_DataObject::icon( const int id ) const
{
+ //std::cerr << "SalomeApp_DataObject::icon " << pthread_self() << std::endl;
// we display icon only for the first (NameId ) column
if ( id == NameId ) {
_PTR(GenericAttribute) anAttr;
if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){
- MESSAGE("SalomeApp_DataObject::icon : found attributePixmap")
+ // MESSAGE("SalomeApp_DataObject::icon : found attributePixmap")
_PTR(AttributePixMap) aPixAttr ( anAttr );
if ( aPixAttr->HasPixMap() ) {
QString componentType = componentDataType();
}
QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() );
LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
- MESSAGE("SalomeApp_DataObject::icon : after dynamic cast")
+ //MESSAGE("SalomeApp_DataObject::icon : after dynamic cast")
if ( aRoot && aRoot->study() ) {
SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
- MESSAGE("SalomeApp_DataObject::icon : Call to mgr mgr == " << mgr );
- MESSAGE("SalomeApp_DataObject::icon : Call to mgr loadPixmap ( " << componentType.toStdString() << " , " << pixmapName.toStdString() << " )");
+ //MESSAGE("SalomeApp_DataObject::icon : Call to mgr mgr == " << mgr );
+ //MESSAGE("SalomeApp_DataObject::icon : Call to mgr loadPixmap ( " << componentType.toStdString() << " , " << pixmapName.toStdString() << " )");
return mgr->loadPixmap( componentType, pixmapName, false );
}
}
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
+#include <sys/time.h>
+static long tt0;
+static long tcount=0;
+static long cumul;
+#define START_TIMING timeval tv; gettimeofday(&tv,0);tt0=tv.tv_usec+tv.tv_sec*1000000;
+#define END_TIMING(NUMBER) \
+ tcount=tcount+1;gettimeofday(&tv,0);cumul=cumul+tv.tv_usec+tv.tv_sec*1000000 -tt0; \
+ if(tcount==NUMBER){ std::cerr << __FILE__ << __LINE__ << " temps CPU(mus): " << cumul << std::endl; tcount=0;cumul=0; }
+
using namespace std;
virtual void notifyObserver(const char* theID, const char* event)
{
- MESSAGE("I'm notified of " << event << " of ID = " << theID);
+ START_TIMING;
+
+ //MESSAGE("I'm notified of " << event << " of ID = " << theID);
_PTR(SObject) obj = myStudyDS->FindObjectID( theID );
- MESSAGE("Checking the ID from the sObj : " << obj->GetID());
+ //MESSAGE("Checking the ID from the sObj : " << obj->GetID());
std::string entry_str = theID;
int last2Pnt_pos = entry_str.rfind(":");
std::string pos_in_parent=entry_str.substr(last2Pnt_pos+1);
- MESSAGE("Parent id " << parent_id << " with position " << pos_in_parent);
+ //MESSAGE("Parent id " << parent_id << " with position " << pos_in_parent);
_PTR(SObject) obj_parent = myStudyDS->FindObjectID( parent_id );
- MESSAGE("Checking the ID from the sObj_parent : " << obj_parent->GetID());
+ //MESSAGE("Checking the ID from the sObj_parent : " << obj_parent->GetID());
SUIT_DataObject* suit_obj;
if (std::string(event) == "ADD")
{
- MESSAGE("ADDING");
+ //MESSAGE("ADDING");
_PTR(SComponent) aSComp(obj);
- if( aSComp ){
- MESSAGE("This is a module");
- suit_obj=new SalomeApp_ModuleObject(aSComp,0);
+ if( aSComp )
+ {
+ //MESSAGE("This is a module");
+ suit_obj=new SalomeApp_ModuleObject(aSComp,0);
}
- else{
- MESSAGE("This is not a module ");
- suit_obj=new SalomeApp_DataObject(obj,0);
+ else
+ {
+ //MESSAGE("This is not a module ");
+ suit_obj=new SalomeApp_DataObject(obj,0);
}
- if (entry2SuitObject.count(parent_id)>0){
- SUIT_DataObject* father=entry2SuitObject[parent_id];
- SUIT_DataObject* after;
- std::string after_id;
- std::stringstream ss;
- for (int i=atoi(pos_in_parent.c_str());i>0;i--){
- ss << parent_id << ":" << i ;
- after_id = ss.str();
- ss.str("");
- if (entry2SuitObject.count(after_id)>0){
- after=entry2SuitObject[after_id];
- MESSAGE("after_id " << after_id);
- break;
- }
- }
- int pos = after ? father->childPos( after ) : 0;
- father->insertChild(suit_obj,pos+1);
- }
- else{
- MESSAGE("This should be for a module");
- myStudy->root()->appendChild(suit_obj);
- }
- entry2SuitObject[theID]=suit_obj;
+ if (entry2SuitObject.count(parent_id)>0)
+ {
+ SUIT_DataObject* father=entry2SuitObject[parent_id];
+ SUIT_DataObject* after=0;
+ std::string after_id;
+ std::stringstream ss;
+ for (int i=atoi(pos_in_parent.c_str());i>0;i--)
+ {
+ ss << parent_id << ":" << i ;
+ after_id = ss.str();
+ ss.str("");
+ if (entry2SuitObject.count(after_id)>0)
+ {
+ after=entry2SuitObject[after_id];
+ //MESSAGE("after_id " << after_id);
+ break;
+ }
+ }
+ int pos = after ? father->childPos( after ) : 0;
+ father->insertChild(suit_obj,pos+1);
+ }
+ else
+ {
+ //MESSAGE("This should be for a module");
+ SUIT_DataObject* father=myStudy->root();
+ father->appendChild(suit_obj);
+ }
+ entry2SuitObject[theID]=suit_obj;
}
- else if (std::string(event) == "REMOVE"){
- MESSAGE("REMOVING");
-
- if (entry2SuitObject.count(theID)>0){
- suit_obj= entry2SuitObject[theID];
- if (entry2SuitObject.count(parent_id)>0){
- SUIT_DataObject* father=entry2SuitObject[parent_id];
- father->removeChild(suit_obj);
- }
- else{
- MESSAGE("This should be for a module");
- myStudy->root()->removeChild(suit_obj);
- }
- entry2SuitObject.erase(theID);
- }
- else{
- MESSAGE("Want to remove an unknown object");
- }
+ else if (std::string(event) == "REMOVE")
+ {
+ //MESSAGE("REMOVING");
+
+ if (entry2SuitObject.count(theID)>0)
+ {
+ suit_obj= entry2SuitObject[theID];
+ if (entry2SuitObject.count(parent_id)>0)
+ {
+ SUIT_DataObject* father=entry2SuitObject[parent_id];
+ father->removeChild(suit_obj);
+ }
+ else
+ {
+ //MESSAGE("This should be for a module");
+ myStudy->root()->removeChild(suit_obj);
+ }
+ entry2SuitObject.erase(theID);
+ }
+ else
+ {
+ MESSAGE("Want to remove an unknown object" << theID);
+ }
}
- else if (std::string(event) == "MODIFY"){
- MESSAGE("MODIFYING");
- if (entry2SuitObject.count(theID)>0){
- suit_obj= entry2SuitObject[theID];
- LightApp_Application* myApp=dynamic_cast<LightApp_Application*>(myStudy->application());
- if (myApp){
- SUIT_ProxyModel* myModel=dynamic_cast<SUIT_ProxyModel*>(myApp->objectBrowser()->model());
- if (myModel){
- MESSAGE("Call to SUIT_ProxyModel::myModel->updateItem");
- myModel->updateItem(suit_obj);
- }
- }
- }
- else{
- MESSAGE("Want to modify an unknown object");
- }
+ else if (std::string(event) == "MODIFY")
+ {
+ //MESSAGE("MODIFYING");
+ if (entry2SuitObject.count(theID)>0)
+ {
+ suit_obj= entry2SuitObject[theID];
+ suit_obj->updateItem();
+ }
+ else
+ {
+ MESSAGE("Want to modify an unknown object" << theID);
+ }
}
+ END_TIMING(200);
}
-
-
private:
_PTR(Study) myStudyDS;