TClassTree


class description - source file - inheritance tree

class TClassTree : public TCanvas, public TAttText


    protected:
virtual void ShowHas() virtual void ShowMul() virtual void ShowRef() public:
TClassTree TClassTree() TClassTree TClassTree(Text_t* name, Text_t* title, UInt_t ww = 900, UInt_t wh = 700) virtual void ~TClassTree() TClass* Class() virtual void Divide(Int_t nx = 1, Int_t ny = 1, Float_t xmargin = 0.01, Float_t ymargin = 0.01, Int_t color = 0) virtual void DrawTree(char* uclasses, Option_t* option) virtual void FindClassPosition(char* classname, Float_t& x, Float_t& y) const Text_t* GetClasses() Int_t GetShowHas() Int_t GetShowMul() Int_t GetShowRef() virtual void Help() virtual TClass* IsA() virtual void SetClasses(char* classes) virtual void SetGrid(Int_t valuex = 1, Int_t valuey = 1) virtual void SetGridx(Int_t value = 1) virtual void SetGridy(Int_t value = 1) virtual void SetLabelDx(Float_t labeldx = 3.9) virtual void SetLogx(Int_t value = 1) virtual void SetLogy(Int_t value = 1) virtual void SetLogz(Int_t value = 1) virtual void SetShowHas(Int_t showhas = 1) virtual void SetShowMul(Int_t showmul = 1) virtual void SetShowRef(Int_t showref = 1) virtual void SetTickx(Int_t value = 1) virtual void SetTicky(Int_t value = 1) virtual void SetYoffset(Float_t offset = 2) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) virtual void x3d(Option_t* option)

Data Members

protected:
TString fClasses List of classes to be drawn Float_t fYoffset offset at top of picture Float_t fLabelDx width along x of TPaveLabels 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

Class Description

 Draw inheritance tree for a list of classes
 The following options are supported
   - Direct inheritance (default)
   - Multiple inheritance
   - Composition
   - References

   See TClassTree::DrawTree for examples and pictures

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

TClassTree(const Text_t *name, const Text_t *title, UInt_t ww, UInt_t wh) : TCanvas(name,title,ww,wh)
*-*-*-*-*-*-*-*-*-*-*TClassTree constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ======================

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

void DrawTree(const char *userClasses, Option_t *option)
 Draw inheritance tree for classes in userClasses
 userClasses is a list of classes to be used to draw the tree
 if userClasses is the null string, the last list entered
     via TClassTree::SetClasses is taken.
 class names are separated by a ":"
 wildcarding is supported

 the character "*" following a class name means include
 all class names starting with this string
   example TH1* selects all classes starting with "TH1"

 the character "*" preceeding a class name include
 all classes deriving from this class
   example *TH1 selects all classes deriving from TH1,
   this includes all TH1* classes + TH2* + TH3* +TProfile

 The following example draws the inheritance tree
 for all histogram + tree + all GUI classes deriving from TGFrame
    "*TH1:*TTree:*TGFrame"

 By default, only direct inheritance is drawn.
 Use:
   - TClassTree::SetShowHas to show links to embedded classes
   - TClassTree::SetShowMul to show multiple inheritance
   - TClassTree::SetShowRef to show pointers to other classes

 You can start the ClassTree viewer in two ways:
   1- TClassTree ct("ct","*TH1:*TGraph:TAxis")
   2- using the pull down menu "Classes" from a TCanvas menu bar

 Once a TClassTree canvas is created, you can click on the right button:
   - Select "SetClasses" to draw a new class list
   - Select "SetShowHas" to toggle the embedded classes option
   - Select "SetShowMul" to toggle the multiple inheritance option
   - Select "SetShowRef" to toggle the pointers to classes option
   - Select "Range" to change the canvas range
   - Select "SetCanvasSize" to make a big canvas (eg, 1000x4000) and scroll

  The following picture has been generated with the following statements
       TClassTree tc1("tc1","*TH1:*TCollection");
       tc1.SetShowHas();
       tc1.SetShowRef();


/*

*/


  The following picture has been generated with the following statements
        TClassTree tc2("tc2");
        tc2.SetClasses("*TGCompositeFrame");
        tc2.SetShowHas();
        tc2.SetShowMul();
        tc2.SetShowRef();

/*

*/


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

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

void Help()
 Print help about interactive use of this class in the canvas

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

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

void SetShowHas(Int_t showhas)
 Enable/disable the "Has a" relationship drawing option

void SetShowMul(Int_t showmul)
 Enable/disable the Show Multiple inheritance relationship option

void SetShowRef(Int_t showref)
 Enable/disable the Show References relationship option

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 ShowHas()
 Draw the "Has a" relationships

void ShowMul()
 Draw the Multiple inheritance relationships

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



Inline Functions


        const Text_t* GetClasses()
                Int_t GetShowHas()
                Int_t GetShowMul()
                Int_t GetShowRef()
                 void Divide(Int_t nx = 1, Int_t ny = 1, Float_t xmargin = 0.01, Float_t ymargin = 0.01, Int_t color = 0)
                 void SetGrid(Int_t valuex = 1, Int_t valuey = 1)
                 void SetGridx(Int_t value = 1)
                 void SetGridy(Int_t value = 1)
                 void SetLogx(Int_t value = 1)
                 void SetLogy(Int_t value = 1)
                 void SetLogz(Int_t value = 1)
                 void SetTickx(Int_t value = 1)
                 void SetTicky(Int_t value = 1)
                 void x3d(Option_t* option)
              TClass* Class()
              TClass* IsA()
                 void ShowMembers(TMemberInspector& insp, char* parent)
                 void Streamer(TBuffer& b)


Author: Rene Brun 01/12/98
Last update: 2.22/07 05/07/99 19.26.51 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


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.