diff --git a/BasePlugin/PluginFunctions.cc b/BasePlugin/PluginFunctions.cc index 7e623ab836190ea994061f1dddbfb69ab1a011aa..9b44aa49d0a1b7646d185f3d4bb187945d540727 100644 --- a/BasePlugin/PluginFunctions.cc +++ b/BasePlugin/PluginFunctions.cc @@ -606,6 +606,19 @@ double sceneRadius() { return examiner_widgets_[activeExaminer_]->scene_radius(); } +double sceneRadius( int _viewer ) { + if ( _viewer == ACTIVE_VIEWER ) { + return examiner_widgets_[activeExaminer_]->scene_radius(); + } else if ( _viewer == ALL_VIEWERS ) + std::cerr << "Illegal request for scene radius. Please select one viewer!" << std::endl; + else if ( ( _viewer >= 0 ) && _viewer < (int)examiner_widgets_.size() ) + return examiner_widgets_[_viewer]->scene_radius(); + else + std::cerr << "Requested illegal viewer for translate!!" << std::endl; + + return -1; +} + void translate( const ACG::Vec3d &_vector , int _viewer ) { if ( _viewer == ACTIVE_VIEWER ) { examiner_widgets_[activeExaminer_]->translate(_vector); diff --git a/BasePlugin/PluginFunctionsViewControls.hh b/BasePlugin/PluginFunctionsViewControls.hh index 88fc792c24e29e529cf6c2b2d778851eece43119..5b157e87ab54f49dce3909a85e6fdb75c699284c 100644 --- a/BasePlugin/PluginFunctionsViewControls.hh +++ b/BasePlugin/PluginFunctionsViewControls.hh @@ -169,13 +169,21 @@ void setScenePos(const ACG::Vec3d& _center , int _viewer = ALL_VIEWERS); DLLEXPORT const ACG::Vec3d& sceneCenter( int _viewer = ALL_VIEWERS ); -/** \brief Returns the current scene radius from the examiner widget +/** \brief Returns the current scene radius from the active examiner widget * * Returns the Radius of the scene */ DLLEXPORT double sceneRadius(); +DLLEXPORT +/** \brief Returns the current scene radius from a given examiner viewer +* +* Returns the Radius of the scene +* @param _viewer Give the viewer which should be asked for its current scene radius +*/ +double sceneRadius( int _viewer ); + /** \brief Translate viewer pos by given vector * * Translates the scene by a given vector. ( This is only a view transformation and does not