const bool theSelectable = true)
{
SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theStudy, theIOR );
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = theStudy->GetUseCaseBuilder();
if ( SO->_is_nil() ) {
if ( theTag == 0 )
SO = aStudyBuilder->NewObject( theFatherObject );
CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR );
SALOMEDS::AttributeIOR_wrap iorAttr = anAttr;
iorAttr->SetValue( objStr.in() );
+ // UnRegister() !!!
+ SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
+ if ( !genObj->_is_nil() )
+ genObj->UnRegister();
}
if ( thePixMap ) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
selAttr->SetSelectable( false );
}
+ // add object to the use case tree
+ // (to support tree representation customization and drag-n-drop)
+ useCaseBuilder->AppendTo( SO->GetFather(), SO );
+
return SO._retn();
}
if ( !theSObject->FindSubObject( theTag, aReferenceSO.inout() ))
aReferenceSO = aStudyBuilder->NewObjectToTag( theSObject, theTag );
aStudyBuilder->Addreference( aReferenceSO, aToObjSO );
+ // add reference to the use case tree
+ // (to support tree representation customization and drag-n-drop)
+ theStudy->GetUseCaseBuilder()->AppendTo( aReferenceSO->GetFather(), aReferenceSO );
}
}
return father._retn();
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = theStudy->GetUseCaseBuilder();
SALOMEDS::GenericAttribute_wrap anAttr;
SALOMEDS::AttributePixMap_wrap aPixmap;
aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
CORBA::String_var userName = aComp->componentusername();
SetName( father, userName.in(), "MESH" );
+ // add component to the use case tree
+ // (to support tree representation customization and drag-n-drop)
+ useCaseBuilder->SetRootCurrent();
+ useCaseBuilder->Append( father ); // component object is added as the top level item
if(MYDEBUG) MESSAGE("PublishComponent--END");
return father._retn();
{
CORBA::String_var aResult("");
- SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy,theObject);
+ SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy, theObject );
if ( !aSObj->_is_nil() )
{
SALOMEDS::GenericAttribute_wrap attr;
aResult = strAttr->Value();
}
}
-
- return CORBA::string_dup( aResult.in() );
+ return aResult._retn();
}