Commit 5f152739 authored by nkx Nicholas's avatar nkx Nicholas
Browse files

TRestEventViewer: added method Embed()

parent fac40c85
......@@ -33,14 +33,16 @@ class TRestBrowser;
class TRestEventViewer {
protected:
TGeoManager* fGeometry = 0; //!
TRestEvent* fEvent = 0; //!
TRestEvent* fEvent = 0; //!
TPad* fPad = 0;
TCanvas* fCanvas = 0;
public:
virtual void Initialize();
public:
virtual void Embed(TBrowser* b);
virtual void AddEvent(TRestEvent* ev);
virtual void Plot(const char* option);
......
......@@ -82,9 +82,9 @@ void TRestBrowser::SetViewer(TRestEventViewer* eV) {
}
if (eV != NULL) {
fEventViewer = eV;
b->StartEmbedding(1, -1);
eV->Initialize();
b->StopEmbedding();
//b->StartEmbedding(1, -1);
eV->Embed(b);
//b->StopEmbedding();
}
}
......
......@@ -23,7 +23,9 @@ ClassImp(TRestEventViewer)
//______________________________________________________________________________
TRestEventViewer::TRestEventViewer() {
// TRestEventViewer default constructor
Initialize();
//Initialize();
fPad = NULL;
fCanvas = NULL;
}
//______________________________________________________________________________
......@@ -34,17 +36,23 @@ TRestEventViewer::~TRestEventViewer() {
void TRestEventViewer::Initialize() {
fPad = NULL;
if (fCanvas != NULL) delete fCanvas;
fCanvas = new TCanvas("Event Viewer", "Event Viewer");
fCanvas->SetWindowPosition(350, 10);
}
void TRestEventViewer::AddEvent(TRestEvent* ev) {
fEvent = ev;
void TRestEventViewer::Embed(TBrowser* b) {
if (b != NULL) b->StartEmbedding(1, -1);
Initialize();
if (b != NULL) b->StopEmbedding();
}
void TRestEventViewer::AddEvent(TRestEvent* ev) { fEvent = ev; }
void TRestEventViewer::Plot(const char* option) {
if (fPad == NULL) fPad = new TPad();
if (fEvent != NULL) {
......
Supports Markdown
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