]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge from BR_Dev_For_4_0 branch (from mergeto_BR_QT4_Dev_17Jan08 tag) before_mergefrom_BR_Dev_For_4_0_12Feb08 mergefrom_BR_Dev_For_4_0_17Jan08
authorvsr <vsr@opencascade.com>
Mon, 11 Feb 2008 14:46:01 +0000 (14:46 +0000)
committervsr <vsr@opencascade.com>
Mon, 11 Feb 2008 14:46:01 +0000 (14:46 +0000)
src/VISU_I/VISU_MultiResult_i.cc

index f99d8ffda706df3072300b9cc17880b698915c25..079b9b91a20704a5c37173176492acd643be224a 100644 (file)
@@ -42,6 +42,8 @@
 #include <boost/thread/thread.hpp>
 #include <boost/bind.hpp>
 
+#include <QStringList>
+
 #include <strstream>
 
 #ifdef _DEBUG_
@@ -308,7 +310,7 @@ namespace VISU
                         NO_IOR,
                         "Parts",
                         NO_PERFSITENT_REF,
-                        aComment.latin1(),
+                        aComment.toLatin1().data(),
                         false);
       }
       
@@ -330,7 +332,7 @@ namespace VISU
        MultiResult_i::TPartInfo aPartInfo = GetPartInfo(aMultiprObj, aPartName);
 
        QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
-       aPartInfos[aFileInfo.fileName()] = aPartInfo;
+       aPartInfos[aFileInfo.fileName().toLatin1().data()] = aPartInfo;
        
        aPartName2FileName[aPartInfo.myName] = aPartInfo.myFileName;
        BEGMSG(MYDEBUG, "aPartName2FileName['"<<aPartInfo.myName<<"'] = '"<<aPartInfo.myFileName<<"'\n");
@@ -352,7 +354,7 @@ namespace VISU
                           NO_IOR,
                           aPartInfo.myName,
                           NO_PERFSITENT_REF,
-                          aComment.latin1(),
+                          aComment.toLatin1().data(),
                           true);
          aPartName2Resolution[aPartInfo.myName] = aResolution;
          BEGMSG(MYDEBUG, "aPartName2Resolution['"<<aPartInfo.myName<<"'] = '"<<aResoltutionsString<<"'\n");
@@ -559,9 +561,9 @@ VISU::MultiResult_i
     try {
       myMultiprObj.create(theFileName);
       if ( myMultiprObj.isValidDistributedMEDFile() ) {
-       aTargetFileName = myMultiprObj.getSequentialMEDFilename();
-       SetInitFileName(aFileInfo.filePath().latin1());
-       SetName(VISU::GenerateName(aFileInfo.fileName()).latin1(), false);
+       aTargetFileName = myMultiprObj.getSequentialMEDFilename().c_str();
+       SetInitFileName(aFileInfo.filePath().toLatin1().data());
+       SetName(VISU::GenerateName(aFileInfo.fileName().toLatin1().data()).toLatin1().data(), false);
        myIsBuildParts = true;
       }
     }catch(std::exception& exc){
@@ -576,7 +578,7 @@ VISU::MultiResult_i
     }
   }
 
-  return TSuperClass::Create(aTargetFileName);
+  return TSuperClass::Create(aTargetFileName.toLatin1().data());
 }
 
 
@@ -622,8 +624,8 @@ VISU::MultiResult_i
   BEGMSG(MYDEBUG, "aPrefix = '"<<aPrefix<<"'\n");
 
   // To get a common prefix used in the multi file
-  QFileInfo aFileInfo(myMultiprObj.getSequentialMEDFilename());
-  std::string aFilePrefix = aFileInfo.baseName(TRUE).latin1();
+  QFileInfo aFileInfo(myMultiprObj.getSequentialMEDFilename().c_str());
+  std::string aFilePrefix = aFileInfo.completeBaseName().toLatin1().data();
 
   MultiResult_i::TPartNames aPartNames = myMultiprObj.getParts();
   for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
@@ -631,9 +633,9 @@ VISU::MultiResult_i
     MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
 
     QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
-    std::string aFile = aFileInfo.absFilePath().latin1();
+    std::string aFile = aFileInfo.absoluteFilePath().toLatin1().data();
 
-    std::string aFileName = aFileInfo.fileName().latin1();
+    std::string aFileName = aFileInfo.fileName().toLatin1().data();
     VISU::TSubString(aFileName, aFilePrefix) = aPrefix;
     VISU::TSubString(aFileName, aSuffix) = "";
     aFileName = aFileName + aSuffix;
@@ -702,8 +704,8 @@ VISU::MultiResult_i
     VISU::SplitName(GetFileName(), aBase, aSuffix);
     INITMSG(MYDEBUG, "aBase = '"<<aBase<<"'; aSuffix = '"<<aSuffix<<"'\n");
 
-    QFileInfo aFileInfo(myMultiprObj.getSequentialMEDFilename());
-    std::string aFilePrefix = aFileInfo.baseName(TRUE).latin1();
+    QFileInfo aFileInfo(myMultiprObj.getSequentialMEDFilename().c_str());
+    std::string aFilePrefix = aFileInfo.completeBaseName().toLatin1().data();
     BEGMSG(MYDEBUG, "aFilePrefix = '"<<aFilePrefix<<"'\n");
 
     std::ostringstream aPartInfos;
@@ -713,7 +715,7 @@ VISU::MultiResult_i
       MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
 
       QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
-      std::string aFileName = aFileInfo.fileName().latin1();
+      std::string aFileName = aFileInfo.fileName().toLatin1().data();
       VISU::TSubString(aFileName, aFilePrefix + "_") = "";      
       VISU::TSubString(aFileName, aSuffix) = "";
       aPartInfo.myFileName = aFileName + aSuffix;
@@ -744,20 +746,20 @@ VISU::MultiResult_i
   if(!myIsBuildParts)
     return this;
   
-  QStringList aResolutions = QStringList::split("|", VISU::Storable::FindValue(theMap, "myResolutions"));
-  QStringList aPartNames = QStringList::split("|",VISU::Storable::FindValue(theMap, "myPartNames") );
+  QStringList aResolutions = VISU::Storable::FindValue(theMap, "myResolutions").split("|", QString::SkipEmptyParts);
+  QStringList aPartNames = VISU::Storable::FindValue(theMap, "myPartNames").split("|", QString::SkipEmptyParts);
   for(size_t anId = 0, anEnd = aPartNames.size(); anId < anEnd; anId++){
     const QString& aPartName = aPartNames[anId];
     VISU::Result::Resolution aResolution = VISU::Result::Resolution(aResolutions[anId].toInt());
-    myPartName2Resolution[aPartName.latin1()] = aResolution;
-    INITMSG(MYDEBUG, "aPartName = '"<<aPartName<<"' = "<<aResolution<<"\n");
+    myPartName2Resolution[aPartName.toLatin1().data()] = aResolution;
+    INITMSG(MYDEBUG, "aPartName = '"<<aPartName.toLatin1().data()<<"' = "<<aResolution<<"\n");
   }
   
   std::string aBase, aSuffix;
   SplitName(GetFileName(), aBase, aSuffix);
   INITMSGA(MYDEBUG, 0, "aBase = '"<<aBase<<"'; aSuffix = '"<<aSuffix<<"'\n");
 
-  std::string aSourceFileName = GetFileInfo().absFilePath().latin1();
+  std::string aSourceFileName = GetFileInfo().absoluteFilePath().toLatin1().data();
   BEGMSG(MYDEBUG, "aSourceFileName = '"<<aSourceFileName<<"'\n");    
   
   std::string aPrefix = aSourceFileName;
@@ -775,11 +777,11 @@ VISU::MultiResult_i
     aMultiFileStream<<"# [SOURCE]="<<aSourceFileName<<"\n";
     aMultiFileStream<<"#\n";
 
-    QStringList aPartInfos = QStringList::split("|", VISU::Storable::FindValue(theMap, "myPartInfos"));
+    QStringList aPartInfos = VISU::Storable::FindValue(theMap, "myPartInfos").split("|", QString::SkipEmptyParts);
     aMultiFileStream<<aPartInfos.size()<<"\n";
 
     for(size_t anId = 0, anEnd = aPartInfos.size(); anId < anEnd; anId++){
-      MultiResult_i::TPartInfo aPartInfo = GetPartInfo(aPartInfos[anId].latin1());
+      MultiResult_i::TPartInfo aPartInfo = GetPartInfo(aPartInfos[anId].toLatin1().data());
       aPartInfo.myFileName = aPrefix + "_" + aPartInfo.myFileName;
       INITMSG(MYDEBUG, "aPartInfo.myFileName = '"<<aPartInfo.myFileName<<"'\n");    
       aMultiFileStream<<aPartInfo<<"\n";
@@ -961,7 +963,7 @@ VISU::MultiResult_i
   anOutputStream<<"myComment=PART;";
   anOutputStream<<"myName="<<thePartName<<";";
   anOutputStream<<"myMeshName="<<theMeshName<<";";
-  anOutputStream<<"myResolutions="<<aRestoringMap["myResolutions"]<<";";
+  anOutputStream<<"myResolutions="<<aRestoringMap["myResolutions"].toLatin1().data()<<";";
   anOutputStream<<"myState="<<theResolution;
   anOutputStream<<ends;