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
Eoin Clerkin
cbmroot_geometry
Commits
a2d93df0
Commit
a2d93df0
authored
Nov 24, 2020
by
Norbert Herrmann
Browse files
add camera handling tools
parent
c4eccbc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
macro/beamtime/camera_restore.C
0 → 100755
View file @
a2d93df0
/*
void camera_restore(const char* fname, int mode = 0)
{
TEveManager::Create();
writeCurrentCamera(fname);
}
*/
void
writeCurrentCamera
(
const
char
*
fname
)
{
TGLCamera
&
c
=
gEve
->
GetDefaultGLViewer
()
->
CurrentCamera
();
TFile
*
f
=
TFile
::
Open
(
fname
,
"RECREATE"
);
c
.
Write
();
f
->
Close
();
}
void
readCurrentCamera
(
const
char
*
fname
)
{
TGLCamera
&
c
=
gEve
->
GetDefaultGLViewer
()
->
CurrentCamera
();
TFile
*
f
=
TFile
::
Open
(
fname
,
"READ"
);
if
(
!
f
)
return
;
if
(
f
->
GetKey
(
c
.
ClassName
()))
{
f
->
GetKey
(
c
.
ClassName
())
->
Read
(
&
c
);
c
.
IncTimeStamp
();
gEve
->
GetDefaultGLViewer
()
->
RequestDraw
();
}
}
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