00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TStructNode
00013 #define ROOT_TStructNode
00014
00015 #include <TObject.h>
00016 #include <TString.h>
00017
00018 enum ENodeType {
00019 kUnknown = 1,
00020 kClass,
00021 kCollection,
00022 kBasic,
00023 kSTLCollection
00024 };
00025 enum EScalingType {
00026 kSize,
00027 kMembers
00028 };
00029
00030
00031
00032
00033
00034 class TStructNode : public TObject {
00035
00036 private:
00037 static EScalingType fgScalBy;
00038 TString fName;
00039 TString fTypeName;
00040 ULong_t fSize;
00041 ULong_t fTotalSize;
00042 TStructNode *fParent;
00043 UInt_t fLevel;
00044 ULong_t fMembersCount;
00045 ULong_t fAllMembersCount;
00046 void* fPointer;
00047 Bool_t fCollapsed;
00048 Bool_t fVisible;
00049 TList* fMembers;
00050 Float_t fX;
00051 Float_t fY;
00052 Float_t fWidth;
00053 Float_t fHeight;
00054 ENodeType fNodeType;
00055 UInt_t fMaxLevel;
00056 UInt_t fMaxObjects;
00057
00058 public:
00059 TStructNode(TString name, TString typeName, void* pointer, TStructNode* parent, ULong_t size, ENodeType type);
00060 ~TStructNode();
00061
00062 virtual Int_t Compare(const TObject* obj) const;
00063 ULong_t GetAllMembersCount() const;
00064 Float_t GetCenter() const;
00065 Float_t GetHeight() const;
00066 UInt_t GetLevel() const;
00067 UInt_t GetMaxLevel() const;
00068 UInt_t GetMaxObjects() const;
00069 TList* GetMembers() const;
00070 ULong_t GetMembersCount() const;
00071 Float_t GetMiddle() const;
00072 const char* GetName() const;
00073 ENodeType GetNodeType() const;
00074 TStructNode *GetParent() const;
00075 void* GetPointer() const;
00076 ULong_t GetRelativeMembersCount() const;
00077 ULong_t GetRelativeSize() const;
00078 ULong_t GetRelativeVolume() const;
00079 Float_t GetRelativeVolumeRatio();
00080 ULong_t GetSize() const;
00081 ULong_t GetTotalSize() const;
00082 TString GetTypeName() const;
00083 ULong_t GetVolume() const;
00084 Float_t GetVolumeRatio();
00085 Float_t GetWidth() const;
00086 Float_t GetX() const;
00087 Float_t GetY() const;
00088 Bool_t IsCollapsed() const;
00089 virtual Bool_t IsSortable() const;
00090 bool IsVisible() const;
00091 void SetAllMembersCount(ULong_t count);
00092 void SetCollapsed(Bool_t collapsed);
00093 void SetHeight(Float_t h);
00094 void SetMaxLevel(UInt_t level);
00095 void SetMaxObjects(UInt_t max);
00096 void SetMembers(TList* list);
00097 void SetMembersCount(ULong_t count);
00098 void SetNodeType(ENodeType type);
00099 void SetPointer(void* pointer);
00100 static void SetScaleBy(EScalingType type);
00101 void SetSize(ULong_t size);
00102 void SetTotalSize(ULong_t size);
00103 void SetVisible(bool visible);
00104 void SetWidth(Float_t w);
00105 void SetX(Float_t x);
00106 void SetY(Float_t y);
00107
00108 ClassDef(TStructNode,0);
00109 };
00110
00111 #endif