From 75ea74494770e8b85ecf2a5d5efbb131b6d487d0 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 1 Aug 2005 06:19:10 +0000 Subject: [PATCH] To do that TVTKIsDone data structure can be used as on VISU_Converter_impl level as its descendants --- src/CONVERTOR/VISUConvertor.cxx | 2 +- src/CONVERTOR/VISU_Convertor_impl.cxx | 8 +++++-- src/CONVERTOR/VISU_Convertor_impl.hxx | 1 + src/CONVERTOR/VISU_MedConvertor.cxx | 34 ++++++++++++++++----------- src/CONVERTOR/VISU_MedConvertor.hxx | 20 ++++------------ src/VISU_I/VISU_CorbaMedConvertor.cxx | 17 ++++++++------ src/VISU_I/VISU_CorbaMedConvertor.hxx | 18 ++++---------- 7 files changed, 47 insertions(+), 53 deletions(-) diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index c784c4b1..daf53e94 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -43,7 +43,7 @@ static int MYDEBUG = 1; static int MYDEBUG = 0; #endif -//#define _DEXCEPT_ +#define _DEXCEPT_ void parseFile(const char* theFileName) { #ifndef _DEXCEPT_ diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 15662ff8..2601aa61 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -70,7 +70,8 @@ namespace VISU { //--------------------------------------------------------------- TIsVTKDone::TIsVTKDone(): - myIsVTKDone(false) + myIsVTKDone(false), + myIsDone(false) {} @@ -1082,10 +1083,13 @@ namespace PGaussImpl aGauss = theGaussSubMesh->myGauss; INITMSG(MYDEBUG,"GetGaussSubMesh - aGeom = "<myGeom<myIsDone) + return; + if(theGaussSubMesh->myIsVTKDone) return; - TVTKSource& aSource = theGaussSubMesh->mySource; + TVTKSource& aSource = theGaussSubMesh->mySource; GetSource(aSource,theGaussSubMesh,theMeshOnEntity); INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<GetNumberOfPoints()<GetNumberOfCells()<myIsMEDDone) + if(theMesh->myIsDone) if(!aFamily) return 0; - else if(!aFamily->myIsMEDDone) + else if(!aFamily->myIsDone) return 0; - INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsMEDDone = "<myIsMEDDone<< + INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<myIsDone<< "; theFamilyName = '"<GetPNodeInfo(theMesh->myMeshInfo); TInt aNbElem = aNodeInfo->GetNbElem(); - if(!theMesh->myIsMEDDone){ + if(!theMesh->myIsDone){ TInt aDim = theMesh->myDim; TNamedPointCoords& aCoords = theMesh->myNamedPointCoords; @@ -854,18 +854,18 @@ VISU_MedConvertor for (int iElem = 0; iElem < aNbElem; iElem++) aConnForCellType[iElem] = VISU::TConnect(1,iElem); - theMesh->myIsMEDDone = true; + theMesh->myIsDone = true; } if(aFamily){ - if(!aFamily->myIsMEDDone){ + if(!aFamily->myIsDone){ if(aNbElem > 0){ TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[VTK_VERTEX]; for (int iElem = 0; iElem < aNbElem; iElem++) if(aNodeInfo->GetFamNum(iElem) == aFamily->myId) aSubMeshID.push_back(iElem); } - aFamily->myIsMEDDone = true; + aFamily->myIsDone = true; } } @@ -1090,7 +1090,7 @@ LoadProfile(MED::TTimeStampVal& theTimeStampVal, INITMSG(MYDEBUG,"LoadProfile"<myIsMEDDone) + if(aProfile->myIsDone) return; const TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile; @@ -1121,7 +1121,7 @@ LoadProfile(MED::TTimeStampVal& theTimeStampVal, } } - aProfile->myIsMEDDone = true; + aProfile->myIsDone = true; } @@ -1136,7 +1136,7 @@ LoadGaussMesh(const MED::PWrapper& theMed, INITMSG(MYDEBUG,"LoadGaussMesh"<myIsMEDDone) + if(aGaussMesh->myIsDone) return; const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo; @@ -1158,6 +1158,9 @@ LoadGaussMesh(const MED::PWrapper& theMed, if(anIter2 != aGeom2GaussSubMesh.end()){ PMEDGaussSubMesh aGaussSubMesh = anIter2->second; + if(aGaussSubMesh->myIsDone) + continue; + PMEDGauss aGauss = aGaussSubMesh->myGauss; MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo; @@ -1200,7 +1203,9 @@ LoadGaussMesh(const MED::PWrapper& theMed, aSlice[aDimId] = aCoordSlice[aDimId]; } } - + + aGaussSubMesh->myIsDone = true;; + INITMSG(MYDEBUG, "- aVGeom = "<myIsMEDDone) + if(theValForTime->myIsDone) return 0; //Main part of code @@ -1325,7 +1331,7 @@ VISU_MedConvertor } } - theValForTime->myIsMEDDone = true; + theValForTime->myIsDone = true; return 1; } diff --git a/src/CONVERTOR/VISU_MedConvertor.hxx b/src/CONVERTOR/VISU_MedConvertor.hxx index ffa3c24c..87cf1c85 100644 --- a/src/CONVERTOR/VISU_MedConvertor.hxx +++ b/src/CONVERTOR/VISU_MedConvertor.hxx @@ -18,17 +18,7 @@ namespace VISU { //--------------------------------------------------------------- - struct TIsMEDDone: virtual TBaseStructure - { - bool myIsMEDDone; - TIsMEDDone(): - myIsMEDDone(false) - {} - }; - - - //--------------------------------------------------------------- - struct TMEDMesh: virtual TMeshImpl, virtual TIsMEDDone + struct TMEDMesh: virtual TMeshImpl { MED::PMeshInfo myMeshInfo; MED::TEntityInfo myEntityInfo; @@ -45,7 +35,7 @@ namespace VISU //--------------------------------------------------------------- - struct TMEDProfile: virtual TProfileImpl, virtual TIsMEDDone + struct TMEDProfile: virtual TProfileImpl {}; typedef SharedPtr PMEDProfile; @@ -65,7 +55,7 @@ namespace VISU //--------------------------------------------------------------- - struct TMEDGaussMesh: virtual TGaussMeshImpl, virtual TIsMEDDone + struct TMEDGaussMesh: virtual TGaussMeshImpl {}; typedef SharedPtr PMEDGaussMesh; @@ -79,7 +69,7 @@ namespace VISU //--------------------------------------------------------------- - struct TMEDFamily: virtual TFamilyImpl, virtual TIsMEDDone + struct TMEDFamily: virtual TFamilyImpl {}; typedef SharedPtr PMEDFamily; @@ -97,7 +87,7 @@ namespace VISU //--------------------------------------------------------------- - struct TMEDValForTime: virtual TValForTimeImpl, virtual TIsMEDDone + struct TMEDValForTime: virtual TValForTimeImpl {}; typedef SharedPtr PMEDValForTime; diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index f25b41ee..38c471b2 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -942,10 +942,10 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh, PCFamily aFamily = GetFamily(aMeshOnEntity,theFamilyName); //Check on loading already done - if(theMesh->myIsCDone) + if(theMesh->myIsDone) if(!aFamily) return 0; - else if(!aFamily->myIsCDone) + else if(!aFamily->myIsDone) return 0; if(MYDEBUG) @@ -962,7 +962,7 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh, throw std::runtime_error("LoadPoints >> There is no points in the mesh !!!"); SALOME_MED::double_array_var aCCoord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE); - if(!theMesh->myIsCDone){ + if(!theMesh->myIsDone){ for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){ VISU::TCoordSlice aCoordSlice = aCoords.GetCoordSlice(iElem); for(int iDim = 0; iDim < aDim; iDim++) @@ -976,11 +976,11 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh, for(int iElem = 0; iElem < aNbElem; iElem++) aCell2Connect[iElem] = TConnect(1,iElem); - theMesh->myIsCDone = true; + theMesh->myIsDone = true; } if(aFamily){ - if(!aFamily->myIsCDone){ + if(!aFamily->myIsDone){ if(MYDEBUG) MESSAGE("LoadPoints - Filling aFamily Geom2SubMeshID"); SALOME_MED::FAMILY_var aMedFamily = aFamily->myFamily; @@ -1007,7 +1007,7 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh, } } - aFamily->myIsCDone = true; + aFamily->myIsDone = true; } } @@ -1219,7 +1219,7 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh, VISU::PCValForTime theValForTime) { //Check on loading already done - if(theValForTime->myIsCDone) + if(theValForTime->myIsDone) return 0; SALOME_MED::FIELD_var aMEDField = theValForTime->myField; @@ -1235,5 +1235,8 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh, if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDINT = "<length()); ::ImportField(anArray,theMesh,theField,theValForTime,theMeshOnEntity); } + + theValForTime->myIsDone = true; + return 1; } diff --git a/src/VISU_I/VISU_CorbaMedConvertor.hxx b/src/VISU_I/VISU_CorbaMedConvertor.hxx index 7f119bed..376eff77 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.hxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.hxx @@ -38,17 +38,7 @@ namespace VISU { //--------------------------------------------------------------- - struct TIsCDone: virtual TBaseStructure - { - bool myIsCDone; - TIsCDone(): - myIsCDone(false) - {} - }; - - - //--------------------------------------------------------------- - struct TCMesh: virtual TMeshImpl, virtual TIsCDone + struct TCMesh: virtual TMeshImpl { SALOME_MED::MESH_var myMesh; }; @@ -56,7 +46,7 @@ namespace VISU //--------------------------------------------------------------- - struct TCMeshOnEntity: virtual TMeshOnEntityImpl, virtual TIsCDone + struct TCMeshOnEntity: virtual TMeshOnEntityImpl { SALOME_MED::SUPPORT_var mySupport; typedef std::pair TIndexAndSize; @@ -67,7 +57,7 @@ namespace VISU //--------------------------------------------------------------- - struct TCFamily: virtual TFamilyImpl, virtual TIsCDone + struct TCFamily: virtual TFamilyImpl { SALOME_MED::FAMILY_var myFamily; }; @@ -89,7 +79,7 @@ namespace VISU //--------------------------------------------------------------- - struct TCValForTime: virtual TValForTimeImpl, virtual TIsCDone + struct TCValForTime: virtual TValForTimeImpl { SALOME_MED::FIELD_var myField; }; -- 2.39.2