Logo ROOT  
Reference Guide
RObjectDrawable.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RObjectDrawable
10#define ROOT7_RObjectDrawable
11
12#include <ROOT/RDrawable.hxx>
13
14class TObject;
15
16namespace ROOT {
17namespace Experimental {
18
19class RPadBase;
20
21/** \class RObjectDrawable
22\ingroup GpadROOT7
23\brief Provides v7 drawing facilities for TObject types (TGraph etc).
24\author Sergey Linev
25\date 2017-05-31
26\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
27*/
28
29class RObjectDrawable final : public RDrawable {
30
31 Internal::RIOShared<TObject> fObj; ///< The object to be painted
32
33 std::string fOpts; ///< drawing options
34
35protected:
36
37 void CollectShared(Internal::RIOSharedVector_t &vect) final { vect.emplace_back(&fObj); }
38
39 std::unique_ptr<RDisplayItem> Display() const override;
40
41public:
42 RObjectDrawable() : RDrawable("tobject") {}
43
44 RObjectDrawable(const std::shared_ptr<TObject> &obj, const std::string &opt) : RDrawable("tobject"), fObj(obj), fOpts(opt) {}
45
46 /// Fill menu items for the object
47 void PopulateMenu(RMenuItems &) final;
48
49 /// Executes menu item
50 void Execute(const std::string &) final;
51};
52
53} // namespace Experimental
54} // namespace ROOT
55
56
57#endif
Base class for drawable entities: objects that can be painted on a RPad.
Definition: RDrawable.hxx:99
List of items for object context menu.
Definition: RMenuItem.hxx:151
Provides v7 drawing facilities for TObject types (TGraph etc).
std::string fOpts
drawing options
Internal::RIOShared< TObject > fObj
The object to be painted.
void Execute(const std::string &) final
Executes menu item.
std::unique_ptr< RDisplayItem > Display() const override
Creates display item for drawable By default item contains drawble data itself.
void PopulateMenu(RMenuItems &) final
Fill menu items for the object.
void CollectShared(Internal::RIOSharedVector_t &vect) final
RObjectDrawable(const std::shared_ptr< TObject > &obj, const std::string &opt)
Mother of all ROOT objects.
Definition: TObject.h:37
std::vector< RIOSharedBase * > RIOSharedVector_t
Definition: RDrawable.hxx:48
VSD Structures.
Definition: StringConv.hxx:21