LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evdb::testCanvas1 Class Reference
Inheritance diagram for evdb::testCanvas1:
evdb::Canvas evdb::Printable

Public Member Functions

 testCanvas1 (TGMainFrame *mf)
 
 ~testCanvas1 ()
 
const char * Description () const
 
const char * PrintTag () const
 
void Draw (const char *)
 
virtual void Print (const char *f)
 
void Connect ()
 Make signal/slot connections. More...
 

Static Public Member Functions

static void AddToListOfPrintables (const char *name, evdb::Printable *p)
 
static void RemoveFromListOfPrintables (evdb::Printable *p)
 
static std::map< std::string, evdb::Printable * > & GetPrintables ()
 

Protected Attributes

TGCompositeFrame * fFrame
 Graphics frame. More...
 
TGLayoutHints * fLayout
 Layout hints for frame. More...
 
TRootEmbeddedCanvas * fEmbCanvas
 Embedded canvas. More...
 
TCanvas * fCanvas
 The ROOT drawing canvas. More...
 
unsigned short fXsize
 Size of the canvas;. More...
 
unsigned short fYsize
 Size of the canvas;. More...
 
float fAspectRatio
 fYsize/fXsize More...
 

Detailed Description

Definition at line 40 of file EventDisplay.cc.

Constructor & Destructor Documentation

evdb::testCanvas1::testCanvas1 ( TGMainFrame *  mf)
inline

Definition at line 43 of file EventDisplay.cc.

References evdb::Printable::AddToListOfPrintables(), and PrintTag().

43  : evdb::Canvas(mf) {
45  }
const char * PrintTag() const
Definition: EventDisplay.cc:50
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
Definition: Printable.cxx:29
evdb::testCanvas1::~testCanvas1 ( )
inline

Definition at line 46 of file EventDisplay.cc.

References evdb::Printable::RemoveFromListOfPrintables().

46  {
48  }
static void RemoveFromListOfPrintables(evdb::Printable *p)
Definition: Printable.cxx:47

Member Function Documentation

void evdb::Printable::AddToListOfPrintables ( const char *  name,
evdb::Printable p 
)
staticinherited

Definition at line 29 of file Printable.cxx.

Referenced by evdb::Canvas::Connect(), evdb::ObjListCanvas::Connect(), evdb::Printable::Description(), and testCanvas1().

31  {
32  std::string s(name);
33 
34  if (gsPrintables[s] == 0) {
35  gsPrintables[s] = p;
36  }
37  else {
38  if (gsPrintables[s] != p) {
39  std::cerr << "Printable: Name " << name << " reused.\n";
40  std::abort();
41  }
42  }
43  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evdb::Canvas::Connect ( )
inherited

Make signal/slot connections.

Definition at line 68 of file Canvas.cxx.

References evdb::Printable::AddToListOfPrintables(), and evdb::Canvas::Description().

Referenced by evd::CalorView::CalorView(), evdb::Canvas::Description(), evd::Display3DView::Display3DView(), and evdb::DisplayWindow::DisplayWindow().

69  {
70  // Make connections for drawing and printing
71  // IoModule::Instance()->Connect("NewEvent()",
72  // "evdb::Canvas",this,"Draw()");
74  }
virtual const char * Description() const
Definition: Canvas.h:33
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
Definition: Printable.cxx:29
const char* evdb::testCanvas1::Description ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 49 of file EventDisplay.cc.

49 { return "Test Canvas 1"; }
void evdb::testCanvas1::Draw ( const char *  )
inlinevirtual

Implements evdb::Canvas.

Definition at line 51 of file EventDisplay.cc.

References evdb::Canvas::fCanvas.

51  {
52  static TText* t = new TText(0.5,0.5,"-");
53  static int count = 0;
54  char buff[256];
55  sprintf(buff,"%d",count);
56  mf::LogWarning("EventDisplayBase") << buff;
57  t->SetText(0.5,0.5,buff);
58  t->Draw();
59  ++count;
60  fCanvas->Update();
61  }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::map< std::string, evdb::Printable * > & evdb::Printable::GetPrintables ( )
staticinherited

Definition at line 61 of file Printable.cxx.

References evdb::gsPrintables.

Referenced by evdb::Printable::Description(), evdb::EventDisplay::postProcessEvent(), and evdb::PrintDialog::PrintDialog().

62  {
63  return gsPrintables;
64  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evdb::Canvas::Print ( const char *  f)
virtualinherited

Implements evdb::Printable.

Definition at line 88 of file Canvas.cxx.

References evdb::Canvas::fCanvas.

Referenced by evdb::Canvas::Description().

88 { fCanvas->Print(f); }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
TFile f
Definition: plotHisto.C:6
const char* evdb::testCanvas1::PrintTag ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 50 of file EventDisplay.cc.

Referenced by testCanvas1().

50 { return "Test1"; }
void evdb::Printable::RemoveFromListOfPrintables ( evdb::Printable p)
staticinherited

Definition at line 47 of file Printable.cxx.

Referenced by evdb::Printable::Description(), evdb::Printable::~Printable(), and ~testCanvas1().

48  {
51  for (; itr!=itrEnd; ++itr) {
52  if ( itr->second == p) {
53  gsPrintables.erase(itr);
54  return;
55  }
56  }
57  }
intermediate_table::iterator iterator
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14

Member Data Documentation

float evdb::Canvas::fAspectRatio
protectedinherited

fYsize/fXsize

Definition at line 46 of file Canvas.h.

Referenced by evdb::Canvas::Canvas().

TRootEmbeddedCanvas* evdb::Canvas::fEmbCanvas
protectedinherited
TGCompositeFrame* evdb::Canvas::fFrame
protectedinherited
TGLayoutHints* evdb::Canvas::fLayout
protectedinherited
unsigned short evdb::Canvas::fXsize
protectedinherited
unsigned short evdb::Canvas::fYsize
protectedinherited

The documentation for this class was generated from the following file: