Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

evdb::Printable Class Reference

Base class for printable objects. More...

#include <Printable.h>

Inheritance diagram for evdb::Printable:

evdb::Canvas evd::DetectorView evd::Display3D evd::XZYZProjectionsView testCanvas1 testCanvas2 TestDisplay List of all members.

Public Member Functions

 Printable ()
virtual ~Printable ()
virtual void Print (const char *filename)=0
 Print the object to a file.
virtual const char * Description () const
virtual const char * PrintTag () const =0

Static Public Member Functions

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

Detailed Description

Base class for printable objects.

Definition at line 16 of file Printable.h.


Constructor & Destructor Documentation

Printable::Printable  ) 
 

Definition at line 19 of file Printable.cxx.

00019 { }

Printable::~Printable  )  [virtual]
 

Definition at line 23 of file Printable.cxx.

References RemoveFromListOfPrintables().

00024 {
00025   Printable::RemoveFromListOfPrintables(this);
00026 }


Member Function Documentation

void Printable::AddToListOfPrintables const char *  name,
Printable p
[static]
 

Definition at line 30 of file Printable.cxx.

References gsPrintables.

Referenced by evdb::Canvas::Connect(), testCanvas1::testCanvas1(), and testCanvas2::testCanvas2().

00032  {
00033   std::string s(name);
00034 
00035   if (gsPrintables[s] == 0) {
00036     gsPrintables[s] = p;
00037   }
00038   else {
00039     if (gsPrintables[s] != p) {
00040       std::cerr << "Printable: Name " << name << " reused.\n";
00041       std::abort();
00042     }
00043   }
00044 }

virtual const char* evdb::Printable::Description  )  const [inline, virtual]
 

Give a medium length description of what the view holds to be printed. Examples: "Full view of experiment", "3D View", ...

Reimplemented in evd::DetectorView, evd::Display3D, evd::XZYZProjectionsView, evdb::Canvas, testCanvas1, and testCanvas2.

Definition at line 26 of file Printable.h.

00026 { return "??"; }

std::map< std::string, Printable * > & Printable::GetPrintables  )  [static]
 

Definition at line 62 of file Printable.cxx.

Referenced by evdb::PrintDialog::PrintDialog().

00063 {
00064   return gsPrintables;
00065 }

virtual void evdb::Printable::Print const char *  filename  )  [pure virtual]
 

Print the object to a file.

Implemented in evdb::Canvas.

Referenced by evdb::PrintDialog::Print().

virtual const char* evdb::Printable::PrintTag  )  const [pure virtual]
 

Give a short tag which can be included in filename to ID object printed Keep to ~4 characters

Implemented in evd::DetectorView, evd::Display3D, evd::XZYZProjectionsView, evdb::Canvas, testCanvas1, and testCanvas2.

void Printable::RemoveFromListOfPrintables Printable p  )  [static]
 

Definition at line 48 of file Printable.cxx.

References gsPrintables.

Referenced by ~Printable(), testCanvas1::~testCanvas1(), and testCanvas2::~testCanvas2().

00049 {
00050   std::map<std::string,Printable*>::iterator itr(gsPrintables.begin());
00051   std::map<std::string,Printable*>::iterator itrEnd(gsPrintables.end());
00052   for (; itr!=itrEnd; ++itr) {
00053     if ( itr->second == p) {
00054       gsPrintables.erase(itr);
00055       return;
00056     }
00057   }
00058 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 04:45:31 2009 for NOvA Offline by  doxygen 1.3.9.1