Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frédéric Larue
CommonGUI
Commits
0722433f
Commit
0722433f
authored
Mar 17, 2019
by
Frédéric Larue
Browse files
The update of transformation matrices is now forced when pushing/popping navigation controls.
parent
727417aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
GLViewer/GLViewer.cpp
View file @
0722433f
...
...
@@ -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
;
...
...
GLViewer/GLViewer.h
View file @
0722433f
...
...
@@ -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
()
)
pop
NavigationControl
();
}
void
pushNavigationControl
(
NavigationControl
*
ctrl
)
;
void
popNavigationControl
();
void
clear
NavigationControl
Stack
();
inline
QVector2D
screenPosToClipCoord
(
const
QPoint
&
screenPos
)
{
return
QVector2D
(
2.0
f
*
screenPos
.
x
()
/
width
()
-
1.0
f
,
1.0
f
-
2.0
f
*
screenPos
.
y
()
/
height
()
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment