CreateConvertor(const string& theFileName)
{
if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
- return new VISU_MedConvertor(theFileName);
+ return new VISU_MedConvertor(theFileName, aMed);
return NULL;
}
VISU_MedConvertor
-::VISU_MedConvertor(const string& theFileName):
+::VISU_MedConvertor(const string& theFileName, MED::PWrapper theMed):
myIsEntitiesDone(false),
myIsFieldsDone(false),
myIsGroupsDone(false),
- myIsMinMaxDone(false)
+ myIsMinMaxDone(false),
+ myMed(theMed)
{
myFileInfo.setFile(QString(theFileName.c_str()));
myName = myFileInfo.baseName().latin1();
TSetIsDone aSetIsDone(myIsEntitiesDone);
TTimerLog aTimerLog(MYDEBUG,"BuildEntities");
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
- TInt aNbMeshes = aMed->GetNbMeshes();
+ TInt aNbMeshes = myMed->GetNbMeshes();
TMeshMap& aMeshMap = myMeshMap;
INITMSG(MYDEBUG,"BuildEntities aNbMeshes = "<<aNbMeshes<<"\n");
#endif
TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
- MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
+ MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
std::string aMeshName = aMeshInfo->GetName();
TInt aDim = aMeshInfo->GetDim();
MED::EMaillage aType = aMeshInfo->GetType();
if(aType == MED::eNON_STRUCTURE){
- if(MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo)){
- MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+ if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
aMesh->myNbPoints = aNodeInfo->GetNbElem();
aMesh->myEntityInfo = anEntityInfo;
BuildMeshOnEntityMap(aMesh,
anEntityInfo,
aNodeInfo,
- aMed);
+ myMed);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
}
} // NON STRUCTURED MESH
else {
- MED::PGrilleInfo aGrilleInfo = aMed->GetPGrilleInfo(aMeshInfo);
+ MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo);
MED::TEntityInfo anEntityInfo;
anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
BuildMeshGrilleOnEntityMap(aMesh,
anEntityInfo,
aGrilleInfo,
- aMed);
+ myMed);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
TSetIsDone aSetIsDone(myIsFieldsDone);
TTimerLog aTimerLog(MYDEBUG,"BuildFields");
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
- TInt aNbMeshes = aMed->GetNbMeshes();
+ TInt aNbMeshes = myMed->GetNbMeshes();
TMeshMap& aMeshMap = myMeshMap;
INITMSG(MYDEBUG,"BuildFields - aNbMeshes = "<<aNbMeshes<<"\n");
#endif
TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
- MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
+ MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
std::string aMeshName = aMeshInfo->GetName();
TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
#ifndef _DEXCEPT_
try{
#endif
- MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
BuildFieldMap(aMesh,
anEntityInfo,
- aMed);
+ myMed);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
TSetIsDone aSetIsDone(myIsMinMaxDone);
TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
- MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(aMed);
- MED::TMKey2Profile aMKey2Profile = MED::GetMKey2Profile(aMed);
+ MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(myMed);
+ MED::TMKey2Profile aMKey2Profile = MED::GetMKey2Profile(myMed);
- TInt aNbMeshes = aMed->GetNbMeshes();
+ TInt aNbMeshes = myMed->GetNbMeshes();
TMeshMap& aMeshMap = myMeshMap;
INITMSG(MYDEBUG,"BuildMinMax - aNbMeshes = "<<aNbMeshes<<"\n");
#endif
TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPMeshInfo");
- MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
+ MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
std::string aMeshName = aMeshInfo->GetName();
TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
#ifndef _DEXCEPT_
try{
#endif
- TInt aNbFields = aMed->GetNbFields();
+ TInt aNbFields = myMed->GetNbFields();
INITMSG(MYDEBUG,
"- aMeshName = '"<<aMeshName<<"'"<<
"; aNbFields = "<<aNbFields<<"\n");
- MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
for(TInt iField = 1; iField <= aNbFields; iField++){
TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
- MED::PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
+ MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo,iField);
std::string aFieldName = aFieldInfo->GetName();
INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
MED::TGeom2Size aGeom2Size;
MED::EEntiteMaillage aMEntity;
- TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,
+ TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
anEntityInfo,
aMEntity,
aGeom2Size);
try{
#endif
#endif
- MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
+ MED::PTimeStampInfo aTimeStampInfo = myMed->GetPTimeStampInfo(aFieldInfo,
aMEntity,
aGeom2Size,
iTimeStamp);
- MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
+ MED::PTimeStampVal aTimeStampVal = myMed->GetPTimeStampVal(aTimeStampInfo,
aMKey2Profile,
aKey2Gauss);
TSetIsDone aSetIsDone(myIsGroupsDone);
TTimerLog aTimerLog(MYDEBUG,"BuildGroups");
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
- TInt aNbMeshes = aMed->GetNbMeshes();
+ TInt aNbMeshes = myMed->GetNbMeshes();
TMeshMap& aMeshMap = myMeshMap;
INITMSG(MYDEBUG,"BuildGroups - aNbMeshes = "<<aNbMeshes<<"\n");
#endif
TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
- MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
+ MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
std::string aMeshName = aMeshInfo->GetName();
TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
MED::EMaillage aType = aMeshInfo->GetType();
- MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
- MED::GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,anEntityInfo);
+ MED::GetEntity2TGeom2ElemInfo(myMed,aMeshInfo,anEntityInfo);
#ifndef _DEXCEPT_
try{
#endif
- MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(aMed,aMeshInfo);
+ MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed,aMeshInfo);
if(aType == MED::eNON_STRUCTURE)
BuildFamilyMap(aMesh,
anEntityInfo,
anEntity2TGeom2ElemInfo,
aFamilyInfoSet,
- aMed);
+ myMed);
else
BuildGrilleFamilyMap(aMesh,
anEntityInfo,
aFamilyInfoSet,
- aMed);
+ myMed);
BuildGroupMap(aMesh,
aFamilyInfoSet);
TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
const TEntity& anEntity = theMeshOnEntity->myEntity;
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
if(anEntity == NODE_ENTITY){
- isPointsUpdated += LoadPoints(aMed,theMesh);
+ isPointsUpdated += LoadPoints(myMed,theMesh);
}else{
- isPointsUpdated += LoadPoints(aMed,theMesh);
- isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
+ isPointsUpdated += LoadPoints(myMed,theMesh);
+ isCellsOnEntityUpdated += LoadCellsOnEntity(myMed,theMesh,theMeshOnEntity);
}
return (isPointsUpdated || isCellsOnEntityUpdated);
TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
const TEntity& anEntity = theMeshOnEntity->myEntity;
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
if(anEntity == NODE_ENTITY){
- isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,theFamily);
+ isPointsUpdated += LoadPointsOnFamily(myMed,theMesh,theFamily);
}else{
- isPointsUpdated += LoadPoints(aMed,theMesh);
- isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,theMeshOnEntity,theFamily);
+ isPointsUpdated += LoadPoints(myMed,theMesh);
+ isCellsOnEntityUpdated += LoadCellsOnFamily(myMed,theMesh,theMeshOnEntity,theFamily);
}
return (isPointsUpdated || isCellsOnEntityUpdated);
TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
PMEDFamily aFamily = *aFamilyIter;
const TEntity& anEntity = aFamily->myEntity;
const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
- isPointsUpdated += LoadPoints(aMed,theMesh);
+ isPointsUpdated += LoadPoints(myMed,theMesh);
if(anEntity == NODE_ENTITY){
- isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily);
+ isPointsUpdated += LoadPointsOnFamily(myMed,theMesh,aFamily);
}else{
- isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,aMeshOnEntity,aFamily);
+ isCellsOnEntityUpdated += LoadCellsOnFamily(myMed,theMesh,aMeshOnEntity,aFamily);
}
}
TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
-
const TEntity& anEntity = theMeshOnEntity->myEntity;
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
- isPointsUpdated += LoadPoints(aMed,theMesh);
+ isPointsUpdated += LoadPoints(myMed,theMesh);
if(anEntity != NODE_ENTITY)
- isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
- int isFieldUpdated = LoadValForTimeOnMesh(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
+ isCellsOnEntityUpdated += LoadCellsOnEntity(myMed,theMesh,theMeshOnEntity);
+ int isFieldUpdated = LoadValForTimeOnMesh(myMed,theMesh,theMeshOnEntity,theField,theValForTime);
return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
}
TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
- MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
-
const TEntity& anEntity = theMeshOnEntity->myEntity;
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
if(anEntity != NODE_ENTITY)
- isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
- int isFieldUpdated = LoadValForTimeOnGaussPts(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
+ isCellsOnEntityUpdated += LoadCellsOnEntity(myMed,theMesh,theMeshOnEntity);
+ int isFieldUpdated = LoadValForTimeOnGaussPts(myMed,theMesh,theMeshOnEntity,theField,theValForTime);
return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
}