File indexing completed on 2025-01-18 10:12:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TStructViewer
0013 #define ROOT_TStructViewer
0014
0015 #include <TObject.h>
0016 #include <TExMap.h>
0017 #include <TObjArray.h>
0018 #include <TList.h>
0019 #include <TCanvas.h>
0020 #include <TColor.h>
0021
0022 class TStructViewerGUI;
0023 class TStructNode;
0024 class TGMainFrame;
0025
0026 class TStructViewer : public TObject {
0027
0028 private:
0029 void *fPointer;
0030 TClass *fPointerClass;
0031 TStructViewerGUI *fGUI;
0032 TExMap fLevelMembersCount;
0033 TExMap fLevelSize;
0034 TExMap fPointers;
0035 TObjArray fLevelArray;
0036 TStructNode *fTopNode;
0037 TList fColors;
0038
0039
0040 private:
0041 void AddNode(TStructNode* node, ULong_t size);
0042 void CountMembers(TClass* cl, TStructNode* parent, void* pointer);
0043 void Prepare();
0044 void Reset();
0045
0046 public:
0047 TStructViewer(void* ptr = nullptr, const char * clname = nullptr);
0048 ~TStructViewer() override;
0049
0050 void Draw(Option_t *option = "") override;
0051 TCanvas* GetCanvas();
0052 TGMainFrame* GetFrame();
0053 TColor GetColor(const char* typeName);
0054 TExMap GetLevelMembersCount() const;
0055 TExMap GetLevelSize() const;
0056 Bool_t GetLinksVisibility() const;
0057 void *GetPointer() const;
0058 void SetColor(TString name, Int_t color);
0059 void SetLinksVisibility(Bool_t val);
0060 void SetPointer(void* ptr, const char* clname = nullptr);
0061
0062 ClassDefOverride(TStructViewer, 0);
0063 };
0064
0065 #endif