TClassTree


class description - source file - inheritance tree

class TClassTree : public TNamed


    protected:
virtual void FindClassesUsedBy(Int_t iclass) virtual void FindClassesUsing(Int_t iclass) virtual void FindClassPosition(const char* classname, Float_t& x, Float_t& y) virtual void Init() TObjString* Mark(const char* classname, TList* los, Int_t abit) virtual void PaintClass(Int_t iclass, Float_t xleft, Float_t y) virtual void ScanClasses(Int_t iclass) virtual void ShowCod() virtual void ShowHas() virtual void ShowMul() virtual void ShowRef() public:
TClassTree TClassTree() TClassTree TClassTree(const char* name, const char* classes) TClassTree TClassTree(const TClassTree&) virtual void ~TClassTree() static TClass* Class() virtual void Draw(const char* classes) virtual Int_t FindClass(const char* classname) const char* GetClasses() const virtual const char* GetSourceDir() const virtual TClass* IsA() const virtual void ls(Option_t* option) const virtual void Paint(Option_t* option) virtual void SaveAs(const char* filename) virtual void SetClasses(const char* classes, Option_t* option = "ID") virtual void SetLabelDx(Float_t labeldx = 0.15) virtual void SetSourceDir(const char* dir = "src") virtual void SetYoffset(Float_t offset = 0) virtual void ShowClassesUsedBy(const char* classes) virtual void ShowClassesUsing(const char* classes) virtual void ShowLinks(Option_t* option = "HMR") virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
TString fClasses List of classes to be drawn Float_t fYoffset offset at top of picture in per cent of pad Float_t fLabelDx width along x of TPaveLabels in per cent of pad Int_t fNclasses current number of classes Int_t fShowCod if 1 show classes referenced by implementation Int_t fShowMul if 1 show multiple inheritance Int_t fShowHas if 1 show "has a" relationship Int_t fShowRef if 1 show classes relationship other than inheritance Int_t* fCstatus [fNclasses] classes status Int_t* fNdata [fNclasses] Number of data members per class Int_t* fParents [fNclasses] parent number of classes (permanent) Int_t* fCparent !parent number of classes (temporary) char** fDerived ![fNclasses] table to indicate if i derives from j TClass** fCpointer ![fNclasses] pointers to the TClass objects TString** fCnames ![fNclasses] class names TString** fCtitles ![fNclasses] class titles TString** fOptions ![fNclasses] List of options per class TString fSourceDir Concatenated source directories TList** fLinks ![fNclasses] for each class, the list of referenced(ing) classes

Class Description

 Draw inheritance tree and their relations for a list of classes
 The following options are supported
   - Direct inheritance (default)
   - Multiple inheritance
   - Composition
   - References by data members and member functions
   - References from Code

 The list of classes is specified:
   - either in the TClassTree constructor as a second argument
   - or the parameter to TClassTRee::Draw

 Note that the ClassTree viewer can also be started from the canvas
 pull down menu "Classes".

 In the list of classes, class names are separated by a ":"
 wildcarding is supported.
 The following formats are supported, eg in TClassTree::Draw
   1- Draw("ClassA")
         Draw inheritance tree for ClassA
         Show all classes referenced by ClassA
   2- Draw("*ClassB")
         Draw inheritance tree for ClassB
         and all the classes deriving from ClassB
   3- Draw(">ClassC")
         Draw inheritance tree for ClassC
         Show classes referencing ClassC
   4- Draw("ClassD<")
         Draw inheritance tree for ClassD
         Show classes referenced by ClassD
         Show all classes referencing ClassD
   5- Draw("Cla*")
         Draw inheritance tree for all classes with name starting with "Cla"
         Show classes referenced by these classes
   6- Draw("ClassA:ClassB<")
         Draw inheritance tree for ClassA
         Show all classes referenced by ClassA
         Draw inheritance tree for ClassB
         Show classes referenced by ClassB
         Show all classes referencing ClassB

  example;  Draw("TTree<")
         Draw inheritance tree for the Root class TTree
         Show all classes referenced by TTree
         Show all classes using TTree

 By default, only direct inheritance is drawn.
 Use TClassTree::ShowLinks(option) to show additional references
   option = "H" to show links to embedded classes
   option = "M" to show multiple inheritance
   option = "R" to show pointers to other classes from data members
   option = "C" to show classes used by the code(implementation) of a class

 The following picture is produced directly by:
       TClassTree ct("ct","*TH1")
 It shows all the classes derived from the base class TH1.

/*

*/


 The ClassTree class uses the services of the class TPaveClass to
 show the class names. By clicking with the right mouse button in
 one TPaveClass object, one can invoke the following functions of TClassTree:
   - ShowLinks(option) with by default option = "HMR"
   - Draw(classes). By default the class drawn is the one being pointed
   - ShowClassesUsedBy(classes) (by default the pointed class)
   - ShowClassesUsing(classes) (by default the pointed class)

  The following picture has been generated with the following statements
       TClassTree tc1("tc1","TObject");
       tc1.SetShowLinks("HMR");


/*

*/


 Note that in case of embedded classes or pointers to classes,
 the corresponding dashed lines or arrows respectively start
 in the TPaveClass object at an X position reflecting the position
 in the list of data members.

  - References by data members to other classes are show with a full red line
  - Multiple inheritance is shown with a dashed blue line
  - "Has a" relation is shown with a dotted cyan line
  - References from code is shown by a full green line

  Use TClassTree::SetSourceDir to specify the search path for source files.
  By default the search path includes the ROOTSYS/src directory, the current
  directory and the subdirectory src.

  The first time TClassTree::Draw is invoked, all the classes in the
  current application are processed, including the parsing of the code
  to find all classes referenced by the include statements.
  This process may take a few seconds. The following commands will be
  much faster.

  A TClassTree object may be saved in a Root file.
  This object can be processed later by a Root program that ignores
  the original classes. This interesting possibility allows to send
  the class structure of an application to a colleague who does not have
  your classes.
  Example:
    TFile f("myClasses.root","recreate")
    TClassTree *ct = new TClassTree("ct","ATLF*")
    ct->Write();
  You can send at this point the file myClass.root to a colleague who can
  run the following Root basic session
     TFile f("myClass.root"); //connect the file
     tt.ls();                 //to list all classes and titles
     tt.Draw("ATLFDisplay")   //show class ATLFDisplay with all its dependencies
  At this point, one has still access to all the classes present
  in the original session and select any combination of these classes
  to be displayed.

TClassTree()
*-*-*-*-*-*-*-*-*-*-*-*TClassTree default constructor*-*-*-*-*-*-*-*-*-*-*
*-*                    ==============================

TClassTree(const char *name, const char *classes) :TNamed(name,classes)
*-*-*-*-*-*-*-*-*-*-*TClassTree constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ======================

~TClassTree()
*-*-*-*-*-*-*-*-*-*TClassTree default destructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                =============================

void Draw(const char *classes)
 Draw the inheritance tree and relations for the list of classes
 see this class header for the syntax and examples

Int_t FindClass(const char *classname)
  Find class number corresponding to classname in list of local classes

void FindClassesUsedBy(Int_t iclass)
  Select all classes used/referenced by the class number iclass

void FindClassesUsing(Int_t iclass)
  Select all classes using/referencing the class number iclass

void FindClassPosition(const char *classname, Float_t &x, Float_t &y)
 Search the TPaveClass object in the pad with label=classname
 returns the x and y position of the center of the pave.

void Init()
 Initialize the data structures

void ls(Option_t *) const
 list classes names and titles

TObjString* Mark(const char *classname, TList *los, Int_t abit)
 set bit abit in class classname in list los

void Paint(Option_t *)
 Draw the current class setting in fClasses and fStatus

void PaintClass(Int_t iclass, Float_t xleft, Float_t y)
 Paint one class level

void SaveAs(const char *filename)
 save current configuration in a Root file
 if filename is blank, the name of the file will be the current objectname.root
 all the current settings are preserved
 the Root file produced can be looked at by a another Root session
 with no access to the original classes.

void ScanClasses(Int_t iclass)
  Select all classes used by/referenced/referencing the class number iclass
  and build the list of these classes

void SetClasses(const char *classes, Option_t *)
 Set the list of classes for which the hierarchy is to be drawn
 See Paint for the syntax

void SetLabelDx(Float_t labeldx)
 Set the size along x of the TPavellabel showing the class name

void SetYoffset(Float_t offset)
 Set the offset at the top of the picture
 The default offset is computed automatically taking into account
 classes not inheriting from TObject.

void ShowClassesUsedBy(const char *classes)
 mark classes used by the list of classes in classes

void ShowClassesUsing(const char *classes)
 mark classes using any class in the list of classes in classes

void ShowCod()
 Draw the Code References relationships

void ShowHas()
 Draw the "Has a" relationships

void ShowLinks(Option_t *option)
 Set link options in the ClassTree object
   "C"  show References from code
   "H"  show Has a relations
   "M"  show Multiple Inheritance
   "R"  show References from data members

void ShowMul()
 Draw the Multiple inheritance relationships

void ShowRef()
 Draw the References relationships (other than inheritance or composition)

void Streamer(TBuffer &R__b)
 Stream an object of class TClassTree.
 the status of the object is saved and can be replayed in a subsequent session



Inline Functions


        const char* GetClasses() const
        const char* GetSourceDir() const
               void SetSourceDir(const char* dir = "src")
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void StreamerNVirtual(TBuffer& b)
         TClassTree TClassTree(const TClassTree&)


Author: Rene Brun 01/12/98
Last update: root/gpad:$Name: $:$Id: TClassTree.cxx,v 1.5 2002/01/24 11:39:28 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.