diff --git a/BasePlugin/PluginFunctions.cc b/BasePlugin/PluginFunctions.cc index 0b0c9f65b80332bbb43a372ac77684b8d67c615c..757db93f39fb8065b8205ab73f1f04294c7035ed 100644 --- a/BasePlugin/PluginFunctions.cc +++ b/BasePlugin/PluginFunctions.cc @@ -851,6 +851,22 @@ ACG::Vec3d upVector(int _viewer) { return viewerProperties().glState().up(); } +/** \brief Get field of view angle + */ +DLLEXPORT +double fovy(int _viewer) { + if ( _viewer == ACTIVE_VIEWER ) { + return viewerProperties(activeExaminer_).glState().fovy(); + } else if ( _viewer == ALL_VIEWERS ) + std::cerr << "Please select viewer to get fovy!" << std::endl; + else if ( ( _viewer >= 0 ) && _viewer < (int)examiner_widgets_.size() ) + return viewerProperties(_viewer).glState().fovy(); + else + std::cerr << "Requested illegal viewer for fovy!!" << std::endl; + + return viewerProperties().glState().fovy(); +} + void setViewObjectMarker(ViewObjectMarker * _marker) { for ( uint i = 0 ; i < examiner_widgets_.size(); ++i ) diff --git a/BasePlugin/PluginFunctionsViewControls.hh b/BasePlugin/PluginFunctionsViewControls.hh index 9d30184d1f3cbcc2de064904b0b1720de53f38fe..119fcce242fbc1fbd7d933f8d2db50b6eb7ea2ed 100644 --- a/BasePlugin/PluginFunctionsViewControls.hh +++ b/BasePlugin/PluginFunctionsViewControls.hh @@ -330,6 +330,11 @@ void orthographicProjection( int _viewer = ALL_VIEWERS ); DLLEXPORT void setFOVY( double _fovy ); +/** \brief Get field of view angle + */ +DLLEXPORT +double fovy(int _viewer = ACTIVE_VIEWER); + /** \brief Switch to perspective Projection * * @param _viewer Id of the viewer to use.