// Author: Sergey Linev, GSI, 6/04/2017 /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TWebSnapshot #define ROOT_TWebSnapshot ////////////////////////////////////////////////////////////////////////// // // // TWebSnapshot // // // // Paint state of object to transfer to JavaScript side // // // ////////////////////////////////////////////////////////////////////////// #include "TObject.h" #include #include #include class TWebSnapshot : public TObject { protected: std::string fObjectID; ///< object identifier std::string fOption; ///< object draw option Int_t fKind{0}; ///< kind of snapshots TObject *fSnapshot{nullptr}; ///< snapshot data Bool_t fOwner{kFALSE}; ///> fPrimitives; ///< list of all primitives, drawn in the pad public: TPadWebSnapshot(bool readonly = true) { SetKind(kSubPad); fReadOnly = readonly; } void SetActive(bool on = true) { fActive = on; } bool IsReadOnly() const { return fReadOnly; } TWebSnapshot &NewPrimitive(TObject *obj = nullptr, const std::string &opt = ""); TPadWebSnapshot &NewSubPad(); TWebSnapshot &NewSpecials(); ClassDef(TPadWebSnapshot, 1) // Pad painting snapshot, used for JSROOT }; // ================================================================================= class TCanvasWebSnapshot : public TPadWebSnapshot { protected: Long64_t fVersion{0}; ///< actual canvas version std::string fScripts; ///< custom scripts to load public: TCanvasWebSnapshot() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300 TCanvasWebSnapshot(bool readonly, Long64_t v) : TPadWebSnapshot(readonly), fVersion(v) {} Long64_t GetVersion() const { return fVersion; } void SetScripts(const std::string &src) { fScripts = src; } ClassDef(TCanvasWebSnapshot, 1) // Canvas painting snapshot, used for JSROOT }; #endif