Commit 0722433f authored by Frédéric Larue's avatar Frédéric Larue

The update of transformation matrices is now forced when pushing/popping navigation controls.

parent 727417aa
......@@ -253,6 +253,39 @@ void GLViewer::init( DisplayDoF dof )
}
void GLViewer::pushNavigationControl( NavigationControl* ctrl )
{
assert( ctrl != NULL );
m_NavigationCtrl.push_front(ctrl);
m_MustUpdateFocal = true;
m_MustUpdateViewMatrix = true;
update();
}
void GLViewer::popNavigationControl()
{
if( !m_NavigationCtrl.empty() )
{
delete m_NavigationCtrl.front();
m_NavigationCtrl.pop_front();
m_MustUpdateFocal = true;
m_MustUpdateViewMatrix = true;
update();
}
}
void GLViewer::clearNavigationControlStack()
{
while( !m_NavigationCtrl.empty() )
{
delete m_NavigationCtrl.front();
m_NavigationCtrl.pop_front();
}
}
void GLViewer::setRenderState( const RenderState& state )
{
m_View = state;
......
......@@ -255,9 +255,9 @@ public:
void setRenderState( const RenderState& state );
inline NavigationControl* navigationControl() const { return m_NavigationCtrl.empty()? NULL : m_NavigationCtrl.front(); }
inline void pushNavigationControl( NavigationControl* ctrl ) { m_NavigationCtrl.push_front(ctrl); }
inline void popNavigationControl() { if( !m_NavigationCtrl.empty() ) { delete m_NavigationCtrl.front(); m_NavigationCtrl.pop_front(); } }
inline void clearNavigationControlStack() { while( !m_NavigationCtrl.empty() ) popNavigationControl(); }
void pushNavigationControl( NavigationControl* ctrl );
void popNavigationControl();
void clearNavigationControlStack();
inline QVector2D screenPosToClipCoord( const QPoint &screenPos ) { return QVector2D( 2.0f*screenPos.x()/width()-1.0f, 1.0f-2.0f*screenPos.y()/height() ); }
......
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