Skip to content
Snippets Groups Projects
Commit 7e26c9b5 authored by Sergey Linev's avatar Sergey Linev Committed by Axel Naumann
Browse files

v7canv: provide canvas title to client

parent 54987345
Branches
Tags
No related merge requests found
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#ifndef ROOT7_RPadDisplayItem #ifndef ROOT7_RPadDisplayItem
#define ROOT7_RPadDisplayItem #define ROOT7_RPadDisplayItem
#include <ROOT/RDisplayItem.hxx> #include <ROOT/RDisplayItem.hxx>
#include <ROOT/RFrame.hxx> #include <ROOT/RFrame.hxx>
#include <ROOT/RPad.hxx> #include <ROOT/RPad.hxx>
...@@ -33,16 +34,18 @@ public: ...@@ -33,16 +34,18 @@ public:
protected: protected:
const RFrame *fFrame{nullptr}; ///< temporary pointer on frame object const RFrame *fFrame{nullptr}; ///< temporary pointer on frame object
const RPadDrawingOpts *fDrawOpts{nullptr}; ///< temporary pointer on pad drawing options const RPadDrawingOpts *fDrawOpts{nullptr}; ///< temporary pointer on pad drawing options
const RPadExtent *fSize{nullptr}; ///< temporary pointer on pad size attributes const RPadExtent *fSize{nullptr}; ///< temporary pointer on pad size attributes
PadPrimitives_t fPrimitives; ///< display items for all primitives in the pad std::string fTitle; ///< title of the pad
PadPrimitives_t fPrimitives; ///< display items for all primitives in the pad
public: public:
RPadDisplayItem() = default; RPadDisplayItem() = default;
virtual ~RPadDisplayItem() {} virtual ~RPadDisplayItem() {}
void SetFrame(const RFrame *f) { fFrame = f; } void SetFrame(const RFrame *f) { fFrame = f; }
void SetDrawOpts(const RPadDrawingOpts *opts) { fDrawOpts = opts; } void SetDrawOpts(const RPadDrawingOpts *opts) { fDrawOpts = opts; }
void SetSize(const RPadExtent *sz) { fSize = sz; } void SetSize(const RPadExtent *sz) { fSize = sz; }
void SetTitle(const std::string &title) { fTitle = title; }
PadPrimitives_t &GetPrimitives() { return fPrimitives; } PadPrimitives_t &GetPrimitives() { return fPrimitives; }
void Add(std::unique_ptr<RDisplayItem> &&item) { fPrimitives.push_back(std::move(item)); } void Add(std::unique_ptr<RDisplayItem> &&item) { fPrimitives.push_back(std::move(item)); }
void Clear() void Clear()
...@@ -51,6 +54,7 @@ public: ...@@ -51,6 +54,7 @@ public:
fFrame = nullptr; fFrame = nullptr;
fDrawOpts = nullptr; fDrawOpts = nullptr;
fSize = nullptr; fSize = nullptr;
fTitle.clear();
} }
}; };
......
...@@ -617,6 +617,7 @@ std::string ROOT::Experimental::TCanvasPainter::CreateSnapshot(const ROOT::Exper ...@@ -617,6 +617,7 @@ std::string ROOT::Experimental::TCanvasPainter::CreateSnapshot(const ROOT::Exper
PaintDrawables(can); PaintDrawables(can);
fPadDisplayItem->SetObjectID("canvas"); // for canvas itself use special id fPadDisplayItem->SetObjectID("canvas"); // for canvas itself use special id
fPadDisplayItem->SetTitle(can.GetTitle());
TString res = TBufferJSON::ToJSON(fPadDisplayItem.get(), 23); TString res = TBufferJSON::ToJSON(fPadDisplayItem.get(), 23);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment