From e22da282b1926feedcf24509cc85b97659ac9099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 10 Sep 2009 13:26:35 +0000 Subject: [PATCH] Added Pluginfunctions to get and set encoded views git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7041 383ad7c9-94d9-4d36-a494-682f7c89f535 --- BasePlugin/PluginFunctions.cc | 35 +++++++++++++++++++++++++++++++++++ BasePlugin/PluginFunctions.hh | 16 ++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/BasePlugin/PluginFunctions.cc b/BasePlugin/PluginFunctions.cc index 4df2a9e1..7e623ab8 100644 --- a/BasePlugin/PluginFunctions.cc +++ b/BasePlugin/PluginFunctions.cc @@ -145,6 +145,41 @@ unsigned int activeExaminer( ) { return activeExaminer_; } +QString getEncodedExaminerView() { + return getEncodedExaminerView(activeExaminer()); +} + +/// Get the encoded view for the given +QString getEncodedExaminerView(int _viewerId) { + + QString view; + + if ( _viewerId < 0 || _viewerId >= (int)examiner_widgets_.size() ) { + std::cerr << "Requested unknown viewer with id : " << _viewerId << std::endl; + examiner_widgets_[activeExaminer()]->encodeView ( view ); + return view; + } + + examiner_widgets_[_viewerId]->encodeView ( view ); + return view; + +} + +void setEncodedExaminerView( QString _view ) { + setEncodedExaminerView( activeExaminer() , _view ); +} + +void setEncodedExaminerView(int _viewerId , QString _view ) { + + if ( _viewerId < 0 || _viewerId >= (int)examiner_widgets_.size() ) { + std::cerr << "Requested unknown viewer with id : " << _viewerId << std::endl; + examiner_widgets_[activeExaminer()]->decodeView ( _view ); + } + + examiner_widgets_[_viewerId]->decodeView ( _view ); +} + + void setRootNode( SeparatorNode* _root_node ) { PluginFunctions::root_node_ = _root_node; } diff --git a/BasePlugin/PluginFunctions.hh b/BasePlugin/PluginFunctions.hh index 0cdd07ca..f3d5c353 100644 --- a/BasePlugin/PluginFunctions.hh +++ b/BasePlugin/PluginFunctions.hh @@ -197,6 +197,22 @@ void setActiveExaminer( const unsigned int _id ); DLLEXPORT unsigned int activeExaminer(); +/// Get the encoded view for the active examiner +DLLEXPORT +QString getEncodedExaminerView(); + +/// Get the encoded view for the given +DLLEXPORT +QString getEncodedExaminerView(int _viewerId); + +/// Set the encoded view for the active examiner +DLLEXPORT +void setEncodedExaminerView( QString _view ); + +/// Set the encoded view for the given +DLLEXPORT +void setEncodedExaminerView(int _viewerId , QString _view ); + /** * Set center of scene */ -- GitLab