]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Issue #16922 [CEA 16749] SALOME_MODULES_ORDER not set in SALOME 9.3.0 Windows archive
authorvsr <vsr@opencascade.com>
Tue, 7 May 2019 13:17:43 +0000 (16:17 +0300)
committervsr <vsr@opencascade.com>
Tue, 7 May 2019 13:17:43 +0000 (16:17 +0300)
- Put SHAPER always to first place

src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx

index 62a2ea30d83161523a894d0f67aea54be02ee0d4..579bf23489b27db03c47d49c9524304256a5f744 100644 (file)
@@ -2075,19 +2075,24 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath,
   }
 
   std::vector<std::string> aSeq;
-  std::string aCompType, aFactoryType;
+  std::string aFactoryType;
 
   //Build a list of all components in the Study
   SALOMEDSImpl_SComponentIterator itcomponent = NewComponentIterator();
 
-  for (; itcomponent.More(); itcomponent.Next()) {
-    SALOMEDSImpl_SComponent sco = itcomponent.Value();
-    aCompType = sco.ComponentDataType();
-   if (aCompType == "GEOM")
-      aSeq.insert(aSeq.begin(), aCompType);
-    else
-      aSeq.push_back(aCompType);
+  for (; itcomponent.More(); itcomponent.Next())
+    aSeq.push_back(itcomponent.Value().ComponentDataType());
+
+  std::vector<std::string>::iterator it;
+  if ( (it = std::find( aSeq.begin(), aSeq.end(), "GEOM" )) != aSeq.end() ) {
+    aSeq.erase( it );
+    aSeq.insert(aSeq.begin(), "GEOM" );
+  }
+  if ( (it = std::find( aSeq.begin(), aSeq.end(), "SHAPER" )) != aSeq.end() ) {
+    aSeq.erase( it );
+    aSeq.insert(aSeq.begin(), "SHAPER" );
   }
+
   // re-arrange modules in the sequence, if specific order is given via SALOME_MODULES_ORDER environment variable.
   if ( getenv("SALOME_MODULES_ORDER") != 0 ) {
     std::string order = getenv("SALOME_MODULES_ORDER");
@@ -2180,7 +2185,7 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath,
   int aLength = aSeq.size();
   for(int i = 1; i <= aLength; i++) {
 
-    aCompType = aSeq[i-1];
+    std::string aCompType = aSeq[i-1];
     SALOMEDSImpl_SComponent sco = FindComponent(aCompType);
     SALOMEDSImpl_Driver* aDriver = NULL;
     // if there is an associated Engine call its method for saving