#define USER_INTERLACE MED_FULL_INTERLACE
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
extern "C" {
- VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) {
+ VISU_Convertor*
+ CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject)
+ {
return new VISU_MEDConvertor(theMedSObject);
}
- VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) {
+
+ VISU_Convertor*
+ CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField)
+ {
return new VISU_MEDFieldConvertor(theField);
}
}
vtkIdType aNbCells, aCellsSize;
GetCellsSize(aNbCells,aCellsSize,theMEDMesh,CELL_ENTITY);
if(aNbCells > 0){
- PCMeshOnEntity aMeshOnCells = aMeshOnEntityMap[CELL_ENTITY];
- aMeshOnCells->myEntity = VISU::CELL_ENTITY;
- aMeshOnCells->myMeshName = theMesh->myName;
- aMeshOnCells->myNbCells = aNbCells;
- aMeshOnCells->myCellsSize = aCellsSize;
+
+ TMeshOnEntityMap::iterator aIter = aMeshOnEntityMap.find(CELL_ENTITY);
+ if (aIter != aMeshOnEntityMap.end()){
+ VISU::PCMeshOnEntity aMeshOnCells = aIter->second;
+
+ aMeshOnCells->myEntity = VISU::CELL_ENTITY;
+ aMeshOnCells->myMeshName = theMesh->myName;
+ aMeshOnCells->myNbCells = aNbCells;
+ aMeshOnCells->myCellsSize = aCellsSize;
+ }
}
- }else
+ }else{
GetCellsSize(aMeshOnEntity->myNbCells,aMeshOnEntity->myCellsSize,theMEDMesh,theEntity);
+ }
}
}
bool anIsSuccess = false;
TSObjectByName::TRet aSObjectByNameRet =
Find(aMedCompSObj,aStudy,TSObjectByName("MEDMESH"),anIsSuccess);
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - Find ('"<<"MEDMESH"<<"') = "<<anIsSuccess);
if(anIsSuccess){
SALOMEDS::SObject_var aMeshesSObj = boost::get<0>(aSObjectByNameRet);
for(int iMesh = 0; iMesh < aNbMeshes; iMesh++){
CORBA::String_var aMeshName = aMeshNames[iMesh];
TMeshByName::TRet aMeshByNameRet =
Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
if(!anIsSuccess)
continue;
if(MYDEBUG)
MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
+ std::string aName = aMeshName.in();
+ std::replace(aName.begin(),aName.end(),' ','_');
+
anIsSuccess = false;
std::ostringstream aStream;
- aStream<<"MEDSUPPORTS_OF_"<<aMeshName.in();
+ aStream<<"MEDSUPPORTS_OF_"<<aName;
std::string aSupportsName(aStream.str());
TSObjectByName::TRet aSObjectByNameRet =
Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
if(!anIsSuccess)
continue;
TGroupMap& aGroupMap = aMesh->myGroupMap;
PCGroup aGroup = aGroupMap[aSupportName.in()](new TCGroup());
aGroup->myGroup = aMEDGroup;
+ aGroup->myName = aSupportName.in();
+ aGroup->myMeshName = aMeshName.in();
+ VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
+
SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
int iFamilyEnd = aFamilies->length();
for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
CORBA::String_var aFamilyName = aMEDFamily->getName();
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"'");
PFamily aFamily = FindFamily(aMesh,aFamilyName.in());
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
if(aFamily){
+ TFamilyAndEntity aFamilyAndEntity(aFamilyName.in(),aFamily->myEntity);
+ aFamilyAndEntitySet.insert(aFamilyAndEntity);
+
+ aGroup->myNbCells += aFamily->myNbCells;
+ aGroup->myCellsSize += aFamily->myCellsSize;
+
VISU::TBindGroups& aBindGroups = aFamily->myGroups;
aBindGroups.insert(aSupportName.in());
}
aMesh->myName = aMeshName.in();
aMesh->myNbPoints = aMEDMesh->getNumberOfNodes();
aMesh->myMesh = aMEDMesh;
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<"'; myDim = "<<aMesh->myDim);
TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TCMeshOnEntity());
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName.in();
aMeshOnEntity->mySupport = aMEDSupport;
-
if(aVEntity == NODE_ENTITY){
PCMeshOnEntity aMeshOnEntity2 = aMeshOnEntityMap[CELL_ENTITY](new TCMeshOnEntity());
*aMeshOnEntity2 = *aMeshOnEntity;
GetCellsSize(aMesh,aMEDMesh,NODE_ENTITY);
}
GetCellsSize(aMesh,aMEDMesh,aVEntity);
-
TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
PCField aField;
aField->myCompNames.resize(aField->myNbComp);
aField->myUnitNames.resize(aField->myNbComp);
}
-
TValField& aValField = aField->myValField;
int anId = aMEDField->getIterationNumber();
PCValForTime aValForTime = aValField[anId](new TCValForTime());