]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix bugs with new MED (V3) PortingMED3 mergeto_V6_main_07Apr11
authorgdd <gdd>
Thu, 31 Mar 2011 14:05:43 +0000 (14:05 +0000)
committergdd <gdd>
Thu, 31 Mar 2011 14:05:43 +0000 (14:05 +0000)
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_Vtk2MedConvertor.cxx
src/VISU_I/VISU_ResultUtils.cc
src/VISU_I/VISU_Result_i.cc

index 764e4376e18e8644d34c196a0bc9d1551f430a4d..8ee84ca66cb9c60100d6e4957264e4f4594d18f9 100644 (file)
@@ -1115,7 +1115,7 @@ namespace VISU
   {
     TMEDCoordHolder* aCoordHolder = new TMEDCoordHolder();
     TInt aNbElem = theNodeInfo->GetNbElem();
-    TInt aDim = theNodeInfo->GetMeshInfo()->GetDim();
+    TInt aDim = theNodeInfo->GetMeshInfo()->GetSpaceDim();
     aCoordHolder->Init(aNbElem, aDim, theNodeInfo->myCoord);
     TNamedPointCoords::Init(PCoordHolder(aCoordHolder));
     myVersion = theVersion;
@@ -1138,7 +1138,7 @@ namespace VISU
   {
     TMEDCoordHolder* aCoordHolder = new TMEDCoordHolder();
     TInt aNbElem = theGrilleInfo->GetNbNodes();
-    TInt aDim = theGrilleInfo->GetMeshInfo()->GetDim();
+    TInt aDim = theGrilleInfo->GetMeshInfo()->GetSpaceDim();
     MED::PNodeCoord aCoord(new MED::TNodeCoord(aNbElem * aDim));
     aCoordHolder->Init(aNbElem, aDim, aCoord);
     TNamedPointCoords::Init(PCoordHolder(aCoordHolder));
@@ -1902,7 +1902,8 @@ VISU_MedConvertor
 
         MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
 
-        for(TInt iField = 1; iField <= aNbFields; iField++){
+        for(TInt iField = 1; iField <= aNbFields; iField++)
+        {
           VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
 
           MED::TErr anError = 0;
@@ -1912,7 +1913,7 @@ VISU_MedConvertor
 
           std::string aFieldName = aFieldInfo->GetName();
           INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
-          
+
           MED::TGeom2Size aGeom2Size;
           MED::EEntiteMaillage aMEntity;
           TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
@@ -1972,6 +1973,7 @@ VISU_MedConvertor
                                                                 aMetric2Comp2Group2AverageMinMax,
                                                                 aNbComp,
                                                                 aNbComp2);
+
               else
                 BuildTimeStampMinMax<MED::TIntTimeStampValue>(CastToIntTimeStampValue(aTimeStampValue),
                                                               aMeshOnEntity,
@@ -2043,7 +2045,7 @@ VISU_MedConvertor
       VISU::TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
 
       MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
-      std::string aMeshName = aMeshInfo->GetName();      
+      std::string aMeshName = aMeshInfo->GetName();
 
       VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
       if(anIter == aMeshMap.end())
index e0ffb4f6ab00eab6afa9856a040d31cc16b88fed..d1f64940d7a6e830b1f6db3d9fab68ae903e4c0a 100644 (file)
@@ -231,7 +231,7 @@ VISU_Vtk2MedConvertor
 
 /*!
   \brief Adds field names, which used as specific fields with ids or elements 
-  (or something else). (Default: \93VISU_CELLS_MAPPER\94,\94VISU_POINTS_MAPPER\94,\94VISU_FILED\94)
+  (or something else). (Default: "VISU_CELLS_MAPPER","VISU_POINTS_MAPPER","VISU_FILED")
   \param theFieldName field name
   \sa eraseFromIgnoringFieldList()
 */
@@ -337,7 +337,7 @@ VISU_Vtk2MedConvertor
 }
 
 /*!
-  \brief Sets output mesh name. (\93vtk2med\94 - default)
+  \brief Sets output mesh name. ("vtk2med" - default)
   \param theMeshName mesh name
   \sa getMeshName()
 */
@@ -349,7 +349,7 @@ VISU_Vtk2MedConvertor
 }
 
 /*!
-  \brief Gets output mesh name. (\93vtk2med\94 - default)
+  \brief Gets output mesh name. ("vtk2med" - default)
   \return mesh name
   \sa setMeshName()
 */
index 86457d7c87313ab5a2b1ff349ec5a0b217532f27..fab0b1b89a342138a68d6e05f959a5b72b9e419b 100644 (file)
@@ -360,11 +360,11 @@ namespace VISU
   //----------------------------------------------------------------------------
   void
   BuildGroups(Result_i* theResult,
-             Result_i::PInput theInput,
-             CORBA::Boolean* theIsDone,
-             CORBA::Boolean theIsBuild,
-             CORBA::Boolean theIsAtOnce,
-             _PTR(Study) theStudy)
+              Result_i::PInput theInput,
+              CORBA::Boolean* theIsDone,
+              CORBA::Boolean theIsBuild,
+              CORBA::Boolean theIsAtOnce,
+              _PTR(Study) theStudy)
   {
     if(!theIsBuild || *theIsDone)
       return;
@@ -387,73 +387,70 @@ namespace VISU
       
       const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       if(aMeshOnEntityMap.empty()) 
-       continue;
+        continue;
       
       TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
-       const TEntity& anEntity = aMeshOnEntityMapIter->first;
-       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-       
-       const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
-       TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
-       for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
-         const string& aFamilyName = aFamilyMapIter->first;
-         const PFamily& aFamily = aFamilyMapIter->second;
+        const TEntity& anEntity = aMeshOnEntityMapIter->first;
+        const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+        const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+        TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+        for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+          const string& aFamilyName = aFamilyMapIter->first;
+          const PFamily& aFamily = aFamilyMapIter->second;
           aComment=QString("myComment=FAMILY;myMeshName=%1;myEntityId=%2;myName=%3");
           aComment=aComment.arg(aMeshName.c_str());
           aComment=aComment.arg(anEntity);
           aComment=aComment.arg(aFamilyName.c_str());
-         aFamily->myEntry =
-           CreateAttributes(theStudy,
-                            aMeshOnEntity->myEntry,
-                            NO_ICON,
-                            NO_IOR,
-                            aFamilyName,
-                            NO_PERFSITENT_REF,
-                            aComment.toLatin1().data(),
-                            true);
-       }
+          aFamily->myEntry = CreateAttributes(theStudy,
+                                              aMeshOnEntity->myEntry,
+                                              NO_ICON,
+                                              NO_IOR,
+                                              aFamilyName,
+                                              NO_PERFSITENT_REF,
+                                              aComment.toLatin1().data(),
+                                              true);
+        }
       }
       //Importing groups
       const TGroupMap& aGroupMap = aMesh->myGroupMap;
       if(!aGroupMap.empty()){
-       aComment = QString("myComment=GROUPS;myMeshName=%1").arg(aMeshName.c_str());
-       
-       CreateAttributes(theStudy,
-                        aMesh->myGroupsEntry,
-                        NO_ICON,
-                        NO_IOR,
-                        "Groups",
-                        NO_PERFSITENT_REF,
-                        aComment.toLatin1().data(),
-                        false);
-
-       TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
-       for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
-         const string& aGroupName = aGroupMapIter->first;
-         const PGroup& aGroup = aGroupMapIter->second;
-         aComment = QString("myComment=GROUP;myMeshName=%1;myName=%2").arg(aMeshName.c_str()).arg(aGroupName.c_str());
-         aGroup->myEntry = 
-           CreateAttributes(theStudy,
-                            aMesh->myGroupsEntry,
-                            NO_ICON,
-                            NO_IOR,
-                            aGroupName,
-                            NO_PERFSITENT_REF,
-                            aComment.toLatin1().data(),
-                            true);
-         const TFamilySet& aFamilySet = aGroup->myFamilySet;
-         TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
-         for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
-           const PFamily& aFamily = (*aFamilyIter).second;
-           CreateReference(theStudy,
-                           aGroup->myEntry,
-                           aFamily->myEntry);
-         }
-       }
+        aComment = QString("myComment=GROUPS;myMeshName=%1").arg(aMeshName.c_str());
+        
+        CreateAttributes(theStudy,
+                         aMesh->myGroupsEntry,
+                         NO_ICON,
+                         NO_IOR,
+                         "Groups",
+                         NO_PERFSITENT_REF,
+                         aComment.toLatin1().data(),
+                         false);
+                         
+        TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+        for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+          const string& aGroupName = aGroupMapIter->first;
+          const PGroup& aGroup = aGroupMapIter->second;
+          aComment = QString("myComment=GROUP;myMeshName=%1;myName=%2").arg(aMeshName.c_str()).arg(aGroupName.c_str());
+          aGroup->myEntry = CreateAttributes(theStudy,
+                                             aMesh->myGroupsEntry,
+                                             NO_ICON,
+                                             NO_IOR,
+                                             aGroupName,
+                                             NO_PERFSITENT_REF,
+                                             aComment.toLatin1().data(),
+                                             true);
+          const TFamilySet& aFamilySet = aGroup->myFamilySet;
+          TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
+          for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
+            const PFamily& aFamily = (*aFamilyIter).second;
+            CreateReference(theStudy,
+                            aGroup->myEntry,
+                            aFamily->myEntry);
+          }
+        }
       }else if(!theIsAtOnce)
-       RemoveSObject(theStudy,
-                     aMesh->myGroupsEntry);
+        RemoveSObject(theStudy,
+                      aMesh->myGroupsEntry);
     }
     
     ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
@@ -492,7 +489,7 @@ namespace VISU
 
       const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       if(aMeshOnEntityMap.empty()) 
-       continue;
+        continue;
 
       //Import fields
       bool anIsFieldsEntryUpdated = false;
@@ -500,84 +497,83 @@ namespace VISU
 
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
       {
-       const TEntity& anEntity = aMeshOnEntityMapIter->first;
-       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-       const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
-       TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-
-       for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
-       {
-         if(!anIsFieldsEntryUpdated)
-         {
-           aComment = "";
-           aComment.append("myComment=FIELDS;");
-           aComment.append("myMeshName=");aComment.append(aMeshName.c_str());
-
-           CreateAttributes(theStudy,
-                            aMesh->myFieldsEntry,
-                            NO_ICON,
-                            NO_IOR,
-                            "Fields",
-                            NO_PERFSITENT_REF,
-                            aComment.toLatin1().data(),
-                            false);
-
-           anIsFieldsEntryUpdated = true;
-         }
-
-         const string& aFieldName = aFieldMapIter->first;
-         const PField& aField = aFieldMapIter->second;
-         const TValField& aValField = aField->myValField;
-         QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
-         aComment = QString("myComment=FIELD;myMeshName=%1;myEntityId=%2;myName=%3;myNbTimeStamps=%4;myNumComponent=%5");
+        const TEntity& anEntity = aMeshOnEntityMapIter->first;
+        const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+        const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+        TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+        
+        for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
+        {
+          if(!anIsFieldsEntryUpdated)
+          {
+            aComment = "";
+            aComment.append("myComment=FIELDS;");
+            aComment.append("myMeshName=");aComment.append(aMeshName.c_str());
+            
+            CreateAttributes(theStudy,
+                             aMesh->myFieldsEntry,
+                             NO_ICON,
+                             NO_IOR,
+                             "Fields",
+                             NO_PERFSITENT_REF,
+                             aComment.toLatin1().data(),
+                             false);
+            anIsFieldsEntryUpdated = true;
+          }
+        
+          const string& aFieldName = aFieldMapIter->first;
+          const PField& aField = aFieldMapIter->second;
+          const TValField& aValField = aField->myValField;
+          QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
+          aComment = QString("myComment=FIELD;myMeshName=%1;myEntityId=%2;myName=%3;myNbTimeStamps=%4;myNumComponent=%5");
           aComment = aComment.arg(aMeshName.c_str());
           aComment = aComment.arg(anEntity);
           aComment = aComment.arg(aFieldName.c_str());
           aComment = aComment.arg(aValField.size());
           aComment = aComment.arg(aField->myNbComp);
-         
-         aField->myEntry = CreateAttributes(theStudy,
-                                            aMesh->myFieldsEntry,
-                                            NO_ICON,
-                                            NO_IOR,
-                                            aFieldNameWithUnit.toLatin1().data(),
-                                            NO_PERFSITENT_REF,
-                                            aComment.toLatin1().data(),
-                                            true);
-
-         CreateReference(theStudy,
-                         aField->myEntry,
-                         aMeshOnEntity->myEntry);
-
-         TValField::const_iterator aValFieldIter = aValField.begin();
-
-         for(; aValFieldIter != aValField.end(); aValFieldIter++)
-         {
-           int aTimeStamp = aValFieldIter->first;
-           const PValForTime& aValForTime = aValFieldIter->second;
-           aComment = QString("myComment=TIMESTAMP;myMeshName=%1;myEntityId=%2;myFieldName=%3;myTimeStampId=%4;myNumComponent=%5");
+          
+          aField->myEntry = CreateAttributes(theStudy,
+                                            aMesh->myFieldsEntry,
+                                            NO_ICON,
+                                            NO_IOR,
+                                            aFieldNameWithUnit.toLatin1().data(),
+                                            NO_PERFSITENT_REF,
+                                            aComment.toLatin1().data(),
+                                            true);
+
+          CreateReference(theStudy,
+                          aField->myEntry,
+                          aMeshOnEntity->myEntry);
+
+          TValField::const_iterator aValFieldIter = aValField.begin();
+          
+          for(; aValFieldIter != aValField.end(); aValFieldIter++)
+          {
+            int aTimeStamp = aValFieldIter->first;
+            const PValForTime& aValForTime = aValFieldIter->second;
+            aComment = QString("myComment=TIMESTAMP;myMeshName=%1;myEntityId=%2;myFieldName=%3;myTimeStampId=%4;myNumComponent=%5");
             aComment = aComment.arg(aMeshName.c_str());
             aComment = aComment.arg(anEntity);
             aComment = aComment.arg(aFieldName.c_str());
             aComment = aComment.arg(aTimeStamp);
             aComment = aComment.arg(aField->myNbComp);
-
-           string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
-
-           aValForTime->myEntry = CreateAttributes(theStudy,
-                                                   aField->myEntry,
-                                                   NO_ICON,
-                                                   NO_IOR,
-                                                   aTimeStampId,
-                                                   NO_PERFSITENT_REF,
-                                                   aComment.toLatin1().data(),
-                                                   true);
-         }
-       }
+            
+            string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
+            
+            aValForTime->myEntry = CreateAttributes(theStudy,
+                                                    aField->myEntry,
+                                                    NO_ICON,
+                                                    NO_IOR,
+                                                    aTimeStampId,
+                                                    NO_PERFSITENT_REF,
+                                                    aComment.toLatin1().data(),
+                                                    true);
+          }
+        }
       }
 
       if(!anIsFieldsEntryUpdated && !theIsAtOnce)
-       RemoveSObject(theStudy, aMesh->myFieldsEntry);
+        RemoveSObject(theStudy, aMesh->myFieldsEntry);
     }
 
     ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
@@ -587,9 +583,9 @@ namespace VISU
   //----------------------------------------------------------------------------
   void
   BuildMinMax(Result_i* theResult,
-             Result_i::PInput theInput,
-             CORBA::Boolean* theIsDone,
-             CORBA::Boolean theIsBuild)
+              Result_i::PInput theInput,
+              CORBA::Boolean* theIsDone,
+              CORBA::Boolean theIsBuild)
   {
     if(!theIsBuild || *theIsDone)
       return;
@@ -608,19 +604,19 @@ namespace VISU
   //----------------------------------------------------------------------------
   void
   BuildFieldDataTree(Result_i* theResult,
-                    Result_i::PInput theInput,
-                    CORBA::Boolean* theIsFieldsDone,
-                    CORBA::Boolean theIsBuildFields,
-                    CORBA::Boolean* theIsMinMaxDone,
-                    CORBA::Boolean theIsBuildMinMax,
-                    _PTR(Study) theStudy)
+                     Result_i::PInput theInput,
+                     CORBA::Boolean* theIsFieldsDone,
+                     CORBA::Boolean theIsBuildFields,
+                     CORBA::Boolean* theIsMinMaxDone,
+                     CORBA::Boolean theIsBuildMinMax,
+                     _PTR(Study) theStudy)
   {
     BuildFields(theResult,
-               theInput,
-               theIsFieldsDone,
-               theIsBuildFields,
-               false,
-               theStudy);
+                theInput,
+                theIsFieldsDone,
+                theIsBuildFields,
+                false,
+                theStudy);
 
     BuildMinMax(theResult,
                theInput,
index b158404c7da5666b528fde98a76ea61b276d6d58..2abbd7d4578d856ee3039d2d57aee8be8d74089e 100644 (file)
@@ -505,6 +505,7 @@ VISU::Result_i
                                       false,
                                       myStudy));
   }
+
   {
     boost::thread aThread(boost::bind(&BuildFieldDataTree,
                                       this,