Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RObjectDrawable.cxx
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 
10 
11 #include <ROOT/RDisplayItem.hxx>
12 #include <ROOT/RLogger.hxx>
13 #include <ROOT/RMenuItem.hxx>
14 
15 #include "TROOT.h"
16 
17 
18 #include <exception>
19 #include <sstream>
20 #include <iostream>
21 
22 
23 std::unique_ptr<ROOT::Experimental::RDisplayItem> ROOT::Experimental::RObjectDrawable::Display() const
24 {
25  return std::make_unique<RObjectDisplayItem>(fObj.get(), fOpts);
26 }
27 
28 void ROOT::Experimental::RObjectDrawable::PopulateMenu(RMenuItems &items)
29 {
30  // fill context menu items for the ROOT class
31  items.PopulateObjectMenu(fObj.get(), fObj.get()->IsA());
32 }
33 
34 void ROOT::Experimental::RObjectDrawable::Execute(const std::string &exec)
35 {
36  TObject *obj = fObj.get();
37 
38  std::stringstream cmd;
39  cmd << "((" << obj->ClassName() << "* ) " << std::hex << std::showbase << (size_t)obj << ")->" << exec << ";";
40  std::cout << "RObjectDrawable::Execute Obj " << obj->GetName() << "Cmd " << cmd.str() << std::endl;
41  gROOT->ProcessLine(cmd.str().c_str());
42 }
43 
44 
45