Salome HOME
Update copyrights
[modules/yacs.git] / src / KernelHelpers / SALOME_StudyEditor.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 21727e7..afb8997
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // Author: Guillaume Boulant (EDF/R&D) 
 
 #include "SALOME_StudyEditor.hxx"
 
 /** Canonic constructor. The object can't be used without a setStudy() */
 SALOME_StudyEditor::SALOME_StudyEditor() {
-}
-
-void SALOME_StudyEditor::setStudy(SALOMEDS::Study_ptr study) {
-  _study = study;
-  _sbuilder = _study->NewBuilder();    
-}
-
-void SALOME_StudyEditor::setStudyById(int studyId) {
-  this->setStudy(KERNEL::getStudyManager()->GetStudyByID(studyId));
-}
-
-int SALOME_StudyEditor::getStudyId() {
-  if ( _study->_is_nil() ) return UNDEFINED; 
-  return _study->StudyId();
-}
-
-SALOME_StudyEditor::SALOME_StudyEditor(int studyId) {
-  this->setStudyById(studyId);
-}
-SALOME_StudyEditor::SALOME_StudyEditor(SALOMEDS::Study_ptr study) {
-  this->setStudy(study);
+  _sbuilder = KERNEL::getStudyServant()->NewBuilder();
 }
 
 SALOMEDS::SObject_ptr SALOME_StudyEditor::newObject(SALOMEDS::SObject_ptr parent) {
@@ -51,7 +32,7 @@ SALOMEDS::SObject_ptr SALOME_StudyEditor::newObject(SALOMEDS::SObject_ptr parent
 }
 
 SALOMEDS::SObject_ptr SALOME_StudyEditor::findObject(const char * entry) {
-  SALOMEDS::SObject_var sobject = _study->FindObjectID(entry);
+  SALOMEDS::SObject_var sobject = KERNEL::getStudyServant()->FindObjectID(entry);
   return sobject._retn();
 }
 
@@ -78,7 +59,7 @@ bool SALOME_StudyEditor::bindEngine(SALOMEDS::SComponent_var studyRoot,
 }
 
 SALOMEDS::SComponent_ptr SALOME_StudyEditor::findRoot(const char * moduleName) {
-  return _study->FindComponent(moduleName);
+  return KERNEL::getStudyServant()->FindComponent(moduleName);
 }
 
 void SALOME_StudyEditor::setName(SALOMEDS::SObject_var sobject, const char * value) {
@@ -109,7 +90,7 @@ void SALOME_StudyEditor::setIcon(SALOMEDS::SObject_var sobject, const char * res
 
 //
 // MEM: AttributeParameter
-// Note that the AttributeParameter is a multitype dictionnary whose
+// Note that the AttributeParameter is a multitype dictionary whose
 // keys are the names specified when setting the value
 //