Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RTreeMapPainter.hxx
Go to the documentation of this file.
1/// \file ROOT/RTreeMapPainter.hxx
2/// \author Patryk Tymoteusz Pilichowski <patryk.tymoteusz.pilichowski@cern.ch>
3/// \date 2025-08-21
4/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
5/// is welcome!
6
7/*************************************************************************
8 * Copyright (C) 1995-2025, Rene Brun and Fons Rademakers. *
9 * All rights reserved. *
10 * *
11 * For the licensing terms see $ROOTSYS/LICENSE. *
12 * For the list of contributors see $ROOTSYS/README/CREDITS. *
13 *************************************************************************/
14
15#ifndef TTREEMAP_HXX
16#define TTREEMAP_HXX
17
18#include "RTreeMapBase.hxx"
19
20#include "TROOT.h"
21#include "TObject.h"
22#include "TCanvas.h"
23#include "TPad.h"
24
25#include <vector>
26
27namespace ROOT::Experimental {
28// clang-format off
29/**
30\class ROOT::Experimental::RTreeMapPainter
31\ingroup TreeMap
32\brief Logic for drawing a treemap on a TVirtualPad
33
34One can visualize an RNTuple in a TCanvas as a treemap like this:
35~~~ {.cpp}
36auto tm = ROOT::Experimental::CreateTreeMapFromRNTuple("file.root", "ntuple_name");
37auto c = new TCanvas("c_tm","TreeMap");
38c->Add(tm.release());
39~~~
40*/
41// clang-format on
43public:
45 public:
47 };
48 RTreeMapPainter() = default;
49 void Paint(Option_t *opt) override;
50
52
53 ~RTreeMapPainter() override = default;
54
55private:
56 /////////////////////////////////////////////////////////////////////////////
57 /// \brief Logic for drawing a box on TVirtualPad
58 void AddBox(const Rect &rect, const RGBColor &color, float borderWidth) const final;
59
60 /////////////////////////////////////////////////////////////////////////////
61 /// \brief Logic for drawing a text on TVirtualPad
62 void AddText(const Vec2 &pos, const std::string &content, float size, const RGBColor &color = RGBColor(0, 0, 0),
63 bool alignCenter = false) const final;
64};
65} // namespace ROOT::Experimental
66#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
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 rect
Base logic for drawing a treemap visualization.
Logic for drawing a treemap on a TVirtualPad.
void Paint(Option_t *opt) override
This method must be overridden if a class wants to paint itself.
void AddText(const Vec2 &pos, const std::string &content, float size, const RGBColor &color=RGBColor(0, 0, 0), bool alignCenter=false) const final
Logic for drawing a text on TVirtualPad.
void AddBox(const Rect &rect, const RGBColor &color, float borderWidth) const final
Logic for drawing a box on TVirtualPad.
Mother of all ROOT objects.
Definition TObject.h:42
Namespace for ROOT features in testing.
Definition TROOT.h:100