Commit a2d93df0 authored by Norbert Herrmann's avatar Norbert Herrmann
Browse files

add camera handling tools

parent c4eccbc2
/*
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();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment