LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
evd::Display3DView Class Reference

View of event shoing the XZ and YZ readout planes. More...

#include "Display3DView.h"

Inheritance diagram for evd::Display3DView:
evdb::Canvas evdb::Printable

Public Member Functions

 Display3DView (TGMainFrame *mf)
 
 ~Display3DView ()
 
const char * Description () const
 
const char * PrintTag () const
 
void Draw (const char *opt="")
 
void CloseWindow ()
 
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...
 

Private Attributes

Display3DPadfDisplay3DPad
 

Detailed Description

View of event shoing the XZ and YZ readout planes.

Definition at line 16 of file Display3DView.h.

Constructor & Destructor Documentation

evd::Display3DView::Display3DView ( TGMainFrame *  mf)

Definition at line 16 of file Display3DView.cxx.

References evdb::Canvas::Connect(), evdb::Canvas::fCanvas, and fDisplay3DPad.

16  : evdb::Canvas(mf)
17  {
19 
20  fDisplay3DPad = new Display3DPad("fDisplay3DPad","3D Display",
21  0.0, 0.0, 1.0, 1.0, "");
22 
23  this->Connect("CloseWindow()","evd::Display3DView",this,"CloseWindow()");
24 
25 // fDisplay3DPad->Draw();
26 
27  evdb::Canvas::fCanvas->Update();
28  }
void Connect()
Make signal/slot connections.
Definition: Canvas.cxx:68
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
Display3DPad * fDisplay3DPad
Definition: Display3DView.h:32
evd::Display3DView::~Display3DView ( )

Definition at line 31 of file Display3DView.cxx.

32  {
33  }

Member Function Documentation

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

Definition at line 29 of file Printable.cxx.

References s.

Referenced by evdb::Canvas::Connect(), evdb::ObjListCanvas::Connect(), evdb::Printable::Description(), and evdb::testCanvas1::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  }
Float_t s
Definition: plot.C:23
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evd::Display3DView::CloseWindow ( )

Definition at line 36 of file Display3DView.cxx.

Referenced by PrintTag().

37  {
38  delete this;
39  }
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(), 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* evd::Display3DView::Description ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 26 of file Display3DView.h.

26 { return "3D Detector Display"; }
void evd::Display3DView::Draw ( const char *  opt = "")
virtual

Implements evdb::Canvas.

Definition at line 42 of file Display3DView.cxx.

References evd::Display3DPad::Draw(), evdb::Canvas::fCanvas, fDisplay3DPad, and evd::DrawingPad::Pad().

Referenced by PrintTag().

43  {
45  evdb::Canvas::fCanvas->Update();
46 
47  TVirtualViewer3D *viewer = fDisplay3DPad->Pad()->GetViewer3D("ogl");
48  viewer->PreferLocalFrame();
49  viewer->ResetCameras();
50  viewer->PadPaint(fDisplay3DPad->Pad());
51 
52  }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
TPad * Pad()
Definition: DrawingPad.h:37
Display3DPad * fDisplay3DPad
Definition: Display3DView.h:32
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* evd::Display3DView::PrintTag ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 27 of file Display3DView.h.

References CloseWindow(), and Draw().

27 { return "lar3d"; }
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 evdb::testCanvas1::~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().

Display3DPad* evd::Display3DView::fDisplay3DPad
private

Definition at line 32 of file Display3DView.h.

Referenced by Display3DView(), and Draw().

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 files: