LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ObjListCanvas.cxx
Go to the documentation of this file.
1 
14 
15 #include "TCanvas.h"
16 #include "TGFrame.h"
17 #include "TGLayout.h"
18 // #include "TRootEmbeddedCanvas.h"
19 
20 #include <iostream>
21 #include <string>
22 
23 namespace evdb{
24 
25  //......................................................................
26 
31  {
32  TGDimension sz; // Size of the main frame
33 
34  sz = mf->GetSize();
35  fXsize = sz.fWidth - 10; // Leave small margin on left and right
36  fYsize = sz.fHeight - 58; // Leave small margin on top and bottom
37  fAspectRatio = (float)fYsize/(float)fXsize;
38 
39  // This frame is apparently for holding the buttons on the top; it's
40  // not used for anything else.
41  fFrame = new TGCompositeFrame(mf, 60, 60, kHorizontalFrame);
42 
43  // Define a layout for placing the canvas within the frame.
44  fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |
45  kLHintsExpandY, 5, 5, 5, 5);
46 
47  // Careful about clashes with root's naming of canvases. Make a name
48  // like "tpcEVDCanvas" using the print tag
49  std::string name(this->PrintTag());
50  name += "evdb::ObjListCanvas";
51 
52  /*
53  // Create the embedded canvas within the main ROOT graphics frame.
54  fEmbCanvas = new TRootEmbeddedCanvas(name.c_str(), mf, fXsize, fYsize,
55  kSunkenFrame, 0);
56  mf->AddFrame(fEmbCanvas, fLayout);
57  */
58  mf->AddFrame(fFrame);
59 
60  // Extract the graphical Canvas from the embedded canvas. The user
61  // will do most of their drawing in this.
62  // fCanvas = fEmbCanvas->GetCanvas();
63 
64  // this->Update();
65  }
66 
67  //......................................................................
68 
70  {
71  // Make connections for drawing and printing
72  // IoModule::Instance()->Connect("NewEvent()",
73  // "evdb::ObjListCanvas",this,"Draw()");
75  }
76 
77  //......................................................................
78 
80  {
81  // IoModule::Instance()->Disconnect(0,this,0);
82  // delete fEmbCanvas;
83  delete fLayout;
84  delete fFrame;
85  }
86 
87  //......................................................................
88 
89  void ObjListCanvas::Print(const char* /*f*/) { /*fCanvas->Print(f);*/ }
90 
91 }//namespace
93 
unsigned short fYsize
Size of the canvas;.
Definition: ObjListCanvas.h:47
float fAspectRatio
fYsize/fXsize
Definition: ObjListCanvas.h:48
TGLayoutHints * fLayout
Layout hints for frame.
Definition: ObjListCanvas.h:42
void Connect()
Make signal/slot connections.
Manage all things related to colors for the event display.
ObjListCanvas(TGMainFrame *mf)
virtual const char * Description() const
Definition: ObjListCanvas.h:35
virtual const char * PrintTag() const
Definition: ObjListCanvas.h:34
virtual void Print(const char *f)
Base class for displaying lists of objects (eg, MC truth, reco, etc.)
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
Definition: Printable.cxx:29
unsigned short fXsize
Size of the canvas;.
Definition: ObjListCanvas.h:46
TGCompositeFrame * fFrame
Graphics frame.
Definition: ObjListCanvas.h:41