Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:48

0001 /*************************************************************************
0002  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 #ifndef ROOT7_RText
0010 #define ROOT7_RText
0011 
0012 #include <ROOT/ROnFrameDrawable.hxx>
0013 #include <ROOT/RAttrText.hxx>
0014 #include <ROOT/RPadPos.hxx>
0015 
0016 #include <initializer_list>
0017 #include <string>
0018 
0019 namespace ROOT {
0020 namespace Experimental {
0021 
0022 /** \class ROOT::Experimental::RText
0023 \ingroup GrafROOT7
0024 \brief A text.
0025 \author Olivier Couet <Olivier.Couet@cern.ch>
0026 \date 2017-10-16
0027 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is
0028 welcome!
0029 */
0030 
0031 class RText : public ROnFrameDrawable {
0032 
0033    std::string fText;                                  ///< text to display
0034    RPadPos fPos;                                       ///< position
0035 
0036 public:
0037    RAttrText text{this, "text"};                  ///<! text attributes
0038 
0039    RText() : ROnFrameDrawable("text") {}
0040 
0041    RText(const std::string &txt) : RText() { fText = txt; }
0042 
0043    RText(const RPadPos &p, const std::string &txt) : RText()
0044    {
0045       fText = txt;
0046       fPos = p;
0047    }
0048 
0049    RText &SetText(const std::string &t) { fText = t; return *this; }
0050    const std::string &GetText() const { return fText; }
0051 
0052    RText &SetPos(const RPadPos &p) { fPos = p; return *this; }
0053    const RPadPos &GetPos() const { return fPos; }
0054 };
0055 
0056 } // namespace Experimental
0057 } // namespace ROOT
0058 
0059 #endif