Commit ab56b8d5 authored by Alexander Wiebel's avatar Alexander Wiebel

[ADD] option to allow for auto-rotation thing in graphics viewers called "throwing"

parent 8c327e00
......@@ -11,4 +11,5 @@
# [ge] # Settings for the graphics engine
# bgColor.r = .9 # background color (red part)
# bgColor.g = .9 # background color (green part)
# bgColor.b = .9 # background color (blue part)
\ No newline at end of file
# bgColor.b = .9 # background color (blue part)
# zoomTrackballManipulator.allowThrow = yes # allow the auto-rotation thing wenn "throwing" an object with the mouse
......@@ -82,7 +82,6 @@ template< typename T > bool WPreferences::getPreference( std::string prefName, T
boost::program_options::variables_map configuration;
if( wiotools::fileExists( cfgFileName ) )
{
wlog::info( "GUI" ) << "Reading config file: " << cfgFileName;
std::ifstream ifs( cfgFileName.c_str(), std::ifstream::in );
try
......
......@@ -23,6 +23,7 @@
//---------------------------------------------------------------------------
#include "WGEZoomTrackballManipulator.h"
#include "../common/WPreferences.h"
WGEZoomTrackballManipulator::WGEZoomTrackballManipulator():
TrackballManipulator()
......@@ -108,7 +109,11 @@ bool WGEZoomTrackballManipulator::zoom( const osgGA::GUIEventAdapter& ea, osgGA:
bool WGEZoomTrackballManipulator::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us )
{
_thrown = false; // We do not want the auto-rotation thingy.
bool allowThrow;
if( !( WPreferences::getPreference( "ge.zoomTrackballManipulator.allowThrow", &allowThrow ) && allowThrow ) )
{
_thrown = false; // By default we do not want the auto-rotation thingy.
}
if( ea.getEventType() == osgGA::GUIEventAdapter::SCROLL || ea.getKey() == 45 || ea.getKey() == 43 )
{
return zoom( ea, us );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment