From: ouv Date: Mon, 21 Dec 2009 10:01:18 +0000 (+0000) Subject: Debug X-Git-Tag: PHASE_17_Part1_V4~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=49f87aa5d5e3ac63956c3851b295e45e06185b02;p=modules%2Fkernel.git Debug --- diff --git a/idl/SALOME_Notebook.idl b/idl/SALOME_Notebook.idl index 0c1d20ede..172255297 100644 --- a/idl/SALOME_Notebook.idl +++ b/idl/SALOME_Notebook.idl @@ -32,6 +32,11 @@ #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(); }; }; diff --git a/src/Notebook/SALOME_Notebook.cxx b/src/Notebook/SALOME_Notebook.cxx index 615a31196..4a0b8f33a 100644 --- a/src/Notebook/SALOME_Notebook.cxx +++ b/src/Notebook/SALOME_Notebook.cxx @@ -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; diff --git a/src/Notebook/SALOME_Notebook.hxx b/src/Notebook/SALOME_Notebook.hxx index 46be534e6..8e5fc06de 100644 --- a/src/Notebook/SALOME_Notebook.hxx +++ b/src/Notebook/SALOME_Notebook.hxx @@ -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 ); diff --git a/src/Notebook/SALOME_ParameterizedObject.cxx b/src/Notebook/SALOME_ParameterizedObject.cxx index 1754271af..d97476c08 100644 --- a/src/Notebook/SALOME_ParameterizedObject.cxx +++ b/src/Notebook/SALOME_ParameterizedObject.cxx @@ -25,6 +25,10 @@ #include +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(); +} diff --git a/src/Notebook/SALOME_ParameterizedObject.hxx b/src/Notebook/SALOME_ParameterizedObject.hxx index 6a1c90469..9ff1b269a 100644 --- a/src/Notebook/SALOME_ParameterizedObject.hxx +++ b/src/Notebook/SALOME_ParameterizedObject.hxx @@ -33,9 +33,13 @@ 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; diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index fb7b0bc9b..af0f4590c 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -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();