X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverMED%2FDriverMED_R_SMESHDS_Mesh.cxx;h=1a00746042374f9401e848c6196d5c0c1f2c0e43;hb=4401d3e8dbd023980ca2bd56a1dcb1e12dbd194a;hp=25e517cf44d0da1b53a5d92e550b3ec1bb8805ae;hpb=090aff07266d376ae028ae43434bdea7c0a0f9bb;p=modules%2Fsmesh.git diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 25e517cf4..1a0074604 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -38,6 +38,12 @@ #include +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + #define _EDF_NODE_IDS_ using namespace MED; @@ -136,7 +142,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() Status aResult = DRS_FAIL; try{ myFamilies.clear(); - MESSAGE("Perform - myFile : "<GetName()); + if(MYDEBUG) MESSAGE("Perform - aMeshName : "<GetName()); if(aMeshName != aMeshInfo->GetName()) continue; aResult = DRS_OK; //TInt aMeshDim = aMeshInfo->GetDim(); // Reading MED families to the temporary structure //------------------------------------------------ - TInt aNbFams = aMed->GetNbFamilies(aMeshInfo); - MESSAGE("Read " << aNbFams << " families"); + TErr anErr; + TInt aNbFams = aMed->GetNbFamilies(aMeshInfo); + if(MYDEBUG) MESSAGE("Read " << aNbFams << " families"); for (TInt iFam = 0; iFam < aNbFams; iFam++) { - PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo, iFam+1); - TInt aFamId = aFamilyInfo->GetId(); - MESSAGE("Family " << aFamId << " :"); - + PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr); + if(anErr >= 0){ + TInt aFamId = aFamilyInfo->GetId(); + if(MYDEBUG) MESSAGE("Family " << aFamId << " :"); + DriverMED_FamilyPtr aFamily (new DriverMED_Family); - + TInt aNbGrp = aFamilyInfo->GetNbGroup(); - MESSAGE("belong to " << aNbGrp << " groups"); + if(MYDEBUG) MESSAGE("belong to " << aNbGrp << " groups"); for (TInt iGr = 0; iGr < aNbGrp; iGr++) { string aGroupName = aFamilyInfo->GetGroupName(iGr); - MESSAGE(aGroupName); + if(MYDEBUG) MESSAGE(aGroupName); aFamily->AddGroupName(aGroupName); } myFamilies[aFamId] = aFamily; + } } // Reading MED nodes to the corresponding SMDS structure @@ -221,7 +230,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() EBooleen anIsNodeNum = aNodeInfo->IsElemNum(); TInt aNbElems = aNodeInfo->GetNbElem(); - MESSAGE("Perform - aNodeInfo->GetNbElem() = "<GetNbElem() = "<GetFamNum(iElem); try{ + //MESSAGE("Try to create element # " << iElem << " with id = " + // << aCellInfo->GetElemNum(iElem)); switch(aGeom){ case eSEG2: case eSEG3: @@ -487,7 +680,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() INFOS("Unknown exception was cought !!!"); aResult = DRS_FAIL; } - MESSAGE("Perform - aResult status = "< DriverMED_R_SMESHDS_Mesh::GetGroupNames() void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup) { string aGroupName (theGroup->GetStoreName()); - MESSAGE("Get Group " << aGroupName); + if(MYDEBUG) MESSAGE("Get Group " << aGroupName); map::iterator aFamsIter = myFamilies.begin(); for (; aFamsIter != myFamilies.end(); aFamsIter++) @@ -563,7 +756,7 @@ void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup) for (; anElemsIter != anElements.end(); anElemsIter++) { element = *anElemsIter; - theGroup->SMDSGroup().Add(element); + theGroup->SMDSGroup().Add(element); } if ( element ) theGroup->SetType( element->GetType() );