//---------------------------------------------------------------
- TSource::TSource():
- mySource(vtkUnstructuredGrid::New())
+ TSource::TSource()
+ {}
+
+ const TVTKSource&
+ TSource
+ ::GetSource() const
{
- mySource->Delete();
+ if(!mySource.GetPointer()){
+ mySource = vtkUnstructuredGrid::New();
+ mySource->Delete();
+ }
+ return mySource;
}
//---------------------------------------------------------------
- TAppendFilter::TAppendFilter():
- myFilter(vtkAppendFilter::New())
+ TAppendFilter::TAppendFilter()
+ {}
+
+ const TVTKAppendFilter&
+ TAppendFilter
+ ::GetFilter() const
{
- myFilter->Delete();
+ if(!myFilter.GetPointer()){
+ myFilter = vtkAppendFilter::New();
+ myFilter->Delete();
+ }
+ return myFilter;
}
//---------------------------------------------------------------
void
- GetPoints(VISU::TVTKSource& theSource,
- VISU::PMeshImpl theMesh)
+ GetPoints(const TVTKSource& theSource,
+ const PMeshImpl& theMesh)
{
TVTKPoints& aPoints = theMesh->myPoints;
const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
//---------------------------------------------------------------
void
- GetCellsOnEntity(VISU::TVTKSource& theSource,
- const VISU::PMeshOnEntityImpl theMeshOnEntity,
- const string& theFamilyName)
+ GetCellsOnEntity(const TVTKSource& theSource,
+ const PMeshOnEntityImpl& theMeshOnEntity,
+ const std::string& theFamilyName)
{
//Check on existing family
PFamilyImpl aFamily = GetFamily(theMeshOnEntity,theFamilyName);
//---------------------------------------------------------------
void
- GetCellsOnGroup(VISU::TVTKSource& theSource,
- VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
+ GetCellsOnGroup(const TVTKSource& theSource,
+ const PMeshImpl& theMesh,
+ const TFamilyAndEntitySet& theFamilyAndEntitySet)
{
//Calculate dimentions of the group
INITMSG(MYDEBUG,"GetCellsOnGroup\n");
//---------------------------------------------------------------
std::string
- GenerateFieldName(const VISU::PFieldImpl theField,
- const VISU::PValForTimeImpl theValForTime)
+ GenerateFieldName(const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime)
{
const VISU::TTime& aTime = theValForTime->myTime;
string aFieldName = theField->myMeshName + ", " + theField->myName + ": " +
//---------------------------------------------------------------
void
- GetTimeStampOnProfile(VISU::TVTKSource& theSource,
- const VISU::PFieldImpl theField,
- const VISU::PValForTimeImpl theValForTime)
+ GetTimeStampOnProfile(const TVTKSource& theSource,
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime)
{
int aNbTuples = theField->myDataSize/theField->myNbComp;
string aFieldName = GenerateFieldName(theField,theValForTime);
//---------------------------------------------------------------
void
- GetCells(VISU::TVTKSource& theSource,
- PSubProfileImpl theSubProfile,
- PMeshOnEntityImpl theMeshOnEntity)
+ GetCells(const TVTKSource& theSource,
+ const PSubProfileImpl& theSubProfile,
+ const PMeshOnEntityImpl& theMeshOnEntity)
{
vtkIdType aNbCells = theSubProfile->myNbCells;
vtkIdType aCellsSize = theSubProfile->myCellsSize;
//---------------------------------------------------------------
void
- GetMeshOnSubProfile(PMeshImpl theMesh,
- PMeshOnEntityImpl theMeshOnEntity,
- PProfileImpl theProfile,
- PSubProfileImpl theSubProfile)
+ GetMeshOnSubProfile(const PMeshImpl& theMesh,
+ const PMeshOnEntityImpl& theMeshOnEntity,
+ const PProfileImpl& theProfile,
+ const PSubProfileImpl& theSubProfile)
{
INITMSG(MYDEBUG,"GetMeshOnSubProfile - aGeom = "<<theSubProfile->myGeom<<endl);
- TVTKSource& aSource = theSubProfile->mySource;
+ const TVTKSource& aSource = theSubProfile->GetSource();
if(theSubProfile->myIsVTKDone)
return;
//---------------------------------------------------------------
void
- GetMeshOnProfile(PMeshImpl theMesh,
- PMeshOnEntityImpl theMeshOnEntity,
- PProfileImpl theProfile)
+ GetMeshOnProfile(const PMeshImpl& theMesh,
+ const PMeshOnEntityImpl& theMeshOnEntity,
+ const PProfileImpl& theProfile)
{
if(theProfile->myIsVTKDone)
return;
- TVTKAppendFilter& anAppendFilter = theProfile->myFilter;
+ const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
if(theProfile->myIsAll){
- TVTKSource& aSource = theMeshOnEntity->mySource;
+ const TVTKSource& aSource = theMeshOnEntity->GetSource();
anAppendFilter->AddInput(aSource.GetPointer());
}else{
const TGeom2SubProfile& aGeom2SubProfile = theProfile->myGeom2SubProfile;
theProfile,
aSubProfile);
- TVTKSource& aSource = aSubProfile->mySource;
+ const TVTKSource& aSource = aSubProfile->GetSource();
anAppendFilter->AddInput(aSource.GetPointer());
}
}
//---------------------------------------------------------------
void
- GetTimeStampOnGaussMesh(VISU::TVTKSource& theSource,
- const VISU::PFieldImpl theField,
- const VISU::PValForTimeImpl theValForTime)
+ GetTimeStampOnGaussMesh(const TVTKSource& theSource,
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime)
{
int aNbTuples = theSource->GetNumberOfPoints();
std::string aFieldName = GenerateFieldName(theField,theValForTime);
//---------------------------------------------------------------
void
- GetSource(VISU::TVTKSource& theSource,
- PGaussSubMeshImpl theGaussSubMesh,
- PMeshOnEntityImpl theMeshOnEntity)
+ GetSource(const TVTKSource& theSource,
+ const PGaussSubMeshImpl& theGaussSubMesh,
+ const PMeshOnEntityImpl& theMeshOnEntity)
{
const TPointCoords& aCoords = theGaussSubMesh->myPointCoords;
vtkIdType aNbPoints = aCoords.GetNbPoints();
for(int i = 0; aConnectivity->GetNextCell(npts,pts); i++)
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
- TVTKSource& aSource = theGaussSubMesh->mySource;
+ const TVTKSource& aSource = theGaussSubMesh->GetSource();
aSource->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
aSource->SetPoints(aPoints.GetPointer());
//---------------------------------------------------------------
void
- GetGaussSubMesh(PMeshImpl theMesh,
- PMeshOnEntityImpl theMeshOnEntity,
- PGaussMeshImpl theGaussMesh,
- PGaussSubMeshImpl theGaussSubMesh)
+ GetGaussSubMesh(const PMeshImpl& theMesh,
+ const PMeshOnEntityImpl& theMeshOnEntity,
+ const PGaussMeshImpl& theGaussMesh,
+ const PGaussSubMeshImpl& theGaussSubMesh)
{
PGaussImpl aGauss = theGaussSubMesh->myGauss;
INITMSG(MYDEBUG,"GetGaussSubMesh - aGeom = "<<aGauss->myGeom<<endl);
if(theGaussSubMesh->myIsVTKDone)
return;
- TVTKSource& aSource = theGaussSubMesh->mySource;
+ const TVTKSource& aSource = theGaussSubMesh->GetSource();
GetSource(aSource,theGaussSubMesh,theMeshOnEntity);
INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
//---------------------------------------------------------------
void
- GetGaussMesh(PMeshImpl theMesh,
- PMeshOnEntityImpl theMeshOnEntity,
- PGaussMeshImpl theGaussMesh)
+ GetGaussMesh(const PMeshImpl& theMesh,
+ const PMeshOnEntityImpl& theMeshOnEntity,
+ const PGaussMeshImpl& theGaussMesh)
{
if(theGaussMesh->myIsVTKDone)
return;
INITMSG(MYDEBUG,"GetGaussMesh"<<endl);
- TVTKAppendFilter& anAppendFilter = theGaussMesh->myFilter;
+ const TVTKAppendFilter& anAppendFilter = theGaussMesh->GetFilter();
const TGeom2GaussSubMesh& aGeom2GaussSubMesh = theGaussMesh->myGeom2GaussSubMesh;
TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
for(; anIter != aGeom2GaussSubMesh.end(); anIter++){
theGaussMesh,
aGaussSubMesh);
- TVTKSource& aSource = aGaussSubMesh->mySource;
+ const TVTKSource& aSource = aGaussSubMesh->GetSource();
anAppendFilter->AddInput(aSource.GetPointer());
}
anAppendFilter->Update(); // Fix on VTK
TVTKSource aSource;
bool *anIsInitialized;
if(aFamily){
- aSource = aFamily->mySource;
+ aSource = aFamily->GetSource();
anIsInitialized = &(aFamily->myIsVTKDone);
}else{
- aSource = aMeshOnEntity->mySource;
+ aSource = aMeshOnEntity->GetSource();
anIsInitialized = &(aMeshOnEntity->myIsVTKDone);
}
const VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
//Main part of code
- TVTKSource& aSource = aGroup->mySource;
+ const TVTKSource& aSource = aGroup->GetSource();
try{
if(!aGroup->myIsVTKDone){
LoadMeshOnGroup(aMesh,aFamilyAndEntitySet);
PFieldImpl aField = boost::get<3>(aFindTimeStamp);
//Main part of code
- TVTKSource& aSource = aValForTime->mySource;
+ const TVTKSource& aSource = aValForTime->GetSource();
#ifndef _DEXCEPT_
try{
#endif
if(!aGaussMesh){
GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile);
- TVTKAppendFilter& anAppendFilter = aProfile->myFilter;
+ const TVTKAppendFilter& anAppendFilter = aProfile->GetFilter();
aSource->ShallowCopy(anAppendFilter->GetOutput());
GetTimeStampOnProfile(aSource,aField,aValForTime);
}else{
const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
- TVTKAppendFilter& anAppendFilter = aGaussMesh->myFilter;
+ const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
aSource->ShallowCopy(anAppendFilter->GetOutput());
GetTimeStampOnGaussMesh(aSource,aField,aValForTime);
}
using MED::EBooleen;
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
-static int MY_FAMILY_DEBUG = 1;
-static int MY_GROUP_DEBUG = 1;
+static int MY_FAMILY_DEBUG = 0;
+static int MY_GROUP_DEBUG = 0;
#else
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
void
BuildMeshOnEntityMap(PMEDMesh theMesh,
- TFamilyCounterMap& theFamilyNbCellsCounterMap,
- TFamilyCounterMap& theFamilyCellsSizeCounterMap,
+ TFamilyCounterMap& theFamilyID2CellsSize,
const MED::TEntityInfo& theEntityInfo,
MED::PNodeInfo theNodeInfo,
MED::PWrapper theMEDWrapper)
for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
TInt aFamId = theNodeInfo->GetFamNum(iElem);
- if(aFamId != 0){
- theFamilyNbCellsCounterMap[aFamId] += 1;
- theFamilyCellsSizeCounterMap[aFamId] += 2;
- }
+ if(aFamId != 0)
+ theFamilyID2CellsSize[aFamId] += 2;
}
INITMSG(MYDEBUG,
TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
aMeshOnEntity->myCellsSize += aNbConn;
TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
- if(aFamId != 0){
- theFamilyNbCellsCounterMap[aFamId] += 1;
- theFamilyCellsSizeCounterMap[aFamId] += aNbConn + 1;
- }
+ if(aFamId != 0)
+ theFamilyID2CellsSize[aFamId] += aNbConn + 1;
}
break;
}
}
aMeshOnEntity->myCellsSize += aCellSize;
TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
- if(aFamId != 0){
- theFamilyNbCellsCounterMap[aFamId] += 1;
- theFamilyCellsSizeCounterMap[aFamId] += aCellSize + 1;
- }
+ if(aFamId != 0)
+ theFamilyID2CellsSize[aFamId] += aCellSize + 1;
}
break;
}
for(TInt iElem = 0; iElem < aNbElem; iElem++){
TInt aFamId = aCellInfo->GetFamNum(iElem);
- if(aFamId != 0){
- theFamilyNbCellsCounterMap[aFamId] += 1;
- theFamilyCellsSizeCounterMap[aFamId] += aVNbNodes + 1;
- }
+ if(aFamId != 0)
+ theFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
}
}} // end switch(...)
}
//---------------------------------------------------------------
void
BuildFamilyMap(PMEDMesh theMesh,
- const TFamilyCounterMap& theFamilyNbCellsCounterMap,
- const TFamilyCounterMap& theFamilyCellsSizeCounterMap,
+ const TFamilyCounterMap& theFamilyID2CellsSize,
const MED::TEntityInfo& theEntityInfo,
- const MED::TElemGroup& theElemGroup,
- const MED::TFamilyGroup& theFamilyGroup,
+ const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
+ const MED::TFamilyInfoSet& theFamilyInfoSet,
MED::PWrapper theMEDWrapper)
{
+ INITMSG(MYDEBUG,"BuildFamilyMap\n");
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;
+ MED::TEntity2FamilySet aEntity2FamilySet = MED::GetEntity2FamilySet(theMEDWrapper,theEntity2TGeom2ElemInfo,theFamilyInfoSet);
+ MED::TEntity2FamilySet::const_iterator aEntity2FamilySetIter = aEntity2FamilySet.begin();
+ for(; aEntity2FamilySetIter != aEntity2FamilySet.end(); aEntity2FamilySetIter++){
+ const MED::EEntiteMaillage& aMEntity = aEntity2FamilySetIter->first;
+ const MED::TFamilyTSizeSet& aFamilyTSizeSet = aEntity2FamilySetIter->second;
TEntity aVEntity = MEDEntityToVTK(aMEntity);
PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- if(aFamilyGroup.empty())
+ if(aFamilyTSizeSet.empty())
continue;
INITMSG(MY_FAMILY_DEBUG,
"; aVEntity = "<<aVEntity<<
endl);
- MED::TFamilyGroup::const_iterator aFamilyGroupIter = aFamilyGroup.begin();
- for(; aFamilyGroupIter != aFamilyGroup.end(); aFamilyGroupIter++){
- const MED::PFamilyInfo& aFamilyInfo = *aFamilyGroupIter;
- if (aFamilyInfo->GetId() == 0)
+ MED::TFamilyTSizeSet::const_iterator aFamilyTSizeSetIter = aFamilyTSizeSet.begin();
+ for(; aFamilyTSizeSetIter != aFamilyTSizeSet.end(); aFamilyTSizeSetIter++){
+ const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
+ const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
+ TInt aSize = boost::get<1>(aFamilyTSize);
+ if(aFamilyInfo->GetId() == 0)
continue;
TInt anId = aFamilyInfo->GetId();
std::string aFamilyName = aFamilyInfo->GetName();
- PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
+ PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
aFamily->myId = anId;
- aFamily->myName = aFamilyInfo->GetName();
aFamily->myEntity = aVEntity;
- {
- aFamily->myNbCells = 0;
- TFamilyCounterMap::const_iterator anIter = theFamilyNbCellsCounterMap.find(anId);
- if(anIter != theFamilyNbCellsCounterMap.end())
- aFamily->myNbCells = anIter->second;
- }
- {
- aFamily->myCellsSize = 0;
- TFamilyCounterMap::const_iterator anIter = theFamilyCellsSizeCounterMap.find(anId);
- if(anIter != theFamilyCellsSizeCounterMap.end())
- aFamily->myCellsSize = anIter->second;
- }
+ aFamily->myNbCells = aSize;
+
+ aFamily->myCellsSize = 0;
+ TFamilyCounterMap::const_iterator anIter = theFamilyID2CellsSize.find(anId);
+ if(anIter != theFamilyID2CellsSize.end())
+ aFamily->myCellsSize = anIter->second;
INITMSG(MY_FAMILY_DEBUG,
- "- aFamilyName = '"<<aFamily->myName<<"'"<<
+ "- aFamilyName = '"<<aFamilyName<<"'"<<
"; myId = "<<aFamily->myId<<"; "<<
"; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
"; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
- "; myEntity = "<<aFamily->myEntity<<
+ "; aVEntity = "<<aVEntity<<
"; myNbCells = "<<aFamily->myNbCells<<
"; myCellsSize = "<<aFamily->myCellsSize<<
endl);
-
- VISU::TBindGroups& aBindGroups = aFamily->myGroups;
+#ifdef _DEBUG_
const TInt aNbGroup = aFamilyInfo->GetNbGroup();
for(TInt i = 0; i < aNbGroup; i++){
std::string aGroupName = aFamilyInfo->GetGroupName(i);
- aBindGroups.insert(aGroupName);
INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
}
+#endif
+
+ }
+ }
+ }
+
+
+ //---------------------------------------------------------------
+ void
+ BuildGroupMap(PMEDMesh theMesh,
+ const MED::TFamilyInfoSet& theFamilyInfoSet)
+ {
+ INITMSG(MY_GROUP_DEBUG,"BuildGroupMap:\n");
+ TGroupMap& aGroupMap = theMesh->myGroupMap;
+ MED::TGroupInfo aGroupInfo = MED::GetGroupInfo(theFamilyInfoSet);
+ MED::TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
+ for(; aGroupInfoIter != aGroupInfo.end(); aGroupInfoIter++){
+ const std::string& aGroupName = aGroupInfoIter->first;
+ INITMSG(MY_GROUP_DEBUG,"aGroupName = '"<<aGroupName<<"'\n");
+
+ PMEDGroup aGroup(new TMEDGroup());
+
+ const MED::TFamilyInfoSet& aFamilyInfoSet = aGroupInfoIter->second;
+ MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin();
+ for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){
+ const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
+ const std::string& aFamilyName = aFamilyInfo->GetName();
+
+ TEntity aVEntity = TEntity(-1);
+ PMEDFamily aFamily;
+
+ // Find aVisuEntity
+ const TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
+ const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const std::string& aName = aFamilyMapIter->first;
+ aFamily = aFamilyMapIter->second;
+ if(aName == aFamilyName){
+ aVEntity = aFamily->myEntity;
+ goto exit_lable;
+ }
+ }
+ }
+ exit_lable:
+ if(aFamily && aVEntity >= 0){
+ aGroup->myFamilyAndEntitySet.insert(TFamilyAndEntity(aFamilyName,aVEntity));
+ INITMSG(MY_GROUP_DEBUG,
+ "- aFamilyName = '"<<aFamilyName<<"'"<<
+ "; aVEntity = "<<aVEntity<<
+ "\n");
+
+ aGroup->myNbCells += aFamily->myNbCells;
+ aGroup->myCellsSize += aFamily->myCellsSize;
+ }
+ }
+ if(!aGroup->myFamilyAndEntitySet.empty() && aGroup->myNbCells > 0){
+ BEGMSG(MY_GROUP_DEBUG,
+ "- myNbCells = "<<aGroup->myNbCells<<
+ "; myCellsSize = "<<aGroup->myCellsSize<<
+ "\n");
+ aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
}
}
}
+
}
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
- MED::TElemGroup anElemGroup = MED::GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
+ MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
+ MED::GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,aEntityInfo);
// creating TMesh structure and TMeshOnEntityMap
TInt aDim = aMeshInfo->GetDim();
"; aDim = "<<aDim<<"\n");
BEGMSG(MYDEBUG,"aEntityInfo.size() = "<<aEntityInfo.size()<<"\n");
- TFamilyCounterMap aFamilyNbCellsCounterMap, aFamilyCellsSizeCounterMap;
+ TFamilyCounterMap aFamilyID2CellsSize;
BuildMeshOnEntityMap(aMesh,
- aFamilyNbCellsCounterMap,
- aFamilyCellsSizeCounterMap,
+ aFamilyID2CellsSize,
aEntityInfo,
aNodeInfo,
aMed);
aKey2Gauss,
aMed);
-#ifndef _LOAD_FAMILIES_
- continue;
-#endif
-
- MED::TFamilyGroup aFamilyGroup = MED::GetFamilies(aMed,aMeshInfo);
+#ifdef _LOAD_FAMILIES_
+ MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(aMed,aMeshInfo);
BuildFamilyMap(aMesh,
- aFamilyNbCellsCounterMap,
- aFamilyCellsSizeCounterMap,
+ aFamilyID2CellsSize,
aEntityInfo,
- anElemGroup,
- aFamilyGroup,
+ anEntity2TGeom2ElemInfo,
+ aFamilyInfoSet,
aMed);
+
+ BuildGroupMap(aMesh,
+ aFamilyInfoSet);
+#endif
- BEGMSG(MY_GROUP_DEBUG,"TGroup:\n");
- TGroupMap& aGroupMap = aMesh->myGroupMap;
- MED::TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);
- MED::TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
- for(; aGroupInfoIter != aGroupInfo.end(); aGroupInfoIter++){
- const std::string& aGroupName = aGroupInfoIter->first;
- const MED::TFamilyGroup& aFamilyGroup = aGroupInfoIter->second;
- PMEDGroup aGroup(new TMEDGroup());
- aGroup->myName = aGroupName;
- aGroup->myMeshName = aMesh->myName;
-
- INITMSG(MY_GROUP_DEBUG,"aGroup->myName = '"<<aGroup->myName<<"'\n");
-
- MED::TFamilyGroup::const_iterator aFamilyIter = aFamilyGroup.begin();
- for(; aFamilyIter != aFamilyGroup.end(); aFamilyIter++){
- const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
- const std::string& aFamilyName = aFamilyInfo->GetName();
-
- TEntity aVEntity = TEntity(-1);
- PMEDFamily aFamily;
-
- // Find aVisuEntity
- const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
- const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const std::string& aName = aFamilyMapIter->first;
- aFamily = aFamilyMapIter->second;
- if(aName == aFamilyName){
- aVEntity = aFamily->myEntity;
- goto exit_lable;
- }
- }
- }
- exit_lable:
- if(aFamily && aVEntity >= 0){
- aGroup->myFamilyAndEntitySet.insert(TFamilyAndEntity(aFamilyName,aVEntity));
- INITMSG(MY_GROUP_DEBUG,
- "aFamilyName = '"<<aFamilyName<<"'"<<
- "; '"<<aFamily->myName<<"'"<<
- "; aVEntity = "<<aVEntity<<
- "\n");
-
- aGroup->myNbCells += aFamily->myNbCells;
- aGroup->myCellsSize += aFamily->myCellsSize;
- }
- }
- if(!aGroup->myFamilyAndEntitySet.empty() && aGroup->myNbCells > 0){
- BEGMSG(MY_GROUP_DEBUG,
- "myNbCells = "<<aGroup->myNbCells<<
- "; myCellsSize = "<<aGroup->myCellsSize<<
- "\n");
- aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
- }
- }
#ifndef _DEXCEPT_
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());