Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TClassTree.h
Go to the documentation of this file.
1// @(#)root/gpad:$Id$
2// Author: Rene Brun 01/12/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TClassTree
13#define ROOT_TClassTree
14
15
16#include "TNamed.h"
17#include <vector>
18
19class TClass;
20class TObjString;
21
22class TClassTree : public TNamed {
23
24protected:
25 TString fClasses; ///<List of classes to be drawn
26 Float_t fYoffset{0}; ///<offset at top of picture in per cent of pad
27 Float_t fLabelDx{0}; ///<width along x of TPaveLabels in per cent of pad
28 Int_t fNclasses{0}; ///<current number of classes
29 Int_t fShowCod{0}; ///<if 1 show classes referenced by implementation
30 Int_t fShowMul{0}; ///<if 1 show multiple inheritance
31 Int_t fShowHas{0}; ///<if 1 show "has a" relationship
32 Int_t fShowRef{0}; ///<if 1 show classes relationship other than inheritance
33 Int_t *fCstatus{nullptr}; ///<[fNclasses] classes status
34 Int_t *fNdata{nullptr}; ///<[fNclasses] Number of data members per class
35 Int_t *fParents{nullptr}; ///<[fNclasses] parent number of classes (permanent)
36 Int_t *fCparent{nullptr}; ///<!parent number of classes (temporary)
37 char **fDerived{nullptr}; ///<![fNclasses] table to indicate if i derives from j
38 TClass **fCpointer{nullptr}; ///<![fNclasses] pointers to the TClass objects
39 TString **fCnames{nullptr}; ///<![fNclasses] class names
40 TString **fCtitles{nullptr}; ///<![fNclasses] class titles
41 TString **fOptions{nullptr}; ///<![fNclasses] List of options per class
42 TString fSourceDir; ///<Concatenated source directories
43 TList **fLinks{nullptr}; ///<![fNclasses] for each class, the list of referenced(ing) classes
44 std::vector<Int_t> fNsons; ///<! internal variable, used during painting
45 std::vector<Int_t> fNtsons; ///<! internal variable, used during painting
46
47 virtual void FindClassPosition(const char *classname, Float_t &x, Float_t &y);
48 virtual void FindClassesUsedBy(Int_t iclass);
49 virtual void FindClassesUsing(Int_t iclass);
50 virtual void Init();
51 TObjString *Mark(const char *classname, TList *los, Int_t abit);
52 virtual void PaintClass(Int_t iclass, Float_t xleft, Float_t y);
53 virtual void ScanClasses(Int_t iclass);
54 virtual void ShowCod();
55 virtual void ShowHas();
56 virtual void ShowMul();
57 virtual void ShowRef();
58
59public:
60 TClassTree();
61 TClassTree(const char *name, const char *classes="");
62 ~TClassTree() override;
63 void Draw(const char *classes ="") override;
64 virtual Int_t FindClass(const char *classname);
65 const char *GetClasses() const {return fClasses.Data();}
66 virtual const char *GetSourceDir() const {return fSourceDir.Data();}
67 void ls(Option_t *option="") const override;
68 void Paint(Option_t *option="") override;
69 void SaveAs(const char *filename="",Option_t *option="") const override;
70 virtual void SetClasses(const char *classes, Option_t *option="ID");
71 virtual void SetSourceDir(const char *dir="src") {fSourceDir = dir;}
72 virtual void SetYoffset(Float_t offset=0);
73 virtual void SetLabelDx(Float_t labeldx=0.15);
74 virtual void ShowClassesUsedBy(const char *classes);
75 virtual void ShowClassesUsing(const char *classes);
76 virtual void ShowLinks(Option_t *option="HMR");
77
78 ClassDefOverride(TClassTree,1) //Manager class to draw classes inheritance tree and relations
79};
80
81#endif
82
float Float_t
Definition RtypesCore.h:57
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
char name[80]
Definition TGX11.cxx:110
Draw inheritance tree and their relations for a list of classes.
Definition TClassTree.h:22
virtual void ShowClassesUsedBy(const char *classes)
mark classes used by the list of classes in classes
virtual void ShowHas()
Draw the "Has a" relationships.
virtual void ShowLinks(Option_t *option="HMR")
Set link options in the ClassTree object.
char ** fDerived
![fNclasses] table to indicate if i derives from j
Definition TClassTree.h:37
virtual void ScanClasses(Int_t iclass)
Select all classes used by/referenced/referencing the class number iclass and build the list of these...
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.
Int_t * fCstatus
[fNclasses] classes status
Definition TClassTree.h:33
Int_t fNclasses
current number of classes
Definition TClassTree.h:28
virtual void PaintClass(Int_t iclass, Float_t xleft, Float_t y)
Paint one class level.
virtual void FindClassesUsing(Int_t iclass)
Select all classes using/referencing the class number iclass.
Int_t * fParents
[fNclasses] parent number of classes (permanent)
Definition TClassTree.h:35
Int_t fShowRef
if 1 show classes relationship other than inheritance
Definition TClassTree.h:32
virtual void Init()
Initialize the data structures.
void Paint(Option_t *option="") override
Draw the current class setting in fClasses and fStatus.
void ls(Option_t *option="") const override
list classes names and titles
TString ** fOptions
![fNclasses] List of options per class
Definition TClassTree.h:41
std::vector< Int_t > fNtsons
! internal variable, used during painting
Definition TClassTree.h:45
Int_t fShowHas
if 1 show "has a" relationship
Definition TClassTree.h:31
Int_t fShowCod
if 1 show classes referenced by implementation
Definition TClassTree.h:29
void SaveAs(const char *filename="", Option_t *option="") const override
save current configuration in a Root file if filename is blank, the name of the file will be the curr...
Int_t * fCparent
!parent number of classes (temporary)
Definition TClassTree.h:36
TString fSourceDir
Concatenated source directories.
Definition TClassTree.h:42
virtual Int_t FindClass(const char *classname)
Find class number corresponding to classname in list of local classes.
std::vector< Int_t > fNsons
! internal variable, used during painting
Definition TClassTree.h:44
TString ** fCtitles
![fNclasses] class titles
Definition TClassTree.h:40
virtual void SetLabelDx(Float_t labeldx=0.15)
Set the size along x of the TPaveLabel showing the class name.
virtual const char * GetSourceDir() const
Definition TClassTree.h:66
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...
virtual void SetSourceDir(const char *dir="src")
Definition TClassTree.h:71
Float_t fLabelDx
width along x of TPaveLabels in per cent of pad
Definition TClassTree.h:27
~TClassTree() override
TClassTree default destructor.
virtual 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 cent...
virtual void ShowRef()
Draw the References relationships (other than inheritance or composition)
virtual void ShowCod()
Draw the Code References relationships.
TList ** fLinks
![fNclasses] for each class, the list of referenced(ing) classes
Definition TClassTree.h:43
virtual void ShowMul()
Draw the Multiple inheritance relationships.
virtual void ShowClassesUsing(const char *classes)
mark classes using any class in the list of classes in classes
TClassTree()
TClassTree default constructor.
Float_t fYoffset
offset at top of picture in per cent of pad
Definition TClassTree.h:26
TClass ** fCpointer
![fNclasses] pointers to the TClass objects
Definition TClassTree.h:38
virtual void FindClassesUsedBy(Int_t iclass)
Select all classes used/referenced by the class number iclass.
TString fClasses
List of classes to be drawn.
Definition TClassTree.h:25
TObjString * Mark(const char *classname, TList *los, Int_t abit)
set bit abit in class classname in list los
Int_t fShowMul
if 1 show multiple inheritance
Definition TClassTree.h:30
TString ** fCnames
![fNclasses] class names
Definition TClassTree.h:39
const char * GetClasses() const
Definition TClassTree.h:65
Int_t * fNdata
[fNclasses] Number of data members per class
Definition TClassTree.h:34
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Collectable string class.
Definition TObjString.h:28
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:378
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
th1 Draw()