From: apo Date: Thu, 11 Aug 2005 06:44:18 +0000 (+0000) Subject: To split the large Build method into less parts. X-Git-Tag: BR-D5-38-2003_D2005-12-09~128 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=928ba35665a386aab04623e7d92c1f2be76baa0e;p=modules%2Fvisu.git To split the large Build method into less parts. Third step - extraction BuildFamilyMap functionality --- diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 18c1ed16..5f579fec 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -591,6 +591,83 @@ namespace } } + + //--------------------------------------------------------------- + void + BuildFamilyMap(PMEDMesh theMesh, + const TFamilyCounterMap& theFamilyNbCellsCounterMap, + const TFamilyCounterMap& theFamilyCellsSizeCounterMap, + const MED::TEntityInfo& theEntityInfo, + const MED::TElemGroup& theElemGroup, + const MED::TFamilyGroup& theFamilyGroup, + MED::PWrapper theMEDWrapper) + { + MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo; + MED::TFamilyByEntity aFamilyByEntity = MED::GetFamiliesByEntity(theMEDWrapper,theElemGroup,theFamilyGroup); + MED::TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin(); + INITMSG(MY_FAMILY_DEBUG,"BuildFamilyMap:\n"); + for(; aFamilyByEntityIter != aFamilyByEntity.end(); aFamilyByEntityIter++){ + const MED::EEntiteMaillage& aMEntity = aFamilyByEntityIter->first; + const MED::TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second; + + TEntity aVEntity = MEDEntityToVTK(aMEntity); + PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity]; + TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; + + if(aFamilyGroup.empty()) + continue; + + INITMSG(MY_FAMILY_DEBUG, + "- aMEntity = "<GetEntityInfo(aMeshInfo); - MED::TElemGroup aElemGroup = MED::GetElemsByEntity(aMed,aMeshInfo,aEntityInfo); + MED::TElemGroup anElemGroup = MED::GetElemsByEntity(aMed,aMeshInfo,aEntityInfo); // creating TMesh structure and TMeshOnEntityMap TInt aDim = aMeshInfo->GetDim(); @@ -674,54 +751,15 @@ VISU_MedConvertor #endif MED::TFamilyGroup aFamilyGroup = MED::GetFamilies(aMed,aMeshInfo); - MED::TFamilyByEntity aFamilyByEntity = MED::GetFamiliesByEntity(aMed,aElemGroup,aFamilyGroup); - MED::TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin(); - BEGMSG(MY_FAMILY_DEBUG,"TFamilyByEntity:\n"); - for(; aFamilyByEntityIter != aFamilyByEntity.end(); aFamilyByEntityIter++){ - const MED::EEntiteMaillage& aMEntity = aFamilyByEntityIter->first; - const MED::TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second; - - TEntity aVEntity = MEDEntityToVTK(aMEntity); - PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity]; - TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; - - if(aFamilyGroup.empty()) - continue; - - INITMSG(MY_FAMILY_DEBUG,"aMEntity = "<GetId() == 0) - continue; - - const std::string& aFamilyName = aFamilyInfo->GetName(); - PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily()); - - aFamily->myId = aFamilyInfo->GetId(); - aFamily->myName = aFamilyInfo->GetName(); - aFamily->myEntity = aVEntity; - aFamily->myNbCells = aFamilyNbCellsCounterMap[aFamily->myId]; - aFamily->myCellsSize = aFamilyCellsSizeCounterMap[aFamily->myId]; - - INITMSG(MY_FAMILY_DEBUG,"aFamilyName = '"<myName<< - "'; myId = "<myId<<"; "<< - "; aNbAttr = "<GetNbAttr()<< - "; aNbGroup = "<GetNbGroup()<< - "; myEntity = "<myEntity<< - "; myNbCells = "<myNbCells<< - "; myCellsSize = "<myCellsSize<<"\n"); - - VISU::TBindGroups& aBindGroups = aFamily->myGroups; - const TInt aNbGroup = aFamilyInfo->GetNbGroup(); - for(TInt i = 0; i < aNbGroup; i++){ - const string& aGroupName = aFamilyInfo->GetGroupName(i); - aBindGroups.insert(aGroupName); - INITMSG(MY_FAMILY_DEBUG,"aGroupName = '"<myGroupMap; MED::TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);