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
Etienne Schmitt
CGoGN
Commits
fa14c26f
Commit
fa14c26f
authored
Mar 11, 2013
by
Sylvain Thery
Browse files
update QGLViewer usage in simple application
parent
2c6c911f
Changes
3
Show whitespace changes
Inline
Side-by-side
include/Utils/Qt/qtQGLV.h
View file @
fa14c26f
...
...
@@ -195,14 +195,17 @@ public:
*/
void
setParamObject
(
float
width
,
float
*
pos
)
{
m_qglWidget
->
setParamObject
(
width
,
pos
);
}
/**
* set BB min & max corner of object to draw
*/
void
setObjectBB
(
float
*
bbmin
,
float
*
bbmax
)
{
m_qglWidget
->
setObjectBB
(
bbmin
,
bbmax
);
}
/**
* @brief get pointer on QGLViewer widget for direct access
* @return
*/
QGLViewer
*
getQGLWidget
()
{
return
static_cast
<
QGLViewer
*>
(
m_qglWidget
);
}
// void resetCenterOfRotation(float width, float* pos) { m_qglWidget->resetCenterOfRotation(width, pos); }
/**
* make the contex of glWidget current
*/
...
...
include/Utils/Qt/qtQGLV_glw.h
View file @
fa14c26f
...
...
@@ -65,6 +65,7 @@ public:
QGLView
(
SimpleQGLV
*
ptr
,
QWidget
*
parent
=
0
);
~
QGLView
();
void
setObjectBB
(
float
*
bbmin
,
float
*
bbmax
);
void
setParamObject
(
float
width
,
float
*
pos
);
void
glMousePosition
(
int
&
x
,
int
&
y
);
...
...
src/Utils/Qt/qtQGLV_glw.cpp
View file @
fa14c26f
...
...
@@ -57,8 +57,14 @@ void QGLView::setParamObject(float width, float* pos)
qglviewer
::
Vec
bbMax
(
pos
[
0
]
+
width
/
2.0
f
,
pos
[
1
]
+
width
/
2.0
f
,
pos
[
2
]
+
width
/
2.0
f
);
camera
()
->
setSceneBoundingBox
(
bbMin
,
bbMax
);
camera
()
->
showEntireScene
();
}
std
::
cout
<<
"w p = "
<<
width
<<
" / "
<<
pos
[
0
]
<<
" , "
<<
pos
[
1
]
<<
" , "
<<
pos
[
2
]
<<
std
::
endl
;
void
QGLView
::
setObjectBB
(
float
*
bbmin
,
float
*
bbmax
)
{
qglviewer
::
Vec
bbMin
(
bbmin
[
0
],
bbmin
[
1
],
bbmin
[
2
]);
qglviewer
::
Vec
bbMax
(
bbmax
[
0
],
bbmax
[
1
],
bbmax
[
2
]);
camera
()
->
setSceneBoundingBox
(
bbMin
,
bbMax
);
camera
()
->
showEntireScene
();
}
QSize
QGLView
::
minimumSizeHint
()
const
...
...
@@ -76,11 +82,6 @@ void QGLView::init()
glewInit
();
if
(
m_sqgl
)
m_sqgl
->
cb_initGL
();
qglviewer
::
Vec
bbMin
(
0.0
,
0.0
,
0.0
);
qglviewer
::
Vec
bbMax
(
2.0
,
2.0
,
2.0
);
camera
()
->
setSceneBoundingBox
(
bbMin
,
bbMax
);
camera
()
->
showEntireScene
();
}
void
QGLView
::
preDraw
()
...
...
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