]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for IPAL16737 (Groups aren't visualized in VISU).
authorrnv <rnv@opencascade.com>
Thu, 11 Oct 2007 06:50:00 +0000 (06:50 +0000)
committerrnv <rnv@opencascade.com>
Thu, 11 Oct 2007 06:50:00 +0000 (06:50 +0000)
src/VISU_I/VISU_ResultUtils.cc

index 9f8d37d046f45aed3ec419bd2dfc4de267fab611..00b60a43394bcc9018c76f605bbd7b0d6f9c653b 100644 (file)
@@ -187,9 +187,9 @@ namespace VISU
     QString aName;
     const string tmp (theUnits.size(),' ');
     if (theUnits == "" || theUnits == tmp)
-      aName.sprintf("%s, -",theName.c_str());
+      aName = QString("%1, -").arg(theName.c_str());
     else
-      aName.sprintf("%s, %s",theName.c_str(),theUnits.c_str());
+      aName = QString("%1, %2").arg(theName.c_str()).arg(theUnits.c_str());
     aName = aName.simplifyWhiteSpace();
     return aName.latin1();
   }
@@ -253,9 +253,9 @@ namespace VISU
       const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       if(aMeshOnEntityMap.empty()) 
        continue;
-      aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
-                      aMeshName.c_str(),
-                      aMesh->myDim);
+      aComment = QString("myComment=MESH;myName=%1;myDim=%2");
+      aComment = aComment.arg(aMeshName.c_str());
+      aComment = aComment.arg(aMesh->myDim);
       aMesh->myEntry = 
        CreateAttributes(theStudy,
                         theResultEntry,
@@ -266,8 +266,7 @@ namespace VISU
                         aComment.latin1(),
                         true);
     
-      aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
-                      aMeshName.c_str());
+      aComment = QString("myComment=FAMILIES;myMeshName=%1").arg(aMeshName.c_str());
       std::string aSubMeshesEntry = 
        CreateAttributes(theStudy,
                         aMesh->myEntry,
@@ -338,9 +337,9 @@ namespace VISU
        continue;
        }
        
-       aComment.sprintf("myComment=ENTITY;myMeshName=%s;myId=%d",
-                        aMeshName.c_str(),
-                        anEntity);
+       aComment = QString("myComment=ENTITY;myMeshName=%1;myId=%2");
+        aComment = aComment.arg(aMeshName.c_str());
+       aComment = aComment.arg(anEntity);
        
        aMeshOnEntity->myEntry = 
          CreateAttributes(theStudy, 
@@ -400,11 +399,11 @@ namespace VISU
        for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
          const string& aFamilyName = aFamilyMapIter->first;
          const PFamily& aFamily = aFamilyMapIter->second;
-         aComment.sprintf("myComment=FAMILY;myMeshName=%s;myEntityId=%d;myName=%s",
-                          aMeshName.c_str(),
-                          anEntity,
-                          aFamilyName.c_str());
-         
+          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());
+          SCRUTE(aComment);
          aFamily->myEntry =
            CreateAttributes(theStudy,
                             aMeshOnEntity->myEntry,
@@ -419,8 +418,7 @@ namespace VISU
       //Importing groups
       const TGroupMap& aGroupMap = aMesh->myGroupMap;
       if(!aGroupMap.empty()){
-       aComment.sprintf("myComment=GROUPS;myMeshName=%s",
-                        aMeshName.c_str());
+       aComment = QString("myComment=GROUPS;myMeshName=%1").arg(aMeshName.c_str());
        
        CreateAttributes(theStudy,
                         aMesh->myGroupsEntry,
@@ -435,9 +433,7 @@ namespace VISU
        for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
          const string& aGroupName = aGroupMapIter->first;
          const PGroup& aGroup = aGroupMapIter->second;
-         aComment.sprintf("myComment=GROUP;myMeshName=%s;myName=%s",
-                          aMeshName.c_str(),
-                          aGroupName.c_str());
+         aComment = QString("myComment=GROUP;myMeshName=%1;myName=%2").arg(aMeshName.c_str()).arg(aGroupName.c_str());
          aGroup->myEntry = 
            CreateAttributes(theStudy,
                             aMesh->myGroupsEntry,
@@ -534,12 +530,12 @@ namespace VISU
          const PField& aField = aFieldMapIter->second;
          const TValField& aValField = aField->myValField;
          QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
-         aComment.sprintf("myComment=FIELD;myMeshName=%s;myEntityId=%d;myName=%s;myNbTimeStamps=%d;myNumComponent=%d",
-                          aMeshName.c_str(),
-                          anEntity,
-                          aFieldName.c_str(),
-                          aValField.size(),
-                          aField->myNbComp);
+         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,
@@ -560,12 +556,12 @@ namespace VISU
          {
            int aTimeStamp = aValFieldIter->first;
            const PValForTime& aValForTime = aValFieldIter->second;
-           aComment.sprintf("myComment=TIMESTAMP;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
-                            aMeshName.c_str(),
-                            anEntity,
-                            aFieldName.c_str(),
-                            aTimeStamp,
-                            aField->myNbComp);
+           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);