Perfomance of the data model / object browser update functionality was much improved.
_PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
if (aSObject) {
DeleteSObject(this, aCStudy, aSObject);
+ UpdateObjBrowser(this, true, aSObject);
}
}
// Finish transaction
aStudyBuilder->CommitCommand();
-
- //GetActiveStudy()->unHighlightAll();
- UpdateObjBrowser(this, true);
}
void
return false;
}
-
+
//---------------------------------------------------------------
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
inline
return;
theModule->application()->putInfo(QObject::tr("INF_DONE"));
- UpdateObjBrowser(theModule);
+ UpdateObjBrowser(theModule,true,aTimeStampSObj);
typedef typename TViewer::TViewWindow TView;
if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView))
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
+
+#include "OB_Browser.h"
+#include "LightApp_DataObject.h"
#include "LightApp_SelectionMgr.h"
#include "SALOME_ListIO.hxx"
return false;
}
+ void
+ UpdateObjBrowser(SalomeApp_Module* theModule,
+ bool theIsUpdateDataModel,
+ _PTR(SObject) theSObject)
+ {
+ LightApp_DataObject* aDataObject = NULL;
+ if(theSObject){
+ std::string anEntry = theSObject->GetID();
+ SalomeApp_Application* anApp = theModule->getApp();
+ OB_Browser* aBrowser = anApp->objectBrowser();
+ DataObjectList aList = aBrowser->getSelected();
+ DataObjectListIterator anIter(aList);
+ while(SUIT_DataObject* anObject = anIter.current()){
+ aDataObject = dynamic_cast<LightApp_DataObject*>(anObject);
+ if(aDataObject){
+ if(anEntry == aDataObject->entry().latin1()){
+ break;
+ }
+ }
+ ++anIter;
+ }
+ }
+ theModule->updateObjBrowser(theIsUpdateDataModel,aDataObject);
+ theModule->getApp()->updateActions();
+ }
+
+ bool
+ IsSObjectTable( _PTR(SObject) theSObject )
+ {
+ if ( theSObject ) {
+ _PTR(GenericAttribute) anAttr;
+ if (theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
+ return true;
+ if (theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))
+ return true;
+ }
+ return false;
+ }
+
VISU_Gen_i*
GetVisuGen(const CAM_Module* theModule)
{
#include "VISUConfig.hh"
-#include "SalomeApp_Module.h"
-#include "SalomeApp_Application.h"
-
#include "SALOMEDSClient_Study.hxx"
#include "SALOMEconfig.h"
class Plot2d_ViewFrame;
class CAM_Module;
class LightApp_SelectionMgr;
+class SalomeApp_Module;
class SalomeApp_Study;
namespace VISU {
bool IsStudyLocked( _PTR(Study) theStudy );
bool CheckLock( _PTR(Study) theStudy );
- inline void UpdateObjBrowser(SalomeApp_Module* theModule,
- bool updateDataModel = true);
+ void UpdateObjBrowser(SalomeApp_Module* theModule,
+ bool theIsUpdateDataModel = true,
+ _PTR(SObject) theSObject = _PTR(SObject)());
VISU_Gen_i* GetVisuGen(const CAM_Module* theModule);
SALOME_MED::MED_Gen_var GetMEDEngine();
VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
_PTR(SObject) theSource,
VISU::Result_var& theResult);
- inline bool IsSObjectTable(_PTR(SObject) theSObject);
+ bool IsSObjectTable(_PTR(SObject) theSObject);
// Views
SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule,
_PTR(SObject) theObject);
}
-bool VISU::IsSObjectTable( _PTR(SObject) theSObject )
-{
- if ( theSObject ) {
- _PTR(GenericAttribute) anAttr;
- if (theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
- return true;
- if (theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))
- return true;
- }
- return false;
-}
-
-void VISU::UpdateObjBrowser(SalomeApp_Module* theModule,
- bool updateDataModel)
-{
- theModule->updateObjBrowser(updateDataModel);
- theModule->getApp()->updateActions();
-}
-
#endif