1 ///////////////////////////////////////////////////////////////////////////////
3 // Interface Class to the Geant3.21 MonteCarlo //
4 // Author : Rene Brun 08/12/98 //
6 // A TPaveTree is a TPaveLabel specialized to draw Geant GDtree //
8 // When a TPaveTree object is drawn in a canvas, one can: //
9 // - double click to draw the spec //
10 // - select pop-up item DrawTree to draw its tree //
11 // - select pop-up item DrawTreeParent to draw its parent tree //
15 <img src="picts/TPaveTreeClass.gif">
19 ///////////////////////////////////////////////////////////////////////////////
24 #include <TVirtualPad.h>
26 #include "TPaveTree.h"
32 //_____________________________________________________________________________
33 TPaveTree::TPaveTree(): TPaveLabel()
36 // Default Constructor
40 //_____________________________________________________________________________
41 TPaveTree::TPaveTree(Coord_t x1, Coord_t y1,Coord_t x2, Coord_t y2,
43 :TPaveLabel(x1,y1,x2,y2,label,"br")
46 // TPaveTree normal constructor
51 //_____________________________________________________________________________
52 TPaveTree::~TPaveTree()
55 // Standard Destructor
59 //_____________________________________________________________________________
60 TPaveTree::TPaveTree(const TPaveTree &PaveTree)
65 ((TPaveTree&)PaveTree).Copy(*this);
68 //_____________________________________________________________________________
69 void TPaveTree::Copy(TObject &obj)
72 // Copy this PaveTree to PaveTree
74 TPaveLabel::Copy(obj);
77 //_____________________________________________________________________________
78 void TPaveTree::DrawSpec()
81 // Draw specs of the volume in this TPaveTree
83 gMC->DrawOneSpec(GetLabel());
86 //_____________________________________________________________________________
87 void TPaveTree::DrawTree(Int_t levmax, Int_t isel)
90 // Draw tree of the volume in this TPaveTree
92 ((TGeant3*)gMC)->Gdtree(GetLabel(),levmax,isel);
95 //_____________________________________________________________________________
96 void TPaveTree::DrawTreeParent(Int_t levmax, Int_t isel)
99 // Draw parent tree of the volume in this TPaveTree
101 ((TGeant3*)gMC)->GdtreeParent(GetLabel(),levmax,isel);
104 //_____________________________________________________________________________
105 void TPaveTree::ExecuteEvent(Int_t event, Int_t px, Int_t py)
108 // Process mouse events.
109 // Invokes TPabeLabel::ExecuteEvent. In case of a double click
110 // draw specs of volume corresponding to this TPaveTree
113 TPaveLabel::ExecuteEvent(event,px,py);
115 if (event == kButton1Double) {
116 //printf("TPaveTree::ExecuteEvent\n");
117 gPad->SetCursor(kWatch);
118 gMC->DrawOneSpec(GetLabel());
122 //_____________________________________________________________________________
123 void TPaveTree::SavePrimitive(ofstream &out, Option_t *)
126 // Save primitive as a C++ statement(s) on output stream out
130 if (gROOT->ClassSaved(TPaveTree::Class())) {
135 out<<"pvar = new TPaveTree("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
136 <<","<<quote<<fLabel<<quote<<","<<quote<<fOption<<quote<<");"<<endl;
138 SaveFillAttributes(out,"pvar",0,1001);
139 SaveLineAttributes(out,"pvar",1,1,1);
140 SaveTextAttributes(out,"pvar",22,0,1,62,0);
142 out<<" pvar->Draw();"<<endl;