X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_Hypothesis_i.cxx;h=4da301ebb395318b9425fc1c672e1a64c9c3688a;hb=63eaf4f39688cc3646ca786493a6fc460c9bf7b0;hp=63eb164091fb88698105298e74882947c543ca26;hpb=26da39d104849bfd835548df8f02d2445f4f972a;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx index 63eb164..4da301e 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx @@ -534,3 +534,51 @@ std::string NETGENPlugin_Hypothesis_i::getMethodOfParameter(const int paramIndex } return ""; } + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +NETGENPlugin_Hypothesis_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + typedef ::NETGENPlugin_Hypothesis THyp; + + const THyp* h = static_cast< ::NETGENPlugin_Hypothesis* >( myBaseImpl ); + const THyp::TLocalSize& ls = h->GetLocalSizesAndEntries(); + + THyp::TLocalSize::const_iterator entry2size = ls.cbegin(); + for ( ; entry2size != ls.cend(); ++entry2size ) + entryArray.push_back( entry2size->first ); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +NETGENPlugin_Hypothesis_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + typedef ::NETGENPlugin_Hypothesis THyp; + + const THyp* h = static_cast< ::NETGENPlugin_Hypothesis* >( myBaseImpl ); + + THyp::TLocalSize& lsNew = const_cast< THyp::TLocalSize& >( h->GetLocalSizesAndEntries() ); + THyp::TLocalSize ls; + lsNew.swap( ls ); + + THyp::TLocalSize::const_iterator entry2size = ls.cbegin(); + for ( int i = 0; entry2size != ls.cend(); ++entry2size, ++i ) + if ( !entryArray[ i ].empty() ) + lsNew[ entryArray[ i ]] = entry2size->second; + + return true; +}