void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
{
+ // update existing data models (already loaded SComponents)
if ( updateModels )
{
for ( ModuleListIterator it = modules(); it.current(); ++it )
((SalomeApp_DataModel*)camDM)->update();
}
}
+ // update "non-existing" (not loaded yet) data models
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
+ if ( study )
+ {
+ _PTR(Study) stdDS = study->studyDS();
+ if( stdDS )
+ {
+ for ( _PTR(SComponentIterator) it ( stdDS->NewComponentIterator() ); it->More(); it->Next() )
+ {
+ _PTR(SComponent) aComponent ( it->Value() );
+
+ if ( aComponent->ComponentDataType() == "Interface Applicative" )
+ continue; // skip the magic "Interface Applicative" component
+
+ SalomeApp_DataModel::BuildTree( aComponent, study->root(), study, /*skipExisitng=*/true );
+ }
+ }
+ }
+
if ( objectBrowser() )
objectBrowser()->updateTree();
}
//=======================================================================
SUIT_DataObject* SalomeApp_DataModel::BuildTree( const _PTR(SObject)& obj,
SUIT_DataObject* parent,
- SalomeApp_Study* study )
+ SalomeApp_Study* study,
+ bool skip )
{
SalomeApp_DataObject* aDataObj = 0;
if ( !obj || !study )
if ( obj->GetName().size() || obj->ReferencedObject( refObj ) ) // skip nameless non references SObjects
{
_PTR(SComponent) aSComp( obj );
+
+ // patch for bug IPAL9313
+ if ( aSComp && parent && skip )
+ {
+ QString aSName( aSComp->GetName().c_str() );
+ DataObjectList allComponents = parent->children( /*recursive=*/false );
+ for ( DataObjectListIterator it( allComponents ); it.current(); ++it )
+ if ( it.current()->name() == aSName )
+ return it.current();
+ }
+
aDataObj = aSComp ? new SalomeApp_ModuleObject( aSComp, parent ) :
new SalomeApp_DataObject ( obj, parent );
public:
static SUIT_DataObject* BuildTree(const _PTR(SObject)& obj,
SUIT_DataObject* parent,
- SalomeApp_Study* study );
+ SalomeApp_Study* study,
+ bool skip = false );
SalomeApp_DataModel ( CAM_Module* theModule );
virtual ~SalomeApp_DataModel();