aStudyBuilder->NewCommand(); // There is a transaction
QString aComment;
- myInput->BuildEntities();
string aRefFatherEntry = GetRefFatherEntry();
+
+ mySComponent = FindOrCreateVisuComponent(myStudyDocument);
+ CORBA::String_var aSComponentEntry = mySComponent->GetID();
+ CORBA::String_var anIOR(GetID());
+ aComment.sprintf("myComment=%s;myType=%d;myFileName=%s;myInitFileName=%s",
+ GetComment(),
+ VISU::TRESULT,
+ myFileInfo.filePath().latin1(),
+ myInitFileName.c_str()); // Restoring of Python dump
+ string aResultEntry =
+ CreateAttributes(myStudyDocument,
+ aSComponentEntry,
+ aRefFatherEntry.c_str(),
+ anIOR,
+ myName.c_str(),
+ "",
+ aComment.latin1(),
+ true);
+ mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
+ if(!CORBA::is_nil(theSObject)){
+ CORBA::String_var aString = theSObject->GetID();
+ CreateReference(myStudyDocument,aResultEntry,aString.in());
+ }
+
+ myInput->BuildEntities();
const TMeshMap& aMeshMap = myInput->GetMeshMap();
TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
- mySComponent = FindOrCreateVisuComponent(myStudyDocument);
- CORBA::String_var aSComponentEntry = mySComponent->GetID();
- CORBA::String_var anIOR(GetID());
- aComment.sprintf("myComment=%s;myType=%d;myFileName=%s;myInitFileName=%s",
- GetComment(),
- VISU::TRESULT,
- myFileInfo.filePath().latin1(),
- myInitFileName.c_str()); // Restoring of Python dump
- string aResultEntry =
+ const string& aMeshName = aMeshMapIter->first;
+ const PMesh& aMesh = aMeshMapIter->second;
+ const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ if(aMeshOnEntityMap.empty())
+ continue;
+
+ aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
+ aMeshName.c_str(),
+ aMesh->myDim);
+ aMesh->myEntry =
CreateAttributes(myStudyDocument,
- aSComponentEntry,
+ aResultEntry.c_str(),
aRefFatherEntry.c_str(),
- anIOR,
- myName.c_str(),
+ "",
+ aMeshName.c_str(),
"",
aComment.latin1(),
true);
- mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
- if(!CORBA::is_nil(theSObject)){
- CORBA::String_var aString = theSObject->GetID();
- CreateReference(myStudyDocument,aResultEntry,aString.in());
- }
- TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
- for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
- const string& aMeshName = aMeshMapIter->first;
- const PMesh& aMesh = aMeshMapIter->second;
- const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- if(aMeshOnEntityMap.empty())
+
+ aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
+ aMeshName.c_str());
+ string aSubMeshesEntry =
+ CreateAttributes(myStudyDocument,
+ aMesh->myEntry.c_str(),
+ aRefFatherEntry.c_str(),
+ "",
+ "Families",
+ "",
+ aComment.latin1(),
+ true);
+ //Import entities
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+ const TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+ string anEntityName;
+ switch(anEntity){
+ case NODE_ENTITY:
+ anEntityName = "onNodes";
+ break;
+ case EDGE_ENTITY:
+ anEntityName = "onEdges";
+ break;
+ case FACE_ENTITY:
+ anEntityName = "onFaces";
+ break;
+ case CELL_ENTITY:
+ anEntityName = "onCells";
+ break;
+ default:
continue;
-
- aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
+ }
+
+ aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
+ VISU::TENTITY,
aMeshName.c_str(),
- aMesh->myDim);
- aMesh->myEntry =
- CreateAttributes(myStudyDocument,
- aResultEntry.c_str(),
- aRefFatherEntry.c_str(),
- "",
- aMeshName.c_str(),
- "",
- aComment.latin1(),
- true);
-
- aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
- aMeshName.c_str());
- string aSubMeshesEntry =
- CreateAttributes(myStudyDocument,
- aMesh->myEntry.c_str(),
+ anEntity);
+
+ aMeshOnEntity->myEntry =
+ CreateAttributes(myStudyDocument,
+ aSubMeshesEntry.c_str(),
aRefFatherEntry.c_str(),
- "",
- "Families",
- "",
- aComment.latin1(),
+ "",
+ anEntityName.c_str(),
+ "",
+ aComment.latin1(),
true);
- //Import entities
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const TEntity& anEntity = aMeshOnEntityMapIter->first;
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- string anEntityName;
- switch(anEntity){
- case NODE_ENTITY:
- anEntityName = "onNodes";
- break;
- case EDGE_ENTITY:
- anEntityName = "onEdges";
- break;
- case FACE_ENTITY:
- anEntityName = "onFaces";
- break;
- case CELL_ENTITY:
- anEntityName = "onCells";
- break;
- default:
- continue;
- }
-
- aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
- VISU::TENTITY,
- aMeshName.c_str(),
- anEntity);
-
- aMeshOnEntity->myEntry =
- CreateAttributes(myStudyDocument,
- aSubMeshesEntry.c_str(),
- aRefFatherEntry.c_str(),
- "",
- anEntityName.c_str(),
- "",
- aComment.latin1(),
- true);
- }
}
}
void
BuildMinMax(VISU::Result_i* theResult,
VISU_Convertor* theInput,
- CORBA::Boolean theIsDone)
+ CORBA::Boolean& theIsDone)
{
TMemManager aMemManager(theResult);
theInput->BuildMinMax();
theIsDone = true;
}
+
+
+ //---------------------------------------------------------------
+ void
+ BuildMinMaxFields(VISU::Result_i* theResult,
+ VISU_Convertor* theInput,
+ CORBA::Boolean& theFieldsIsDone,
+ CORBA::Boolean& theMinMaxIsDone,
+ SALOMEDS::Study_var theStudyDocument,
+ const std::string& theRefFatherEntry)
+ {
+ BuildFields(theResult,
+ theInput,
+ theFieldsIsDone,
+ theStudyDocument,
+ theRefFatherEntry);
+
+ BuildMinMax(theResult,
+ theInput,
+ theMinMaxIsDone);
+ }
+
}
std::string aRefFatherEntry = GetRefFatherEntry();
- // To start build of the fields
- boost::thread aThread1(boost::bind(&BuildFields,
- this,
- myInput,
- myIsFieldsDone,
- myStudyDocument,
- aRefFatherEntry));
-
- // To start build of the groups
- boost::thread aThread2(boost::bind(&BuildGroups,
- this,
- myInput,
- myIsGroupsDone,
- myStudyDocument,
- aRefFatherEntry));
-
- // To start min/max calculation
- boost::thread aThread3(boost::bind(&BuildMinMax,
- this,
- myInput,
- myIsMinMaxDone));
-
+ {
+ // To start build of the fields and min/max calculation
+ boost::thread aThread(boost::bind(&BuildMinMaxFields,
+ this,
+ myInput,
+ myIsFieldsDone,
+ myIsMinMaxDone,
+ myStudyDocument,
+ aRefFatherEntry));
+ }
+ {
+ // To start build of the groups
+ boost::thread aThread(boost::bind(&BuildGroups,
+ this,
+ myInput,
+ myIsGroupsDone,
+ myStudyDocument,
+ aRefFatherEntry));
+ }
return this;
}
}
myStudyDocument,
aRefFatherEntry);
+ BuildMinMax(this,
+ myInput,
+ myIsMinMaxDone);
+
BuildGroups(this,
myInput,
myIsGroupsDone,
myStudyDocument,
aRefFatherEntry);
- BuildMinMax(this,
- myInput,
- myIsMinMaxDone);
-
BuildAll();
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());