Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CGoGN
CGoGN
Commits
2effd50f
Commit
2effd50f
authored
Nov 09, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add resetCenterOfRotation in SimpleQT
parent
7de7491c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
include/Utils/Qt/qtSimple.h
include/Utils/Qt/qtSimple.h
+2
-0
include/Utils/Qt/qtgl.h
include/Utils/Qt/qtgl.h
+2
-0
src/Utils/Qt/qtgl.cpp
src/Utils/Qt/qtgl.cpp
+15
-0
No files found.
include/Utils/Qt/qtSimple.h
View file @
2effd50f
...
...
@@ -197,6 +197,8 @@ public:
*/
void
setParamObject
(
float
width
,
float
*
pos
)
{
m_glWidget
->
setParamObject
(
width
,
pos
);
}
void
resetCenterOfRotation
(
float
width
,
float
*
pos
)
{
m_glWidget
->
resetCenterOfRotation
(
width
,
pos
);
}
/**
* make the contex of glWidget current
*/
...
...
include/Utils/Qt/qtgl.h
View file @
2effd50f
...
...
@@ -106,6 +106,8 @@ protected:
void
changeCenterOfRotation
(
const
glm
::
vec3
&
newCenter
);
public:
void
resetCenterOfRotation
(
float
width
,
float
*
pos
);
void
setParamObject
(
float
width
,
float
*
pos
);
void
setRotation
(
bool
b
);
...
...
src/Utils/Qt/qtgl.cpp
View file @
2effd50f
...
...
@@ -71,6 +71,21 @@ void GLWidget::setParamObject(float width, float* pos)
m_obj_pos
=
glm
::
vec3
(
-
pos
[
0
],
-
pos
[
1
],
-
pos
[
2
]);
}
void
GLWidget
::
resetCenterOfRotation
(
float
width
,
float
*
pos
)
{
m_cbs
->
trans_x
()
=
0.
;
m_cbs
->
trans_y
()
=
0.
;
m_cbs
->
trans_z
()
=
-
FAR_PLANE
/
5.0
f
;
// float Z[3] = { 0.0f, 0.0f, 1.0f };
// axis_to_quat(Z, 0.0f, m_cbs->curquat());
setParamObject
(
width
,
pos
);
recalcModelView
();
}
void
GLWidget
::
setRotation
(
bool
b
)
{
allow_rotation
=
b
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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