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