Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
14 class TObject;
15 
16 namespace ROOT {
17 namespace Experimental {
18 
19 class 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 
29 class RObjectDrawable final : public RDrawable {
30 
31  Internal::RIOShared<TObject> fObj; ///< The object to be painted
32 
33  std::string fOpts; ///< drawing options
34 
35 protected:
36 
37  void CollectShared(Internal::RIOSharedVector_t &vect) final { vect.emplace_back(&fObj); }
38 
39  std::unique_ptr<RDisplayItem> Display() const override;
40 
41 public:
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