if(!_document)
return false; // document is closed...
+ TDF_Label aLabel = theObject->GetEntry();
+ if ( aLabel == aLabel.Root() )
+ return false; // already removed object
+
//Remove an object from the map of available objects
TCollection_AsciiString anID = BuildIDFromObject(theObject);
if (_objects.IsBound(anID)) {
aNode->Remove();
}
- TDF_Label aLabel = theObject->GetEntry();
aLabel.ForgetAllAttributes(Standard_True);
// Remember the label to reuse it then
if(MYDEBUG) {
cout<<"Variables from SObject:"<<endl;
- for (int i = 0; i < aVariables.size();i++)
+ for (size_t i = 0; i < aVariables.size();i++)
cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<endl;
}
//Replace parameters by variables
Standard_Integer aStartPos = 0;
Standard_Integer aEndPos = 0;
- int iVar = 0;
+ size_t iVar = 0;
TCollection_AsciiString aVar, aReplacedVar;
for(Standard_Integer i=aFirstParam;i <= aTotalNbParams;i++) {
//Replace first parameter (bettwen '(' character and first ',' character)
//================================================================================
TState ObjectStates::GetCurrectState() const
{
- if(_states.size() > _dumpstate)
+ if((int)_states.size() > _dumpstate)
return _states[_dumpstate];
return TState();
}
// Reconstruct arguments and tree of sub-shapes of the arguments
CORBA::String_var anIOR;
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
for (Standard_Integer i = 0; i < aLength; i++)
{
GEOM::GEOM_Object_var anArgO = aList[i];
if (!CORBA::is_nil(anArgSO)) {
SALOMEDS::SObject_var aSubSO;
if (!CORBA::is_nil(theSObject))
+ {
aSubSO = aStudyBuilder->NewObject(theSObject);
+ useCaseBuilder->AppendTo( theSObject, aSubSO );
+ }
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/)
return aParts._retn();
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
// Get interface, containing method, which we will use to reconstruct sub-shapes
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations();
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture());
}
+ // reference to arg
+ SALOMEDS::SObject_wrap aReferenceSO = aStudyBuilder->NewObject( aNewSubSO );
+ aStudyBuilder->Addreference( aReferenceSO, anOldSubSO );
+ useCaseBuilder->AppendTo( theNewSO, aReferenceSO );
}
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts;
else { // GetInPlace failed, try to build from published parts
SALOMEDS::SObject_var aNewSubSO;
if (!CORBA::is_nil(theNewSO))
+ {
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
-
+ useCaseBuilder->AppendTo( theNewSO, aNewSubSO );
+ }
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO,
// Reconstruct arguments and tree of sub-shapes of the arguments
CORBA::String_var anIOR;
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
for (Standard_Integer i = 0; i < nbArgsActual; i++)
{
GEOM::GEOM_Object_var anArgO = aList[i];
if (!CORBA::is_nil(anArgSO)) {
SALOMEDS::SObject_var aSubSO;
if (!CORBA::is_nil(theSObject))
+ {
aSubSO = aStudyBuilder->NewObject(theSObject);
-
+ useCaseBuilder->AppendTo( theSObject, aSubSO );
+ }
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
RestoreGivenSubShapesOneLevel(anArgSO, aSubSO,
CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/)
return aParts._retn();
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
// Get interface, containing method, which we will use to reconstruct sub-shapes
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations();
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture());
}
+ // reference to arg
+ SALOMEDS::SObject_wrap aReferenceSO = aStudyBuilder->NewObject( aNewSubSO );
+ aStudyBuilder->Addreference( aReferenceSO, anOldSubSO );
+ useCaseBuilder->AppendTo( theNewSO, aReferenceSO );
}
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts;
else { // GetInPlace failed, try to build from published parts
SALOMEDS::SObject_var aNewSubSO;
if (!CORBA::is_nil(theNewSO))
+ {
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
-
+ useCaseBuilder->AppendTo( theNewSO, aNewSubSO );
+ }
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO,