#include <Canvas.h>
Inheritance diagram for evdb::Canvas:

Public Member Functions | |
| Canvas (TGMainFrame *mf) | |
| virtual | ~Canvas () |
| virtual void | Draw (const char *opt=0)=0 |
| virtual const char * | PrintTag () const |
| virtual const char * | Description () const |
| virtual void | Print (const char *f) |
| Print the object to a file. | |
| void | Connect () |
| Make signal/slot connections. | |
Protected Attributes | |
| TGCompositeFrame * | fFrame |
| Graphics frame. | |
| TGLayoutHints * | fLayout |
| Layout hints for frame. | |
| TRootEmbeddedCanvas * | fEmbCanvas |
| Embedded canvas. | |
| TCanvas * | fCanvas |
| The ROOT drawing canvas. | |
| unsigned short | fXsize |
| Size of the canvas;. | |
| unsigned short | fYsize |
| Size of the canvas;. | |
| float | fAspectRatio |
| fYsize/fXsize | |
|
|
Perform the basic setup for a drawing canvas Definition at line 23 of file Canvas.cxx. References fAspectRatio, fCanvas, fEmbCanvas, fFrame, fLayout, fXsize, and fYsize.
00024 {
00025 TGDimension sz; // Size of the main frame
00026
00027 sz = mf->GetSize();
00028 fXsize = sz.fWidth - 10; // Leave small margin on left and right
00029 fYsize = sz.fHeight - 58; // Leave small margin on top and bottom
00030 fAspectRatio = (float)fYsize/(float)fXsize;
00031
00032 fFrame = new TGCompositeFrame(mf, 60, 60, kHorizontalFrame);
00033 fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |
00034 kLHintsExpandY, 5, 5, 5, 5);
00035
00036 // Careful about clashes with root's naming of canvases. Make a name
00037 // like "tpcEVDCanvas" using the print tag
00038 std::string name(this->PrintTag());
00039 name += "evdb::Canvas";
00040 fEmbCanvas = new TRootEmbeddedCanvas(name.c_str(), fFrame, fXsize, fYsize,
00041 kSunkenFrame, 0);
00042 fFrame->AddFrame(fEmbCanvas, fLayout);
00043 mf->AddFrame(fFrame);
00044
00045 fCanvas = fEmbCanvas->GetCanvas();
00046 }
|
|
|
Definition at line 60 of file Canvas.cxx. References fEmbCanvas, fFrame, and fLayout.
00061 {
00062 IoModule::Instance()->Disconnect(0,this,0);
00063 delete fEmbCanvas;
00064 delete fLayout;
00065 delete fFrame;
00066 }
|
|
|
Make signal/slot connections.
Definition at line 50 of file Canvas.cxx. Referenced by evdb::DisplayWindow::DisplayWindow().
00051 {
00052 // Make connections for drawing and printing
00053 IoModule::Instance()->Connect("NewEvent()",
00054 "evdb::Canvas",this,"Draw()");
00055 Printable::AddToListOfPrintables(this->Description(),this);
00056 }
|
|
|
Give a medium length description of what the view holds to be printed. Examples: "Full view of experiment", "3D View", ... Reimplemented from evdb::Printable. Reimplemented in evd::DetectorView, evd::PlaneView, testCanvas1, and testCanvas2. Definition at line 34 of file Canvas.h.
00034 {return "sub-class needs description"; }
|
|
|
Implemented in evd::DetectorView, evd::PlaneView, testCanvas1, testCanvas2, and TestDisplay. Referenced by evdb::DisplayWindow::Draw(). |
|
|
Print the object to a file.
Implements evdb::Printable. Definition at line 70 of file Canvas.cxx. References fCanvas.
00070 { fCanvas->Print(f); }
|
|
|
Give a short tag which can be included in filename to ID object printed Keep to ~4 characters Implements evdb::Printable. Reimplemented in evd::DetectorView, evd::PlaneView, testCanvas1, and testCanvas2. Definition at line 33 of file Canvas.h.
00033 {return "sub-class needs print tag"; }
|
|
|
fYsize/fXsize
Definition at line 47 of file Canvas.h. Referenced by Canvas(). |
|
|
The ROOT drawing canvas.
|
|
|
Embedded canvas.
|
|
|
Graphics frame.
|
|
|
Layout hints for frame.
|
|
|
Size of the canvas;.
Definition at line 45 of file Canvas.h. Referenced by Canvas(). |
|
|
Size of the canvas;.
Definition at line 46 of file Canvas.h. Referenced by Canvas(). |
1.3.5