]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Allow in SHAPERSTUDY python dump to store files in the same folder with the exported...
authormpv <mpv@opencascade.com>
Fri, 7 Feb 2020 14:39:25 +0000 (17:39 +0300)
committermpv <mpv@opencascade.com>
Fri, 7 Feb 2020 14:39:25 +0000 (17:39 +0300)
idl/SALOMEDS.idl
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMEDS/SALOMEDS_Study_i.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx

index 9488ca344139a9caca4e0bb08e26aa07864f81e8..74e422e3d190f0b8950224b37a888d5db1515f6a 100644 (file)
@@ -644,6 +644,10 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin
                       in boolean isPublished,
                       in boolean isMultiFile) raises(StudyInvalidReference);
 
+/*! \brief  Returns the folder of the python script which is currently dumped.
+*/
+    string GetDumpPath();
+
 /*! \brief  Get an AttributeParameter used to store common parameters for given %theSavePoint.
 
     \param theID identifies a common parameters set (Example: "Interface Applicative")
index b7f8654d3273605a75d93610869a443a30d20f2e..ce091453380513b2f4ed4da7c3a77926e4110b32 100644 (file)
@@ -1154,6 +1154,16 @@ CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath,
   return ret;
 }
 
+//============================================================================
+/*! Function : GetDumpPath
+*  Purpose  : 
+*/
+//============================================================================
+char* SALOMEDS_Study_i::GetDumpPath()
+{
+  return CORBA::string_dup(_impl->GetDumpPath().c_str());
+}
+
 //============================================================================
 /*! Function : GetCommonParameters
  *  Purpose  : 
index ad39fde89a57a7a310bc9ac5f36a6f1bae9d497a..330f54b7c1f9f62560c051a4184d491298bbd5a0 100644 (file)
@@ -340,6 +340,8 @@ public:
                                    CORBA::Boolean isPublished,
                                    CORBA::Boolean isMultiFile);
 
+  virtual char* GetDumpPath();
+
   virtual SALOMEDSImpl_Study* GetImpl() { return _impl; }
 
   virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
index 05fa40fb476b972295b2f284e252bad7e425809d..8a31a84d12ec816c8a44027fb50fa42619547a59 100644 (file)
@@ -2151,6 +2151,7 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath,
     _errorCode = std::string("Can't create a file ")+aFileName;
     return false;
   }
+  _dumpPath = thePath;
 
   std::stringstream sfp;
 
@@ -2304,9 +2305,18 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath,
 
   fp.close();
 
+  _dumpPath.clear();
+
   return isOk;
 }
 
+// Returns the folder of the python script which is currently dumped
+std::string SALOMEDSImpl_Study::GetDumpPath()
+{
+  return _dumpPath;
+}
+
+
 //=======================================================================
 //function : GetDumpStudyComment
 //purpose  : return a header comment for a DumpStudy script
index 036c142ae76e07c36a212f08c6f1812047e4f898..014c0f7bf11de08b5779287bdb0e701884ab7d76 100644 (file)
@@ -72,6 +72,7 @@ private:
   SALOMEDSImpl_UseCaseBuilder* _useCaseBuilder;
   SALOMEDSImpl_AbstractCallback* _notifier;
   SALOMEDSImpl_AbstractCallback* _genObjRegister;
+  std::string              _dumpPath; // path (folder) to the python file which is currently dumped
 
   std::map<std::string, SALOMEDSImpl_SObject> _mapOfSO;
   std::map<std::string, SALOMEDSImpl_SComponent> _mapOfSCO;
@@ -248,6 +249,9 @@ public:
                          SALOMEDSImpl_DriverFactory* theFactory);
 
   static std::string GetDumpStudyComment(const char* theComponentName = 0);
+
+  // Returns the folder of the python script which is currently dumped
+  std::string GetDumpPath();
   
   virtual DF_Document* GetDocument() { return _doc; }