aStudyBuilder->Addreference(aNewObj,aRefSObj);
}
+
+ //---------------------------------------------------------------
+ inline
std::string
CreateAttributes(_PTR(Study) theStudyDocument,
const string& theFatherEntry,
return aNewObj->GetID();
}
+
+ //---------------------------------------------------------------
+ inline
void
UpdateAttributes(_PTR(Study) theStudyDocument,
const string& theEntry,
}
+ //---------------------------------------------------------------
+ inline
+ void
+ RemoveSObject(_PTR(Study) theStudyDocument,
+ const string& theEntry)
+ {
+ TLock aLock(myMutex);
+
+ _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+ _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+ aStudyBuilder->RemoveObject(aSObject);
+ }
+
+
//---------------------------------------------------------------
struct TResultManager
{
VISU_Convertor* theInput,
CORBA::Boolean* theIsDone,
std::string theResultEntry,
+ CORBA::Boolean theIsAtOnce,
CORBA::Boolean theIsBuildGroups,
CORBA::Boolean theIsBuildFields,
_PTR(Study) theStudy)
aComment.latin1(),
true);
- if(theIsBuildGroups){
- aMesh->myGroupsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "",
- "",
- true);
- }
-
- if(theIsBuildFields){
- aMesh->myFieldsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "",
- "",
- true);
+ if(!theIsAtOnce){
+ if(theIsBuildGroups){
+ aMesh->myGroupsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ "",
+ "",
+ "",
+ true);
+ }
+
+ if(theIsBuildFields){
+ aMesh->myFieldsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ "",
+ "",
+ "",
+ true);
+ }
}
//Import entities
VISU_Convertor* theInput,
CORBA::Boolean* theIsDone,
CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
_PTR(Study) theStudy)
{
if(!theIsBuild || *theIsDone)
if(!aGroupMap.empty()){
aComment.sprintf("myComment=GROUPS;myMeshName=%s",
aMeshName.c_str());
- UpdateAttributes(theStudy,
- aMesh->myGroupsEntry,
- "",
- "Groups",
- aComment.latin1());
+
+ if(theIsAtOnce)
+ aMesh->myGroupsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ "",
+ "Groups",
+ aComment.latin1(),
+ true);
+ else
+ UpdateAttributes(theStudy,
+ aMesh->myGroupsEntry,
+ "",
+ "Groups",
+ aComment.latin1());
+
TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
const string& aGroupName = aGroupMapIter->first;
aFamily->myEntry);
}
}
- }
+ }else if(!theIsAtOnce)
+ RemoveSObject(theStudy,
+ aMesh->myGroupsEntry);
}
ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
VISU_Convertor* theInput,
CORBA::Boolean* theIsDone,
CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
_PTR(Study) theStudy)
{
if(!theIsBuild || *theIsDone)
//Import fields
bool anIsFieldsEntryUpdated = false;
-
TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
const TEntity& anEntity = aMeshOnEntityMapIter->first;
if(!anIsFieldsEntryUpdated){
aComment.sprintf("myComment=FIELDS;myMeshName=%s",
aMeshName.c_str());
- UpdateAttributes(theStudy,
- aMesh->myFieldsEntry,
- "",
- "Fields",
- aComment.latin1());
+
+ if(theIsAtOnce)
+ aMesh->myFieldsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ "",
+ "Fields",
+ aComment.latin1(),
+ true);
+ else
+ UpdateAttributes(theStudy,
+ aMesh->myFieldsEntry,
+ "",
+ "Fields",
+ aComment.latin1());
+
anIsFieldsEntryUpdated = true;
}
const string& aFieldName = aFieldMapIter->first;
}
}
}
+
+ if(!anIsFieldsEntryUpdated && !theIsAtOnce)
+ RemoveSObject(theStudy,
+ aMesh->myFieldsEntry);
}
ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
theInput,
theIsFieldsDone,
theIsBuildFields,
+ false,
theStudy);
BuildMinMax(theResult,
theBuildArgs.myInput,
theBuildArgs.myIsEntitiesDone,
theBuildArgs.myResultEntry,
+ false,
theBuildArgs.myIsBuildGroups,
theBuildArgs.myIsBuildFields,
theBuildArgs.myStudy);
theBuildArgs.myInput,
theBuildArgs.myIsGroupsDone,
theBuildArgs.myIsBuildGroups,
+ false,
theBuildArgs.myStudy));
}
{
myInput,
&myIsEntitiesDone,
aResultEntry,
+ theIsAtOnce,
myIsBuildGroups,
myIsBuildFields,
myStudy);
myInput,
&myIsGroupsDone,
myIsBuildGroups,
+ theIsAtOnce,
myStudy);
BuildFields(this,
myInput,
&myIsFieldsDone,
myIsBuildFields,
+ theIsAtOnce,
myStudy);
BuildMinMax(this,