#define USER_INTERLACE MED_FULL_INTERLACE
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
if(aNbCells > 0){
- PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TCMeshOnEntity());
- aMeshOnEntity->myMeshName = aMeshName.in();
- aMeshOnEntity->myEntity = aVEntity;
- aMeshOnEntity->myNbCells = aNbCells;
- aMeshOnEntity->myCellsSize = aCellsSize;
- aMeshOnEntity->mySupport = aMEDSupport;
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()){
+ PCMeshOnEntity aMeshOnEntity(new TCMeshOnEntity());
+ aMeshOnEntity->myMeshName = aMeshName.in();
+ aMeshOnEntity->myEntity = aVEntity;
+ aMeshOnEntity->myNbCells = aNbCells;
+ aMeshOnEntity->myCellsSize = aCellsSize;
+ aMeshOnEntity->mySupport = aMEDSupport;
+ aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
+ }
}
}
}
GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aFamily = '"<<aSupportName<<
- "'; anIsOnAllElements = "<<anIsOnAllElements<<
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aFamily = '"<<aSupportName<<"'"<<
+ "; anIsOnAllElements = "<<anIsOnAllElements<<
"; aVEntity = "<<aVEntity<<
"; aNbCells = "<<aNbCells);
if(aNbCells > 0){
TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- PCFamily aFamily = aFamilyMap[aSupportName.in()](new TCFamily());
- aFamily->myEntity = aVEntity;
- aFamily->myNbCells = aNbCells;
- aFamily->myCellsSize = aCellsSize;
- aFamily->myId = aMEDFamily->getIdentifier();
- aFamily->myName = aSupportName.in();
- aFamily->myFamily = aMEDFamily;
+ TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
+ if(aFamilyMapIter == aFamilyMap.end()){
+ PCFamily aFamily(new TCFamily());
+ aFamily->myEntity = aVEntity;
+ aFamily->myNbCells = aNbCells;
+ aFamily->myCellsSize = aCellsSize;
+ aFamily->myId = aMEDFamily->getIdentifier();
+ aFamily->myName = aSupportName.in();
+ aFamily->myFamily = aMEDFamily;
+ aFamilyMap[aSupportName.in()] = aFamily;
+ }
}
}
}
CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aGroup = '"<<aSupportName<<
- "'; anIsOnAllElements = "<<anIsOnAllElements<<
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aGroup = '"<<aSupportName<<"'"<<
+ "; anIsOnAllElements = "<<anIsOnAllElements<<
"; aVEntity = "<<aVEntity);
PCGroup aGroup(new TCGroup());
CORBA::String_var aMeshName = aMEDMesh->getName();
CORBA::String_var aFieldName = aMEDField->getName();
- PCMesh aMesh = myMeshMap[aMeshName.in()](new TCMesh());
- aMesh->myNamedPointCoords(new TNamedPointCoords());
- aMesh->myNbPoints = aMEDMesh->getNumberOfNodes();
- aMesh->myDim = aMEDMesh->getSpaceDimension();
- aMesh->myName = aMeshName.in();
- aMesh->myMesh = aMEDMesh;
+ PCMesh aMesh;
+ TMeshMap::const_iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
+ if(aMeshMapIter == myMeshMap.end()){
+ aMesh.reset(new TCMesh());
+ aMesh->myNamedPointCoords(new TNamedPointCoords());
+ aMesh->myNbPoints = aMEDMesh->getNumberOfNodes();
+ aMesh->myDim = aMEDMesh->getSpaceDimension();
+ aMesh->myName = aMeshName.in();
+ aMesh->myMesh = aMEDMesh;
+
+ TNamedPointCoords& aCoords = aMesh->myNamedPointCoords;
+ aCoords.Init(aMesh->myNbPoints,aMesh->myDim);
- TNamedPointCoords& aCoords = aMesh->myNamedPointCoords;
- aCoords.Init(aMesh->myNbPoints,aMesh->myDim);
+ myMeshMap[aMeshName.in()] = aMesh;
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<"'; myDim = "<<aMesh->myDim);
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aDim = "<<aMesh->myDim);
+ }else
+ aMesh = aMeshMapIter->second;
+ PCMeshOnEntity aMeshOnEntity;
TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TCMeshOnEntity());
- aMeshOnEntity->myEntity = aVEntity;
- aMeshOnEntity->myMeshName = aMeshName.in();
- aMeshOnEntity->mySupport = aMEDSupport;
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()){
+ aMeshOnEntity.reset(new TCMeshOnEntity());
+ aMeshOnEntity->myEntity = aVEntity;
+ aMeshOnEntity->myMeshName = aMeshName.in();
+ aMeshOnEntity->mySupport = aMEDSupport;
+ aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
+ }else
+ aMeshOnEntity = aMeshOnEntityMapIter->second;
PCMeshOnEntity aMeshOnEntity2;
if(aVEntity == NODE_ENTITY){
- aMeshOnEntity2 = aMeshOnEntityMap[CELL_ENTITY](new TCMeshOnEntity());
- aMeshOnEntity2->myEntity = CELL_ENTITY;
+ TEntity aVEntity2 = CELL_ENTITY;
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter2 = aMeshOnEntityMap.find(aVEntity2);
+ if(aMeshOnEntityMapIter2 == aMeshOnEntityMap.end()){
+ aMeshOnEntity2.reset(new TCMeshOnEntity());
+ aMeshOnEntity2->myEntity = aVEntity2;
+ aMeshOnEntity2->myMeshName = aMeshName.in();
+ aMeshOnEntity2->mySupport = aMEDSupport;
+ aMeshOnEntityMap[aVEntity2] = aMeshOnEntity2;
+ }else
+ aMeshOnEntity2 = aMeshOnEntityMapIter2->second;
+ GetCellsSize(aMesh,aMEDMesh,aVEntity2);
}else{
- aMeshOnEntity2 = aMeshOnEntityMap[NODE_ENTITY](new TCMeshOnEntity());
- aMeshOnEntity2->myEntity = NODE_ENTITY;
+ TEntity aVEntity2 = NODE_ENTITY;
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter2 = aMeshOnEntityMap.find(aVEntity2);
+ if(aMeshOnEntityMapIter2 == aMeshOnEntityMap.end()){
+ aMeshOnEntity2.reset(new TCMeshOnEntity());
+ aMeshOnEntity2->myEntity = aVEntity2;
+ aMeshOnEntity2->myMeshName = aMeshName.in();
+ aMeshOnEntity2->mySupport = aMEDSupport;
+ aMeshOnEntityMap[aVEntity2] = aMeshOnEntity2;
+ }else
+ aMeshOnEntity2 = aMeshOnEntityMapIter2->second;
+ GetCellsSize(aMesh,aMEDMesh,aVEntity2);
}
- aMeshOnEntity2->myMeshName = aMeshName.in();
- aMeshOnEntity2->mySupport = aMEDSupport;
- GetCellsSize(aMesh,aMEDMesh,aMeshOnEntity2->myEntity);
-
GetCellsSize(aMesh,aMEDMesh,aVEntity);
- TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
+
PCField aField;
+ TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ TFieldMap::const_iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
if(aFieldMapIter == aFieldMap.end()){
- aField = aFieldMap[aFieldName.in()](new TCField());
- CORBA::Short iField = mySObject->Tag();
- aField->myId = iField;
+ aField.reset(new TCField());
+ aField->myId = mySObject->Tag();
aField->myName = aFieldName.in();
aField->myEntity = aVEntity;
aField->myMeshName = aMeshName.in();
aField->InitArrays(aMEDField->getNumberOfComponents());
aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
+
+ aFieldMap[aFieldName.in()] = aField;
+
if(MYDEBUG)
MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
- }
+ }else
+ aField = aFieldMapIter->second;
+
TValField& aValField = aField->myValField;
int anId = aMEDField->getIterationNumber();
PCValForTime aValForTime = aValField[anId](new TCValForTime());
aValForTime->myTime = TTime(aDT,"");
aValForTime->myField = aMEDField;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
- "'; myEntity = "<<aVEntity<<"; myTime = "<<aDT);
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; myEntity = "<<aVEntity<<
+ "; myTime = "<<aDT<<
+ "; anId = "<<anId);
}
return this;
}