Commit e6378134 authored by Robin Eschbach's avatar Robin Eschbach
Browse files

[REMOVE #474] automatic setting of center as it has unwanted side effects

parent c82929f7
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "WGraphicsEngine.h" #include "WGraphicsEngine.h"
WGEZoomTrackballManipulator::WGEZoomTrackballManipulator(): WGEZoomTrackballManipulator::WGEZoomTrackballManipulator():
TrackballManipulator(), TrackballManipulator( 0x02 ),
m_zoom( 1.0 ), m_zoom( 1.0 ),
m_allowThrow( false ), m_allowThrow( false ),
m_paintMode( 0 ) m_paintMode( 0 )
...@@ -161,18 +161,6 @@ bool WGEZoomTrackballManipulator::handle( const osgGA::GUIEventAdapter& ea, osgG ...@@ -161,18 +161,6 @@ bool WGEZoomTrackballManipulator::handle( const osgGA::GUIEventAdapter& ea, osgG
} }
} }
void WGEZoomTrackballManipulator::computeHomePosition( const osg::Camera *camera, bool )
{
TrackballManipulator::computeHomePosition( camera, true );
osg::Vec3d homeEye;
osg::Vec3d homeCenter;
osg::Vec3d homeUp;
TrackballManipulator::getHomePosition( homeEye, homeCenter, homeUp );
TrackballManipulator::setCenter( homeCenter );
}
void WGEZoomTrackballManipulator::setPaintMode( int mode ) void WGEZoomTrackballManipulator::setPaintMode( int mode )
{ {
m_paintMode = mode; m_paintMode = mode;
......
...@@ -83,13 +83,6 @@ public: ...@@ -83,13 +83,6 @@ public:
*/ */
virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
/**
* Overloading the function to always use the bounding box and not the bounding spehere.
* \param camera The camera of the viewer.
* \param useBoundingBox This one is irrelevant as its value is ignored.
*/
virtual void computeHomePosition( const osg::Camera *camera = NULL, bool useBoundingBox = true );
/** /**
* Get zoom factor. * Get zoom factor.
* *
......
...@@ -47,10 +47,6 @@ void WGENodeMaskCallback::activate() ...@@ -47,10 +47,6 @@ void WGENodeMaskCallback::activate()
if( m_flag->get() ) // only handle activation here if( m_flag->get() ) // only handle activation here
{ {
m_reactivateSignal(); m_reactivateSignal();
// Update the home position
WGEViewer::SPtr viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewer();
viewer->getCameraManipulator()->computeHomePosition( viewer->getCamera() );
} }
} }
...@@ -64,10 +60,6 @@ void WGENodeMaskCallback::operator()( osg::Node* node, osg::NodeVisitor* nv ) ...@@ -64,10 +60,6 @@ void WGENodeMaskCallback::operator()( osg::Node* node, osg::NodeVisitor* nv )
// NOTE: this also deactivates the callback. So reactivating the node is done in a separate method // NOTE: this also deactivates the callback. So reactivating the node is done in a separate method
// connect the flag's callback to the signal, only this way, we can ensure the reactivation of a node without saving a pointer to it. // connect the flag's callback to the signal, only this way, we can ensure the reactivation of a node without saving a pointer to it.
m_reactivateConnection = m_reactivateSignal.connect( boost::bind( &osg::Node::setNodeMask, node, 0xFFFFFFFF ) ); m_reactivateConnection = m_reactivateSignal.connect( boost::bind( &osg::Node::setNodeMask, node, 0xFFFFFFFF ) );
// Update the home position
WGEViewer::SPtr viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewer();
viewer->getCameraManipulator()->computeHomePosition( viewer->getCamera() );
} }
traverse( node, nv ); traverse( node, nv );
......
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