Canvas.h
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////
2 /// \file Canvas.h
3 /// \brief Base class for define a detector display
4 ///
5 /// \version $Id: Canvas.h,v 1.2 2011-01-23 16:08:50 p-nusoftart Exp $
6 /// \author messier@indiana.edu
7 /////////////////////////////////////////////////////////////////////////
8 #ifndef EVDB_CANVAS_H
9 #define EVDB_CANVAS_H
10 
11 #include "TQObject.h"
12 #include "RQ_OBJECT.h"
14 
15 class TGMainFrame;
16 class TGCompositeFrame;
17 class TGLayoutHints;
18 class TRootEmbeddedCanvas;
19 class TCanvas;
20 
21 namespace evdb {
22  class Canvas : public Printable {
23  RQ_OBJECT("evdb::Canvas")
24 
25  public:
26  Canvas(TGMainFrame* mf);
27  virtual ~Canvas();
28 
29  virtual void Draw(const char* opt=0) = 0;
30 
31  // Sub-classes must define these
32  virtual const char* PrintTag() const {return "sub-class needs print tag"; }
33  virtual const char* Description() const {return "sub-class needs description"; }
34  virtual void Print(const char* f);
35 
36  void Connect(); //!< Make signal/slot connections
37 
38  protected:
39  TGCompositeFrame* fFrame; //!< Graphics frame
40  TGLayoutHints* fLayout; //!< Layout hints for frame
41  TRootEmbeddedCanvas* fEmbCanvas; //!< Embedded canvas
42  TCanvas* fCanvas; //!< The ROOT drawing canvas
43 
44  unsigned short fXsize; //!< Size of the canvas;
45  unsigned short fYsize; //!< Size of the canvas;
46  float fAspectRatio; //!< fYsize/fXsize
47  };
48 }
49 
50 #endif // EVDB_CANVAS_H
51 ////////////////////////////////////////////////////////////////////////
void Connect()
Make signal/slot connections.
Definition: Canvas.cxx:68
Definition: Canvas.py:1
Base class for printable objects.
Definition: Printable.h:15
TGCompositeFrame * fFrame
Graphics frame.
Definition: Canvas.h:39
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
TGLayoutHints * fLayout
Layout hints for frame.
Definition: Canvas.h:40
Manage all things related to colors for the event display.
Definition: Display3DPad.h:11
float fAspectRatio
fYsize/fXsize
Definition: Canvas.h:46
Base class for printable objects.
virtual const char * Description() const
Definition: Canvas.h:33
unsigned short fXsize
Size of the canvas;.
Definition: Canvas.h:44
unsigned short fYsize
Size of the canvas;.
Definition: Canvas.h:45
Canvas(TGMainFrame *mf)
Definition: Canvas.cxx:33
virtual const char * PrintTag() const
Definition: Canvas.h:32
virtual void Print(const char *f)
Definition: Canvas.cxx:88
TRootEmbeddedCanvas * fEmbCanvas
Embedded canvas.
Definition: Canvas.h:41
virtual void Draw(const char *opt=0)=0
virtual ~Canvas()
Definition: Canvas.cxx:78