12 #include "RConfigure.h"
199 SetSourceDir(
".:src:" ROOTSRCDIR);
201 SetSourceDir(
".:src:$ROOTSYS/src");
235 if (classes && strlen(classes)) {
271 gROOT->MakeDefCanvas();
274 if (classes && strlen(classes))
fClasses = classes;
298 fCstatus[iclass] = 1;
306 if (fCstatus[i])
continue;
311 if (udata || ufunc || ucode || uclass) {
323 fCstatus[iclass] = 1;
331 if (fCstatus[i])
continue;
336 if (udata || ufunc || ucode || uclass) {
351 while((obj=
next())) {
354 if (!strcmp(pave->
GetLabel(),classname)) {
369 if (fNclasses)
return;
399 if (lm) fNdata[i] = lm->
GetSize();
414 if (clbase == 0)
continue;
436 snprintf(line,500,
"%s%s",
fCnames[i]->
Data(),
"...........................");
439 printf(
"%5d %s\n",i,line);
467 while((obj=
next())) {
468 if (obj->TestBit(kIsClassTree))
delete obj;
473 if (nch == 0)
return;
474 char *classes =
new char[nch+1];
480 char *ptr = strtok(classes,
":");
489 if(derived[j]) fCstatus[i] = 1;
492 }
else if (ptr[0] ==
'>') {
494 if(
fCnames[i]->Contains(&ptr[1])) {
500 }
else if (ptr[nch-1] ==
'<') {
503 if(
fCnames[i]->Contains(ptr)) {
510 }
else if (ptr[nch-1] ==
'*') {
513 if(
fCnames[i]->Contains(ptr)) fCstatus[i] = 1;
528 gNsons[i] = gNtsons[i] = 0;
531 if (fCstatus[i] == 0)
continue;
534 if (j == i)
continue;
542 if (fCstatus[i] == 0)
continue;
553 if (fCstatus[i] == 0)
continue;
554 if (gNsons[i] != 0)
continue;
559 if (nlevel > maxlev) maxlev = nlevel;
570 if (fCstatus[i] == 0)
continue;
572 ndiv += gNtsons[i]+1;
584 gXsize = xmax -
xmin;
585 gYsize = ymax -
ymin;
586 gDy = (gYsize-ytop)/(ndiv);
587 if (gDy > gYsize/10.) gDy = gYsize/10.;
589 if (maxlev > 5) gDx = 0.97*gXsize/maxlev;
592 if (gLabdx > 0.95*gDx) gLabdx = 0.95*
gDx;
594 gDxx = 0.5*gXsize/26.;
597 Int_t dxpixels =
gPad->XtoAbsPixel(gLabdx) -
gPad->XtoAbsPixel(0);
598 Int_t dypixels =
gPad->YtoAbsPixel(0) -
gPad->YtoAbsPixel(gLabdy);
599 gCsize = dxpixels/(10.*dypixels);
604 if (fCstatus[i] == 0)
continue;
606 y -= gDy+0.5*gNtsons[i]*
gDy;
609 y -= 0.5*gNtsons[i]*
gDy;
621 if (nch > 20) xmax = 0.5;
622 if (nch > 50) xmax = 0.7;
623 if (nch > 70) xmax = 0.9;
625 ,ymin+gYsize-0.9*gYsize/20.
627 ,ymin+gYsize-0.1*gYsize/26.
630 ptitle->
SetBit(kIsClassTree);
645 Int_t ns = gNsons[iclass];
648 if(ns != 0) u[1] = u[0]+
gDx;
650 line->
SetBit(kIsClassTree);
655 if (icobject >= 0 && !derived[icobject]) label->
SetFillColor(30);
658 label->
SetBit(kIsClassTree);
664 y += 0.5*gNtsons[iclass]*
gDy;
668 if (gNtsons[i] > 1) y -= 0.5*gNtsons[i]*
gDy;
670 if (!first) {first=1; yu =
y;}
673 if (gNtsons[i] > 1) y -= 0.5*gNtsons[i]*
gDy;
677 line =
new TLine(u[1],yl,u[1],yu);
678 line->
SetBit(kIsClassTree);
717 if (ic < 0 || ic == iclass)
continue;
739 if (numb == 1)
continue;
744 if (ic == iclass)
continue;
762 while ((method = (
TMethod*) nextm())) {
765 star = strstr((
char*)name.
Data(),
"*");
767 cref = strstr((
char*)name.
Data(),
"&");
770 if (ic < 0 || ic == iclass)
continue;
780 star = strstr((
char*)name.
Data(),
"*");
782 cref = strstr((
char*)name.
Data(),
"&");
785 if (ic < 0 || ic == iclass)
continue;
803 if (!sourceName)
return;
805 char *cname =
new char[ncn+1];
806 snprintf(cname,ncn,
"%s::",
fCnames[iclass]->
Data());
808 std::ifstream sourceFile;
809 sourceFile.open( sourceName, std::ios::in );
811 if( sourceFile.good() ) {
812 const Int_t kMAXLEN=1500;
814 while( !sourceFile.eof() ) {
815 sourceFile.getline( line, kMAXLEN-1 );
816 if( sourceFile.eof() )
break;
817 Int_t nblank = strspn(line,
" ");
818 if (!strncmp(&line[nblank],
"//",2))
continue;
819 char *cc = strstr(line,
"::");
822 if (!strncmp(&line[nblank],cname,ncn))
break;
823 Int_t nl = strlen(&line[nblank]);
824 if (!strncmp(&line[nblank],cc+2,nl))
break;
826 nlines++;
if (nlines > 1000)
break;
827 char *inc = strstr(line,
"#include");
829 char *ch = strstr(line,
".h");
832 char *
start = strstr(line,
"<");
833 if (!start) start = strstr(line,
"\"");
834 if (!start)
continue;
836 while ((start < ch) && (*start ==
' ')) start++;
838 if (icl < 0 || icl == iclass)
continue;
847 if (ic == icl)
continue;
867 if (classes == 0)
return;
902 Int_t nch = strlen(classes);
903 char *ptr =
new char[nch+1];
904 strlcpy(ptr,classes,nch+1);
913 }
else if (ptr[nch-1] ==
'*') {
933 Int_t nch = strlen(classes);
934 char *ptr =
new char[nch+1];
935 strlcpy(ptr,classes,nch+1);
944 }
else if (ptr[nch-1] ==
'*') {
970 while((obj=
next())) {
974 if (icl < 0)
continue;
981 if (!os->
TestBit(kUsedByCode1))
continue;
983 if (derived[ic])
continue;
985 if (x1 == 0 || y1 == 0)
continue;
989 arrow->
SetBit(kIsClassTree);
1008 while((obj=
next())) {
1012 if (icl < 0)
continue;
1014 Int_t nmembers = fNdata[icl];
1015 if (nmembers == 0)
continue;
1016 dx = (pave->
GetX2() - pave->
GetX1())/nmembers;
1020 if (!os->
TestBit(kUsedByData))
continue;
1021 if (os->
TestBit(kIsaPointer))
continue;
1022 if (os->
TestBit(kIsBasic))
continue;
1024 if (x1 == 0 || y1 == 0)
continue;
1029 line->
SetBit(kIsClassTree);
1048 fShowCod = fShowHas = fShowMul = fShowRef = 0;
1049 if (opt.
Contains(
"C")) fShowCod = 1;
1050 if (opt.
Contains(
"H")) fShowHas = 1;
1051 if (opt.
Contains(
"M")) fShowMul = 1;
1052 if (opt.
Contains(
"R")) fShowRef = 1;
1068 while((obj=
next())) {
1072 if (icl < 0)
continue;
1079 if (!os->
TestBit(kUsedByClass))
continue;
1081 if (derived[ic] != 2)
continue;
1083 if (x1 == 0 || y1 == 0)
continue;
1085 line->
SetBit(kIsClassTree);
1107 while((obj=
next())) {
1111 if (icl < 0)
continue;
1113 Int_t nmembers = fNdata[icl];
1114 if (nmembers == 0)
continue;
1115 dx = (pave->
GetX2() - pave->
GetX1())/nmembers;
1119 if (!os->
TestBit(kUsedByData))
continue;
1121 if (!os->
TestBit(kIsaPointer))
continue;
1122 if (os->
TestBit(kIsBasic))
continue;
1123 if (ic == icc)
continue;
1125 if (x1 == 0 || y1 == 0)
continue;
1130 arrow->
SetBit(kIsClassTree);
1141 void TClassTree::Streamer(
TBuffer &R__b)
1146 TNamed::Streamer(R__b);
1166 R__b >> fCstatus[i];
1167 R__b >> fParents[i];
1176 fLinks[i]->Streamer(R__b);
1183 TNamed::Streamer(R__b);
1193 R__b << fCstatus[i];
1194 R__b << fParents[i];
1199 fLinks[i]->Streamer(R__b);
const char * GetName() const
Returns name of object.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * GetTitle() const
Returns title of object.
virtual ~TClassTree()
TClassTree default destructor.
A TPaveLabel specialized to process classes inside a TClassTree.
virtual void FindClassesUsedBy(Int_t iclass)
Select all classes used/referenced by the class number iclass.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
virtual void FindClassPosition(const char *classname, Float_t &x, Float_t &y)
[fNclasses] for each class, the list of referenced(ing) classes
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
Collectable string class.
R__EXTERN TClassTable * gClassTable
virtual void SetYoffset(Float_t offset=0)
Set the offset at the top of the picture The default offset is computed automatically taking into acc...
All ROOT classes may have RTTI (run time type identification) support added.
TString fSourceDir
[fNclasses] List of options per class
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
virtual void SetClasses(const char *classes, Option_t *option="ID")
Set the list of classes for which the hierarchy is to be drawn See Paint for the syntax.
virtual void SetToolTipText(const char *text, Long_t delayms=1000)
Set tool tip text associated with this box.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
TString ** fCtitles
[fNclasses] class names
void ToUpper()
Change string to upper case.
Buffer base class used for serializing objects.
static const char * filename()
virtual void ShowClassesUsing(const char *classes)
mark classes using any class in the list of classes in classes
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TObjString * Mark(const char *classname, TList *los, Int_t abit)
set bit abit in class classname in list los
TString ** fCnames
[fNclasses] pointers to the TClass objects
virtual void Paint(Option_t *option="")
Draw the current class setting in fClasses and fStatus.
virtual void ShowMul()
Draw the Multiple inheritance relationships.
Bool_t IsaPointer() const
Return true if data member is a pointer.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Each ROOT method (see TMethod) has a linked list of its arguments.
virtual void ls(Option_t *option="") const
list classes names and titles
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual void ShowClassesUsedBy(const char *classes)
mark classes used by the list of classes in classes
virtual void ShowLinks(Option_t *option="HMR")
Set link options in the ClassTree object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
virtual void ScanClasses(Int_t iclass)
Select all classes used by/referenced/referencing the class number iclass and build the list of these...
TClass ** fCpointer
[fNclasses] table to indicate if i derives from j
const char * Data() const
The TNamed class is the base class for all named ROOT classes.
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
std::vector< std::vector< double > > Data
const char * GetImplFileName() const
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual Int_t FindClass(const char *classname)
Find class number corresponding to classname in list of local classes.
virtual void SetLineColor(Color_t lcolor)
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
virtual void SetSourceDir(const char *dir="src")
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();...
char ** fDerived
parent number of classes (temporary)
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
virtual void SetLabelDx(Float_t labeldx=0.15)
Set the size along x of the TPaveLabel showing the class name.
Bool_t TestBit(UInt_t f) const
virtual void SaveAs(const char *filename="", Option_t *option="") const
save current configuration in a Root file if filename is blank, the name of the file will be the curr...
virtual void FindClassesUsing(Int_t iclass)
Select all classes using/referencing the class number iclass.
return fString CompareTo(((TObjString *) obj) ->fString)
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
virtual void ShowRef()
Draw the References relationships (other than inheritance or composition)
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
Each class (see TClass) has a linked list of its base class(es).
virtual void ShowCod()
Draw the Code References relationships.
const char * GetTypeName() const
Get type of method argument, e.g.
const char * GetClasses() const
virtual Int_t GetSize() const
static const double x1[5]
static char * Next()
Returns next class from sorted class table.
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
virtual void Draw(const char *classes="")
Draw the inheritance tree and relations for the list of classes see this class header for the syntax ...
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual void ShowHas()
Draw the "Has a" relationships.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void SetLineStyle(Style_t lstyle)
const char * GetLabel() const
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual UInt_t GetUniqueID() const
Return the unique object id.
Mother of all ROOT objects.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Add(TObject *obj)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Each ROOT class (see TClass) has a linked list of methods.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
virtual void SetTextSize(Float_t tsize=1)
Draw all kinds of Arrows.
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
TString ** fOptions
[fNclasses] class titles
virtual void PaintClass(Int_t iclass, Float_t xleft, Float_t y)
Paint one class level.
Draw inheritance tree and their relations for a list of classes.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual void Init()
Initialize the data structures.