mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-28 06:00:32 +05:00
23586: [EDF] HYDRO: Copy mesh to new geometry
--- GEOM_Gen_i.cc --- In order to assure safe and fast search of initial groups by groups of the new geometry, behavior of GEOM_Gen operations that implement searching and publishing of new groups corresponding to initial groups, is slightly modified. A reference to an initial sub-object is published under a corresponding new sub-object. The modified functions are RestoreSubShapesO(), RestoreGivenSubShapesO() and RestoreSubShapesSO(). --- GEOM_Engine.cxx --- Avoid double removal of GEOM_BaseObject that leads to removal of all attributes from the root TDF label. That caused some regression, don't remember which.
This commit is contained in:
parent
1be0dcd9a7
commit
5d59645403
@ -482,6 +482,10 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject)
|
|||||||
if(!_mapIDDocument.IsBound(aDocID))
|
if(!_mapIDDocument.IsBound(aDocID))
|
||||||
return false; // document is closed...
|
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
|
//Remove an object from the map of available objects
|
||||||
TCollection_AsciiString anID = BuildIDFromObject(theObject);
|
TCollection_AsciiString anID = BuildIDFromObject(theObject);
|
||||||
if (_objects.IsBound(anID)) {
|
if (_objects.IsBound(anID)) {
|
||||||
@ -510,7 +514,6 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject)
|
|||||||
aNode->Remove();
|
aNode->Remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
TDF_Label aLabel = theObject->GetEntry();
|
|
||||||
aLabel.ForgetAllAttributes(Standard_True);
|
aLabel.ForgetAllAttributes(Standard_True);
|
||||||
|
|
||||||
// Remember the label to reuse it then
|
// Remember the label to reuse it then
|
||||||
@ -1432,7 +1435,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
|
|||||||
|
|
||||||
if(MYDEBUG) {
|
if(MYDEBUG) {
|
||||||
cout<<"Variables from SObject:"<<endl;
|
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;
|
cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1449,7 +1452,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
|
|||||||
//Replace parameters by variables
|
//Replace parameters by variables
|
||||||
Standard_Integer aStartPos = 0;
|
Standard_Integer aStartPos = 0;
|
||||||
Standard_Integer aEndPos = 0;
|
Standard_Integer aEndPos = 0;
|
||||||
int iVar = 0;
|
size_t iVar = 0;
|
||||||
TCollection_AsciiString aVar, aReplacedVar;
|
TCollection_AsciiString aVar, aReplacedVar;
|
||||||
for(Standard_Integer i=aFirstParam;i <= aTotalNbParams;i++) {
|
for(Standard_Integer i=aFirstParam;i <= aTotalNbParams;i++) {
|
||||||
//Replace first parameter (bettwen '(' character and first ',' character)
|
//Replace first parameter (bettwen '(' character and first ',' character)
|
||||||
@ -1984,7 +1987,7 @@ ObjectStates::~ObjectStates()
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
TState ObjectStates::GetCurrectState() const
|
TState ObjectStates::GetCurrectState() const
|
||||||
{
|
{
|
||||||
if(_states.size() > _dumpstate)
|
if((int)_states.size() > _dumpstate)
|
||||||
return _states[_dumpstate];
|
return _states[_dumpstate];
|
||||||
return TState();
|
return TState();
|
||||||
}
|
}
|
||||||
|
@ -1104,6 +1104,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
|
|||||||
// Reconstruct arguments and tree of sub-shapes of the arguments
|
// Reconstruct arguments and tree of sub-shapes of the arguments
|
||||||
CORBA::String_var anIOR;
|
CORBA::String_var anIOR;
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
||||||
|
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
|
||||||
for (Standard_Integer i = 0; i < aLength; i++)
|
for (Standard_Integer i = 0; i < aLength; i++)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anArgO = aList[i];
|
GEOM::GEOM_Object_var anArgO = aList[i];
|
||||||
@ -1270,7 +1271,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
|
|||||||
if (!CORBA::is_nil(anArgSO)) {
|
if (!CORBA::is_nil(anArgSO)) {
|
||||||
SALOMEDS::SObject_var aSubSO;
|
SALOMEDS::SObject_var aSubSO;
|
||||||
if (!CORBA::is_nil(theSObject))
|
if (!CORBA::is_nil(theSObject))
|
||||||
|
{
|
||||||
aSubSO = aStudyBuilder->NewObject(theSObject);
|
aSubSO = aStudyBuilder->NewObject(theSObject);
|
||||||
|
useCaseBuilder->AppendTo( theSObject, aSubSO );
|
||||||
|
}
|
||||||
|
|
||||||
// Restore published sub-shapes of the argument
|
// Restore published sub-shapes of the argument
|
||||||
GEOM::ListOfGO_var aSubParts =
|
GEOM::ListOfGO_var aSubParts =
|
||||||
@ -1411,6 +1415,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
|
|||||||
return aParts._retn();
|
return aParts._retn();
|
||||||
|
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
||||||
|
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
|
||||||
|
|
||||||
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
||||||
@ -1529,6 +1534,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
|
|||||||
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
|
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
|
||||||
aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture());
|
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
|
// Restore published sub-shapes of the argument
|
||||||
GEOM::ListOfGO_var aSubParts;
|
GEOM::ListOfGO_var aSubParts;
|
||||||
@ -1545,8 +1554,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
|
|||||||
else { // GetInPlace failed, try to build from published parts
|
else { // GetInPlace failed, try to build from published parts
|
||||||
SALOMEDS::SObject_var aNewSubSO;
|
SALOMEDS::SObject_var aNewSubSO;
|
||||||
if (!CORBA::is_nil(theNewSO))
|
if (!CORBA::is_nil(theNewSO))
|
||||||
|
{
|
||||||
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
|
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
|
||||||
|
useCaseBuilder->AppendTo( theNewSO, aNewSubSO );
|
||||||
|
}
|
||||||
// Restore published sub-shapes of the argument
|
// Restore published sub-shapes of the argument
|
||||||
GEOM::ListOfGO_var aSubParts =
|
GEOM::ListOfGO_var aSubParts =
|
||||||
RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
|
RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
|
||||||
@ -1701,6 +1712,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu
|
|||||||
// Reconstruct arguments and tree of sub-shapes of the arguments
|
// Reconstruct arguments and tree of sub-shapes of the arguments
|
||||||
CORBA::String_var anIOR;
|
CORBA::String_var anIOR;
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
||||||
|
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
|
||||||
for (Standard_Integer i = 0; i < nbArgsActual; i++)
|
for (Standard_Integer i = 0; i < nbArgsActual; i++)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anArgO = aList[i];
|
GEOM::GEOM_Object_var anArgO = aList[i];
|
||||||
@ -1819,8 +1831,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu
|
|||||||
if (!CORBA::is_nil(anArgSO)) {
|
if (!CORBA::is_nil(anArgSO)) {
|
||||||
SALOMEDS::SObject_var aSubSO;
|
SALOMEDS::SObject_var aSubSO;
|
||||||
if (!CORBA::is_nil(theSObject))
|
if (!CORBA::is_nil(theSObject))
|
||||||
|
{
|
||||||
aSubSO = aStudyBuilder->NewObject(theSObject);
|
aSubSO = aStudyBuilder->NewObject(theSObject);
|
||||||
|
useCaseBuilder->AppendTo( theSObject, aSubSO );
|
||||||
|
}
|
||||||
// Restore published sub-shapes of the argument
|
// Restore published sub-shapes of the argument
|
||||||
GEOM::ListOfGO_var aSubParts =
|
GEOM::ListOfGO_var aSubParts =
|
||||||
RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO,
|
RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO,
|
||||||
@ -1955,6 +1969,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr
|
|||||||
return aParts._retn();
|
return aParts._retn();
|
||||||
|
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
|
||||||
|
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
|
||||||
|
|
||||||
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
||||||
@ -2078,6 +2093,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr
|
|||||||
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
|
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
|
||||||
aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture());
|
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
|
// Restore published sub-shapes of the argument
|
||||||
GEOM::ListOfGO_var aSubParts;
|
GEOM::ListOfGO_var aSubParts;
|
||||||
@ -2094,8 +2113,10 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr
|
|||||||
else { // GetInPlace failed, try to build from published parts
|
else { // GetInPlace failed, try to build from published parts
|
||||||
SALOMEDS::SObject_var aNewSubSO;
|
SALOMEDS::SObject_var aNewSubSO;
|
||||||
if (!CORBA::is_nil(theNewSO))
|
if (!CORBA::is_nil(theNewSO))
|
||||||
|
{
|
||||||
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
|
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
|
||||||
|
useCaseBuilder->AppendTo( theNewSO, aNewSubSO );
|
||||||
|
}
|
||||||
// Restore published sub-shapes of the argument
|
// Restore published sub-shapes of the argument
|
||||||
GEOM::ListOfGO_var aSubParts =
|
GEOM::ListOfGO_var aSubParts =
|
||||||
RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
|
RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
|
||||||
|
Loading…
Reference in New Issue
Block a user