Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
d13f94c0
Commit
d13f94c0
authored
Feb 16, 2015
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps : toggle automatic snapshots using the 'S' key
parent
7c660fcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
SCHNApps/include/view.h
SCHNApps/include/view.h
+2
-0
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+26
-6
No files found.
SCHNApps/include/view.h
View file @
d13f94c0
...
...
@@ -160,6 +160,8 @@ protected:
Utils
::
Texture
<
2
,
Geom
::
Vec3uc
>*
m_textureWallpaper
;
Utils
::
ShaderWallPaper
*
m_shaderWallpaper
;
bool
b_saveSnapshots
;
};
}
// namespace SCHNApps
...
...
SCHNApps/src/view.cpp
View file @
d13f94c0
...
...
@@ -21,7 +21,7 @@ namespace SCHNApps
{
unsigned
int
View
::
viewCount
=
0
;
View
::
View
(
const
QString
&
name
,
SCHNApps
*
s
,
QGLFormat
&
format
)
:
View
::
View
(
const
QString
&
name
,
SCHNApps
*
s
,
QGLFormat
&
format
)
:
QGLViewer
(
format
,
NULL
,
NULL
),
b_updatingUI
(
false
),
m_name
(
name
),
...
...
@@ -41,10 +41,15 @@ View::View(const QString& name, SCHNApps* s, QGLFormat& format) :
m_dialogCameras
(
NULL
),
m_frameDrawer
(
NULL
),
m_textureWallpaper
(
NULL
),
m_shaderWallpaper
(
NULL
)
m_shaderWallpaper
(
NULL
),
b_saveSnapshots
(
false
)
{
++
viewCount
;
setSnapshotFormat
(
"JPEG"
);
setSnapshotFileName
(
m_name
);
setSnapshotQuality
(
95
);
m_currentCamera
=
m_schnapps
->
addCamera
();
m_currentCamera
->
linkView
(
this
);
...
...
@@ -80,7 +85,7 @@ View::View(const QString& name, SCHNApps* s, QGLFormat& format) :
m_dialogCameras
->
check
(
m_currentCamera
->
getName
(),
Qt
::
Checked
);
}
View
::
View
(
const
QString
&
name
,
SCHNApps
*
s
,
QGLFormat
&
format
,
const
QGLWidget
*
shareWidget
)
:
View
::
View
(
const
QString
&
name
,
SCHNApps
*
s
,
QGLFormat
&
format
,
const
QGLWidget
*
shareWidget
)
:
QGLViewer
(
format
,
NULL
,
shareWidget
),
b_updatingUI
(
false
),
m_name
(
name
),
...
...
@@ -104,6 +109,10 @@ View::View(const QString& name, SCHNApps* s, QGLFormat& format, const QGLWidget
{
++
viewCount
;
setSnapshotFormat
(
"JPEG"
);
setSnapshotFileName
(
m_name
);
setSnapshotQuality
(
95
);
m_currentCamera
=
m_schnapps
->
addCamera
();
m_currentCamera
->
linkView
(
this
);
...
...
@@ -545,9 +554,20 @@ void View::drawFrame()
void
View
::
keyPressEvent
(
QKeyEvent
*
event
)
{
foreach
(
PluginInteraction
*
plugin
,
l_plugins
)
plugin
->
keyPress
(
this
,
event
);
QGLViewer
::
keyPressEvent
(
event
);
if
(
event
->
key
()
==
Qt
::
Key_S
)
{
b_saveSnapshots
=
!
b_saveSnapshots
;
if
(
b_saveSnapshots
)
connect
(
this
,
SIGNAL
(
drawFinished
(
bool
)),
this
,
SLOT
(
saveSnapshot
(
bool
)));
else
disconnect
(
this
,
SIGNAL
(
drawFinished
(
bool
)),
this
,
SLOT
(
saveSnapshot
(
bool
)));
}
else
{
foreach
(
PluginInteraction
*
plugin
,
l_plugins
)
plugin
->
keyPress
(
this
,
event
);
QGLViewer
::
keyPressEvent
(
event
);
}
}
void
View
::
keyReleaseEvent
(
QKeyEvent
*
event
)
...
...
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