#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 31 of file Canvas.cxx. References fAspectRatio, fCanvas, fEmbCanvas, fFrame, fLayout, fXsize, and fYsize. 00032 {
00033 TGDimension sz; // Size of the main frame
00034
00035 sz = mf->GetSize();
00036 fXsize = sz.fWidth - 10; // Leave small margin on left and right
00037 fYsize = sz.fHeight - 58; // Leave small margin on top and bottom
00038 fAspectRatio = (float)fYsize/(float)fXsize;
00039
00040 // This frame is apparently for holding the buttons on the top; it's
00041 // not used for anything else.
00042 fFrame = new TGCompositeFrame(mf, 60, 60, kHorizontalFrame);
00043
00044 // Define a layout for placing the canvas within the frame.
00045 fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |
00046 kLHintsExpandY, 5, 5, 5, 5);
00047
00048 // Careful about clashes with root's naming of canvases. Make a name
00049 // like "tpcEVDCanvas" using the print tag
00050 std::string name(this->PrintTag());
00051 name += "evdb::Canvas";
00052
00053 // Create the embedded canvas within the main ROOT graphics frame.
00054 fEmbCanvas = new TRootEmbeddedCanvas(name.c_str(), mf, fXsize, fYsize,
00055 kSunkenFrame, 0);
00056 mf->AddFrame(fEmbCanvas, fLayout);
00057 mf->AddFrame(fFrame);
00058
00059 // Extract the graphical Canvas from the embedded canvas. The user
00060 // will do most of their drawing in this.
00061 fCanvas = fEmbCanvas->GetCanvas();
00062 }
|
|
|
Definition at line 76 of file Canvas.cxx. References evdb::IoModule::Instance(). 00077 {
00078 IoModule::Instance()->Disconnect(0,this,0);
00079 delete fEmbCanvas;
00080 delete fLayout;
00081 delete fFrame;
00082 }
|
|
|
Make signal/slot connections.
Definition at line 66 of file Canvas.cxx. References evdb::Printable::AddToListOfPrintables(), and evdb::IoModule::Instance(). Referenced by evdb::DisplayWindow::DisplayWindow(). 00067 {
00068 // Make connections for drawing and printing
00069 IoModule::Instance()->Connect("NewEvent()",
00070 "evdb::Canvas",this,"Draw()");
00071 Printable::AddToListOfPrintables(this->Description(),this);
00072 }
|
|
|
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::Display3D, evd::XZYZProjectionsView, testCanvas1, and testCanvas2. Definition at line 34 of file Canvas.h. 00034 {return "sub-class needs description"; }
|
|
|
Implemented in evd::DetectorView, evd::Display3D, evd::XZYZProjectionsView, testCanvas1, testCanvas2, and TestDisplay. Referenced by evdb::DisplayWindow::Draw(). |
|
|
Print the object to a file.
Implements evdb::Printable. Definition at line 86 of file Canvas.cxx. References fCanvas. 00086 { 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::Display3D, evd::XZYZProjectionsView, 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.
Definition at line 42 of file Canvas.h. Referenced by Canvas(). |
|
|
Graphics frame.
Definition at line 40 of file Canvas.h. Referenced by Canvas(). |
|
|
Layout hints for frame.
Definition at line 41 of file Canvas.h. Referenced by Canvas(). |
|
|
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.9.1