From ba329a0819cdc16191bf681e1323e7d5d3ddfa86 Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 8 Dec 2009 13:28:20 +0000 Subject: [PATCH] Parameters dependencies --- src/Notebook/SALOME_Notebook.cxx | 39 +++++++++++++++++--------------- src/Notebook/SALOME_Notebook.hxx | 4 ++-- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/Notebook/SALOME_Notebook.cxx b/src/Notebook/SALOME_Notebook.cxx index fb4e59aae..52f978845 100644 --- a/src/Notebook/SALOME_Notebook.cxx +++ b/src/Notebook/SALOME_Notebook.cxx @@ -1072,9 +1072,10 @@ void SALOME_Notebook::ThrowError( const std::string& theErrorMsg ) const throw anError; } -char* SALOME_Notebook::GetParameters( const char* theComponent, const char* theEntry ) +SALOME::StringArray* SALOME_Notebook::GetObjectParameters( const char* theComponent, const char* theEntry ) { - std::string aRes, aKey = GetKey( theComponent, theEntry ), aComponent, aName; + std::list aDeps; + std::string aKey = GetKey( theComponent, theEntry ), aComponent, aName; std::map< std::string, std::list >::const_iterator it = myDependencies.find( aKey ); if( it!=myDependencies.end() ) { @@ -1083,15 +1084,16 @@ char* SALOME_Notebook::GetParameters( const char* theComponent, const char* theE { aComponent = GetComponent( *dit, aName ); if( aComponent==PARAM_COMPONENT ) - { - if( aRes.length() > 0 ) - aRes += ", "; - aRes += aName; - } + aDeps.push_back( aName ); } } - return CORBA::string_dup( aRes.c_str() ); + return GenerateList( aDeps ); +} + +SALOME::StringArray* SALOME_Notebook::GetParameters( const char* theParamName ) +{ + return GetObjectParameters( PARAM_COMPONENT.c_str(), theParamName ); } int SALOME_Notebook::GetNewId() @@ -1190,17 +1192,18 @@ void SALOME_Notebook::ParseOldStyleObject( const std::string& theComponent, cons void SALOME_Notebook::RebuildLinks() { printf( "Rebuild links\n" ); -} -SALOME::StringArray* SALOME_Notebook::GetParametersDependingOn( const char* theParamName ) -{ - std::list aParamsDeps; - std::list aDeps = GetAllDependingOn( GetKey( theParamName ) ); - std::list::const_iterator it = aDeps.begin(), last = aDeps.end(); - std::string aName; + std::list aNewEntriesToRebuild; + std::list::const_iterator it = myEntriesToRebuild.begin(), last = myEntriesToRebuild.end(); for( ; it!=last; it++ ) - if( GetComponent( *it, aName ) == PARAM_COMPONENT ) - aParamsDeps.push_back( aName ); + { + /*SALOMEDS::SObject_var anObj = myStudy->FindObjectID( *it ); + if( !CORBA::is_nil( anObj ) ) + { + SALOMEDS::GenericAttribute anAttr; + } + aNewEntriesToRebuild.push_back( *it );*/ + } - return GenerateList( aParamsDeps ); + myEntriesToRebuild = aNewEntriesToRebuild; } diff --git a/src/Notebook/SALOME_Notebook.hxx b/src/Notebook/SALOME_Notebook.hxx index 203117b62..7d7f1f46f 100644 --- a/src/Notebook/SALOME_Notebook.hxx +++ b/src/Notebook/SALOME_Notebook.hxx @@ -76,8 +76,8 @@ public: virtual CORBA::Boolean Load( const char* theFileName ); virtual char* DumpPython(); virtual char* Dump(); - virtual char* GetParameters( const char* theComponent, const char* theEntry ); - virtual SALOME::StringArray* GetParametersDependingOn( const char* theParamName ); + virtual SALOME::StringArray* GetObjectParameters( const char* theComponent, const char* theEntry ); + virtual SALOME::StringArray* GetParameters( const char* theParamName ); SALOME_Parameter* GetParameterPtr( const char* theParamName ) const; void UpdateAnonymous( const std::string& theOldName, const std::string& theNewName ); -- 2.39.2