]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
modified method DumpStudy
authorsrn <srn@opencascade.com>
Tue, 7 Feb 2006 09:34:46 +0000 (09:34 +0000)
committersrn <srn@opencascade.com>
Tue, 7 Feb 2006 09:34:46 +0000 (09:34 +0000)
idl/SALOMEDS.idl
src/KERNEL_PY/iparameters.py
src/SALOMEDS/SALOMEDS_IParameters.cxx
src/SALOMEDS/SALOMEDS_IParameters.hxx
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_Study.hxx
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMEDS/SALOMEDS_Study_i.hxx
src/SALOMEDSClient/SALOMEDSClient_Study.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx

index c15c9ee943911eba5b5186f029564b4339ae1a79..3eb2b0541194606b0b06f3656910e5553745eeb7 100644 (file)
@@ -369,7 +369,7 @@ during each working session.
 
     void UndoPostponed(in long theWay);
 
-    boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
+    boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished, in string thePrefix);
 
 /*!
     Returns an AttributeParameter used to store common parameters for given %theSavePoint.
index 5519e29241e511654df67bcf2c4dab1d571a7b52..8754c93b5635d5635e02f253378dca59f963e0c5 100755 (executable)
@@ -15,6 +15,7 @@ PT_STRARRAY = 6
 _AP_LISTS_LIST_ = "AP_LISTS_LIST"
 _AP_ENTRIES_LIST_ = "AP_ENTRIES_LIST"
 _AP_PROPERTIES_LIST_ = "AP_PROPERTIES_LIST"
+_AP_DUMP_PYTHON_ = "AP_DUMP_PYTHON"
 
 vp_session = None
 
@@ -183,4 +184,16 @@ class IParameters:
         v.append(part2)
         return v
 
+    def setDumpPython(self, isDumping):
+        """Enables/Disables the dumping to Python"""
+        if self._ap is None: return
+        _ap.SetBool(_AP_DUMP_PYTHON_, isDumping)
+        pass
+
+    def isDumpPython(self):
+        """Returns whether there is the dumping to Python"""
+        if self._ap is None: return 0
+        if self._ap.IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN) == 0: return 0
+        return self._ap.GetBool(_AP_DUMP_PYTHON_)
+
     pass
index 89cb3f6c47ea98d9ac113cf181e5732c209129e9..65996f874e2f1e997e3fb79fee2528665da9ec6b 100644 (file)
@@ -34,7 +34,7 @@ using namespace std;
 #define _AP_LISTS_LIST_ "AP_LISTS_LIST"
 #define _AP_ENTRIES_LIST_ "AP_ENTRIES_LIST"
 #define _AP_PROPERTIES_LIST_ "AP_PROPERTIES_LIST"
-
+#define _AP_DUMP_PYTHON_ "AP_DUMP_PYTHON"
 
 /*!
   Constructor
@@ -210,3 +210,16 @@ vector<string> SALOMEDS_IParameters::parseValue(const string& value, const char
   v.push_back(part2.ToCString());
   return v;
 }
+
+void SALOMEDS_IParameters::setDumpPython(bool isDumping)
+{
+  if(!_ap) return;
+  _ap->SetBool(_AP_DUMP_PYTHON_, isDumping);
+}
+
+bool SALOMEDS_IParameters::isDumpPython()
+{
+  if(!_ap) return false;
+  if(!_ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false;
+  return (bool)_ap->GetBool(_AP_DUMP_PYTHON_);
+}
index 17c678dbc2f94979bb02b2c684245295db3f3a7a..f8bb2c4208efc5c60f9a5625e6b3e4da7ac73ece 100644 (file)
@@ -111,6 +111,17 @@ public:
   std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true);
 
 
+  /*!
+    Enables/Disables the dumping visual parameters
+   */
+  void setDumpPython(bool isDumping);
+
+  /*!
+    Returns whether there is the dumping visual parameters
+   */
+  bool isDumpPython();  
+
+
 private:
   _PTR(AttributeParameter) _ap;
 
index 233774d7b9a2daf034149a820c3c45bd6feb8179..428787d50d7796af197a38974d7c6ea173f7e5ff 100644 (file)
@@ -636,10 +636,10 @@ void SALOMEDS_Study::EnableUseCaseAutoFilling(bool isEnabled)
   else _corba_impl->EnableUseCaseAutoFilling(isEnabled);
 }
 
-bool SALOMEDS_Study::DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished)
+bool SALOMEDS_Study::DumpStudy(const string& thePath, const string& theBaseName, bool isPublished, const string& thePrefix)
 {
   //SRN: Pure CORBA DumpStudy as it does more cleaning than the local one
-  bool ret = _corba_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished);
+  bool ret = _corba_impl->DumpStudy(thePath.c_str(), theBaseName.c_str(), isPublished, thePrefix.c_str());
   return ret;
 }     
 
index 506c02c33215cf11c17ac2cd3396786391ba11ab..c6f0dd0e10922c7593b51cffecbc523ec04790ca 100644 (file)
@@ -86,7 +86,7 @@ public:
   virtual _PTR(UseCaseBuilder) GetUseCaseBuilder();
   virtual void Close();
   virtual void EnableUseCaseAutoFilling(bool isEnabled);
-  virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished); 
+  virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished,const std::string& thePrefix); 
   virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
   virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID, 
                                                       const std::string& theModuleName, int theSavePoint);
index 45fa259a1627be62ee5f6317cd109ad849ad5700..ca0027de9d726870ef6e9c064c164724e553b245 100644 (file)
@@ -739,13 +739,16 @@ void SALOMEDS_Study_i::UndoPostponed(CORBA::Long theWay)
  *  Purpose  : 
  */
 //============================================================================
-CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished)
+CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, 
+                                          const char* theBaseName, 
+                                          CORBA::Boolean isPublished,
+                                          const char* thePrefix)
 {
   SALOMEDS::Locker lock; 
 
-  TCollection_AsciiString aPath((char*)thePath), aBaseName((char*)theBaseName);
+  TCollection_AsciiString aPath((char*)thePath), aBaseName((char*)theBaseName), aPrefix((char*)thePrefix);
   SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb);
-  CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory);
+  CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory, aPrefix);
   delete factory;
   return ret;
 }
index 24f8577349fd3b3ac5664b2779c2e48dcca23119..96914aecf3a1f42dc69a53ea9f661e430a1de6b1 100644 (file)
@@ -284,7 +284,7 @@ public:
                                                               const char* theModuleName, 
                                                               CORBA::Long theSavePoint);
 
-  virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished); 
+  virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished, const char* thePrefix);
 
   virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
 
index ea8c088745c2531950417a7f1dfe8b709cbee38c..f37fc6fb28c74fcbc9914ea67d268c4a7a3c90f2 100644 (file)
@@ -80,7 +80,10 @@ public:
   virtual _PTR(UseCaseBuilder) GetUseCaseBuilder() = 0;
   virtual void Close() = 0;
   virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0;
-  virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) = 0; 
+  virtual bool DumpStudy(const std::string& thePath, 
+                        const std::string& theBaseName, 
+                        bool isPublished, 
+                        const std::string& thePrefix) = 0; 
   virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint) = 0;
   virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID, 
                                                       const std::string& theModuleName, int theSavePoint) = 0;
index 997c8f6795bbaf7a0f3bd2a3ad8e997a51ecef4e..6bcdfff3b82da2a19890f8c5935c7d53efad9875 100644 (file)
@@ -1246,7 +1246,8 @@ Handle(TDF_Attribute) SALOMEDSImpl_Study::GetAttribute(const TCollection_AsciiSt
 bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath,
                                   const TCollection_AsciiString& theBaseName,
                                   bool isPublished,
-                                  SALOMEDSImpl_DriverFactory* theFactory)
+                                  SALOMEDSImpl_DriverFactory* theFactory,
+                                  const TCollection_AsciiString& thePrefix)
 {
   _errorCode = "";
 
@@ -1298,6 +1299,12 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath,
   fp << "import " << aBatchModeScript << "\n" << endl;
   fp << "sys.path.insert( 0, \'" << thePath << "\')\n" << endl;
 
+  //Output the prefix if there is any 
+  if(thePrefix.Length() > 0) {
+    fp << thePrefix;
+    fp << "\n" << endl;
+  }
+
   Handle(TColStd_HSequenceOfAsciiString) aSeqOfFileNames = new TColStd_HSequenceOfAsciiString;
 
   //Iterate all components and create the componponents specific scripts.
index bdf3972f79e6f6ac6e66b3822d419e83627df570..b2f497213dff03a84609a86e67aed1d40a262af5 100644 (file)
@@ -255,9 +255,10 @@ public:
   Standard_EXPORT virtual bool HasCurrentContext() { return !_current.IsNull(); }
 
   Standard_EXPORT virtual bool DumpStudy(const TCollection_AsciiString& thePath, 
-                        const TCollection_AsciiString& theBaseName, 
-                        bool isPublished,
-                        SALOMEDSImpl_DriverFactory* theFactory);
+                                        const TCollection_AsciiString& theBaseName, 
+                                        bool isPublished,
+                                        SALOMEDSImpl_DriverFactory* theFactory,
+                                        const TCollection_AsciiString& thePrefix = "");
 
   Standard_EXPORT static TCollection_AsciiString GetDumpStudyComment(const char* theComponentName = 0);