]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Debug
authorouv <ouv@opencascade.com>
Mon, 21 Dec 2009 10:01:18 +0000 (10:01 +0000)
committerouv <ouv@opencascade.com>
Mon, 21 Dec 2009 10:01:18 +0000 (10:01 +0000)
idl/SALOME_Notebook.idl
src/Notebook/SALOME_Notebook.cxx
src/Notebook/SALOME_Notebook.hxx
src/Notebook/SALOME_ParameterizedObject.cxx
src/Notebook/SALOME_ParameterizedObject.hxx
src/SALOMEDS/SALOMEDS_StudyManager_i.cxx

index 0c1d20edeab945e62fc04cd867aefa950fa0a690..172255297d413fb173327f8b42bf1f398604e649 100644 (file)
 
 #include "SALOME_GenericObj.idl"
 
+module SALOMEDS
+{
+  interface Study;
+};
+
 /*! \brief
      This package contains the interfaces used for notebook
      (model parametrization) functionality
@@ -239,6 +244,9 @@ module SALOME
 
     //! Return string array containing information about parameters used by given string attribute
     StringArray GetAttributeParameters( in string theStringAttribute );
+
+    //! Return pointer to study
+    SALOMEDS::Study GetStudy();
   };
 };
 
index 615a31196241df95a1d3f7021658ed1b4d4ef1c2..4a0b8f33ab93d13df788e83ef827e44702f500ae 100644 (file)
@@ -1188,6 +1188,11 @@ SALOME::StringArray* SALOME_Notebook::GetAttributeParameters( const char* theStr
   return GenerateList( aRes );
 }
 
+SALOMEDS::Study_ptr SALOME_Notebook::GetStudy()
+{
+  return myStudy.in();
+}
+
 int SALOME_Notebook::GetNewId()
 {
   return ++myMaxId;
index 46be534e6aa4d81aac81aebc35c1521693b2a792..8e5fc06de99ae0f94bd8ff3b10b59de4eb2c42ba 100644 (file)
@@ -81,6 +81,8 @@ public:
   virtual SALOME::StringArray* GetParameters( const char* theParamName );
   virtual SALOME::StringArray* GetAttributeParameters( const char* theStringAttribute );
 
+  virtual SALOMEDS::Study_ptr  GetStudy();
+
   SALOME_Parameter* GetParameterPtr( const char* theParamName ) const;
   void              Update( bool theOnlyParameters );
   void              UpdateAnonymous( const std::string& theOldName, const std::string& theNewName );
index 1754271af78caf8f0c2a0d8c4171ce1c00a4a003..d97476c08ef4268248275f00cb10bd3d91106405 100644 (file)
 
 #include <SALOME_ParameterizedObject.hxx>
 
+SALOME_ParameterizedObject::SALOME_ParameterizedObject()
+{
+}
+
 SALOME_ParameterizedObject::SALOME_ParameterizedObject( SALOME::Notebook_ptr theNotebook )
 {
   myNotebook = theNotebook;
@@ -35,3 +39,13 @@ void SALOME_ParameterizedObject::BeforeDeactivate()
   if( !CORBA::is_nil( myNotebook ) )
     myNotebook->RemoveObject( _this() );
 }
+
+void SALOME_ParameterizedObject::SetNotebook( SALOME::Notebook_ptr theNotebook )
+{
+  myNotebook = theNotebook;
+}
+
+SALOME::Notebook_ptr SALOME_ParameterizedObject::GetNotebook()
+{
+  return myNotebook.in();
+}
index 6a1c9046948a71acc18ad2a158ab39cb6edcbdda..9ff1b269a789f2ce622b756fc848bff49783fff2 100644 (file)
 class SALOME_ParameterizedObject : public virtual POA_SALOME::ParameterizedObject, public virtual SALOME::GenericObj_i
 {
 public:
+  SALOME_ParameterizedObject();
   SALOME_ParameterizedObject( SALOME::Notebook_ptr theNotebook );
 
-  virtual void BeforeDeactivate();
+  virtual void         BeforeDeactivate();
+
+  void                 SetNotebook( SALOME::Notebook_ptr theNotebook );
+  SALOME::Notebook_ptr GetNotebook();
 
 private:
   SALOME::Notebook_var myNotebook;
index fb7b0bc9b1336078c6193667c95a85a4d2c092ed..af0f4590c817d7ae89f17bab3767d2d73e8ee180 100644 (file)
@@ -185,9 +185,10 @@ SALOMEDS::Study_ptr  SALOMEDS_StudyManager_i::Open(const char* aUrl)
 
 
   SALOMEDS::SComponent_ptr aNotebookComponent = Study->FindComponent( "NOTEBOOK" );
-  SALOMEDS::StudyBuilder_var aBuilder = Study->NewBuilder();
-  aBuilder->LoadWith( aNotebookComponent, SALOME_NotebookDriver::getInstance() );
-
+  if(!CORBA::is_nil(aNotebookComponent)) {
+    SALOMEDS::StudyBuilder_var aBuilder = Study->NewBuilder();
+    aBuilder->LoadWith( aNotebookComponent, SALOME_NotebookDriver::getInstance() );
+  }
 
   // Notebook creation
   //SALOME::Notebook_var aNotebookVar = Study->GetNotebook();