Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gepetto-viewer-corba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gepetto
gepetto-viewer-corba
Commits
bff654a0
Commit
bff654a0
authored
10 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add screen capture functionality
parent
5f7dabe6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
idl/gepetto/viewer/graphical-interface.idl
+15
-0
15 additions, 0 deletions
idl/gepetto/viewer/graphical-interface.idl
src/graphical-interface.impl.cpp
+41
-0
41 additions, 0 deletions
src/graphical-interface.impl.cpp
src/graphical-interface.impl.hh
+3
-0
3 additions, 0 deletions
src/graphical-interface.impl.hh
with
59 additions
and
0 deletions
idl/gepetto/viewer/graphical-interface.idl
+
15
−
0
View file @
bff654a0
...
...
@@ -208,6 +208,21 @@ typedef double Color [4];
/// \param input nodeName : name of the node.
/// \param input lightingMode : lighting mode can be "ON" or "OFF".
boolean setLightingMode(in string nodeName, in string lightingMode) raises (Error);
/// Start capturing a window into image files.
/// \param windowId the ID of the window
/// \param filename, extension image files will be
/// '
<
filename
>
_
<
sequence_number
>.
<
extension
>
'
///
/// \note To make a movie from the sequence of images, you can run:
/// \code
/// ffmpeg -r 25 -b 1800 -i capture_0_%d.jpeg video.mp4
/// \endcode
boolean startCapture (in unsigned long windowId, in string filename,
in string extension) raises (Error);
/// Stop the running capture of a window.
boolean stopCapture (in unsigned long windowId) raises (Error);
};
};
};
This diff is collapsed.
Click to expand it.
src/graphical-interface.impl.cpp
+
41
−
0
View file @
bff654a0
...
...
@@ -200,6 +200,9 @@ namespace graphics {
it
!=
newNodeConfigurations_
.
end
();
it
++
)
{
(
*
it
).
node
->
applyConfiguration
(
(
*
it
).
position
,
(
*
it
).
quat
);
}
for
(
WindowManagers_t
::
iterator
it
=
windowManagers_
.
begin
();
it
!=
windowManagers_
.
end
();
++
it
)
(
*
it
)
->
frame
();
mtx_
.
unlock
();
newNodeConfigurations_
.
clear
();
}
catch
(
const
std
::
exception
&
exc
)
{
...
...
@@ -803,6 +806,44 @@ namespace graphics {
throw
Error
(
exc
.
what
());
}
}
bool
GraphicalInterface
::
startCapture
(
const
WindowID
windowId
,
const
char
*
filename
,
const
char
*
extension
)
throw
(
Error
)
{
try
{
if
(
windowId
>=
0
||
windowId
<
windowManagers_
.
size
())
{
windowManagers_
[
windowId
]
->
startCapture
(
std
::
string
(
filename
),
std
::
string
(
extension
));
return
true
;
}
else
{
std
::
cout
<<
"Window ID "
<<
windowId
<<
" doesn't exist."
<<
std
::
endl
;
return
false
;
}
}
catch
(
const
std
::
exception
&
exc
)
{
throw
Error
(
exc
.
what
());
}
}
bool
GraphicalInterface
::
stopCapture
(
const
WindowID
windowId
)
throw
(
Error
)
{
try
{
if
(
windowId
>=
0
||
windowId
<
windowManagers_
.
size
())
{
windowManagers_
[
windowId
]
->
stopCapture
();
return
true
;
}
else
{
std
::
cout
<<
"Window ID "
<<
windowId
<<
" doesn't exist."
<<
std
::
endl
;
return
false
;
}
}
catch
(
const
std
::
exception
&
exc
)
{
throw
Error
(
exc
.
what
());
}
}
}
//end namespace impl
}
//end namespace corbaServer
}
//end namespace graphics
This diff is collapsed.
Click to expand it.
src/graphical-interface.impl.hh
+
3
−
0
View file @
bff654a0
...
...
@@ -133,6 +133,9 @@ public:
virtual
bool
setWireFrameMode
(
const
char
*
nodeNameCorba
,
const
char
*
wireFrameModeCorba
)
throw
(
Error
);
virtual
bool
setLightingMode
(
const
char
*
nodeNameCorba
,
const
char
*
lightingModeCorba
)
throw
(
Error
);
virtual
bool
startCapture
(
const
WindowID
windowId
,
const
char
*
filename
,
const
char
*
extension
)
throw
(
Error
);
virtual
bool
stopCapture
(
const
WindowID
windowId
)
throw
(
Error
);
};
// end of class
}
/* namespace impl */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment