1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.5 1999/09/29 09:24:31 fca
19 Introduction of the Copyright and cvs Log
23 ///////////////////////////////////////////////////////////////////////////////
25 // Interface Class to the Geant3.21 MonteCarlo //
26 // Author : Rene Brun 08/12/98 //
28 // A TPaveTree is a TPaveLabel specialized to draw Geant GDtree //
30 // When a TPaveTree object is drawn in a canvas, one can: //
31 // - double click to draw the spec //
32 // - select pop-up item DrawTree to draw its tree //
33 // - select pop-up item DrawTreeParent to draw its parent tree //
37 <img src="picts/TPaveTreeClass.gif">
41 ///////////////////////////////////////////////////////////////////////////////
46 #include <TVirtualPad.h>
48 #include "TPaveTree.h"
54 //_____________________________________________________________________________
55 TPaveTree::TPaveTree(): TPaveLabel()
58 // Default Constructor
62 //_____________________________________________________________________________
63 TPaveTree::TPaveTree(Coord_t x1, Coord_t y1,Coord_t x2, Coord_t y2,
65 :TPaveLabel(x1,y1,x2,y2,label,"br")
68 // TPaveTree normal constructor
73 //_____________________________________________________________________________
74 TPaveTree::~TPaveTree()
77 // Standard Destructor
81 //_____________________________________________________________________________
82 void TPaveTree::DrawSpec()
85 // Draw specs of the volume in this TPaveTree
87 gMC->DrawOneSpec(GetLabel());
90 //_____________________________________________________________________________
91 void TPaveTree::DrawTree(Int_t levmax, Int_t isel)
94 // Draw tree of the volume in this TPaveTree
96 ((TGeant3*)gMC)->Gdtree(GetLabel(),levmax,isel);
99 //_____________________________________________________________________________
100 void TPaveTree::DrawTreeParent(Int_t levmax, Int_t isel)
103 // Draw parent tree of the volume in this TPaveTree
105 ((TGeant3*)gMC)->GdtreeParent(GetLabel(),levmax,isel);
108 //_____________________________________________________________________________
109 void TPaveTree::ExecuteEvent(Int_t event, Int_t px, Int_t py)
112 // Process mouse events.
113 // Invokes TPabeLabel::ExecuteEvent. In case of a double click
114 // draw specs of volume corresponding to this TPaveTree
117 TPaveLabel::ExecuteEvent(event,px,py);
119 if (event == kButton1Double) {
120 //printf("TPaveTree::ExecuteEvent\n");
121 gPad->SetCursor(kWatch);
122 gMC->DrawOneSpec(GetLabel());
126 //_____________________________________________________________________________
127 void TPaveTree::SavePrimitive(ofstream &out, Option_t *)
130 // Save primitive as a C++ statement(s) on output stream out
134 if (gROOT->ClassSaved(TPaveTree::Class())) {
139 out<<"pvar = new TPaveTree("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
140 <<","<<quote<<fLabel<<quote<<","<<quote<<fOption<<quote<<");"<<endl;
142 SaveFillAttributes(out,"pvar",0,1001);
143 SaveLineAttributes(out,"pvar",1,1,1);
144 SaveTextAttributes(out,"pvar",22,0,1,62,0);
146 out<<" pvar->Draw();"<<endl;