Salome HOME
Fixed problem after execute python command "myStudy.Init()"
authorimn <imn@opencascade.com>
Tue, 22 Nov 2016 10:23:21 +0000 (13:23 +0300)
committerimn <imn@opencascade.com>
Tue, 22 Nov 2016 10:23:34 +0000 (13:23 +0300)
idl/SALOMEDS.idl
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_Study.hxx
src/SALOMEDS/SALOMEDS_Study_i.cxx

index 8c37a73cd05461911476d04c23a5e63fc43ff977..f52389aa1ea558c1c814204f0d02ca63258d7554 100644 (file)
@@ -604,6 +604,10 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin
 /*! \brief Clear a study object
 */
     void Clear();
+
+/*! \brief Initialization a study object
+*/
+    void Init();
     
 /*! \brief Open a study by url
 
index 40894df094189bbccc8f551fe7056d8429a6eb82..a8bcfbd845c0ecb73346922837d4d0d22fd1279f 100644 (file)
@@ -91,20 +91,30 @@ SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy)
     _corba_impl = SALOMEDS::Study::_duplicate(theStudy);
   }
 
-  Init();
+  InitORB();
 }
 
 SALOMEDS_Study::~SALOMEDS_Study()
 {
 }
 
-void SALOMEDS_Study::Init()
+void SALOMEDS_Study::InitORB()
 {
   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
   ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
   _orb = init(0 , 0 ) ;
 }
 
+void SALOMEDS_Study::Init()
+{
+  if (_isLocal) {
+    SALOMEDS::Locker lock;
+    _local_impl->Init();
+  }
+  else
+    _corba_impl->Init();
+}
+
 void SALOMEDS_Study::Clear()
 {
   if (_isLocal) {
index 5854879281bf998e168474a6c33bf9e260fe8f42..8d84ab6c299b3d30d1d9b438e962d0caaefc590e 100644 (file)
@@ -53,6 +53,7 @@ public:
   ~SALOMEDS_Study();
 
   virtual void Clear();
+  virtual void Init();
 
   virtual bool Open(const std::string& theStudyUrl);
 
@@ -143,7 +144,7 @@ public:
   SALOMEDSImpl_Study* GetLocalImpl() { return _local_impl; }
 
 private:
-  void Init();
+  void InitORB();
 
 };
 #endif
index 51f96ea7890a8008dc4fc570e4b9d7222962f965..8091ece62cdff95838cda0e743fb24c5ae055783 100644 (file)
@@ -258,6 +258,9 @@ SALOMEDS_Study_i::~SALOMEDS_Study_i()
 //============================================================================
 void SALOMEDS_Study_i::Init()
 {
+  if ( !_impl->GetDocument() )
+    _impl->Init();
+
   _builder        = new SALOMEDS_StudyBuilder_i(_impl->NewBuilder(), _orb);  
   _notifier       = new SALOMEDS::Notifier(_orb);
   _genObjRegister = new SALOMEDS::GenObjRegister(_orb);