Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*************************************************************************
0002  * Copyright (C) 1995-2020, 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_RAxisDrawable
0010 #define ROOT7_RAxisDrawable
0011 
0012 #include <ROOT/RDrawable.hxx>
0013 #include <ROOT/RAttrAxis.hxx>
0014 #include <ROOT/RPadPos.hxx>
0015 #include <ROOT/RPadLength.hxx>
0016 #include <ROOT/RLogger.hxx>
0017 
0018 #include <vector>
0019 #include <string>
0020 
0021 namespace ROOT {
0022 namespace Experimental {
0023 
0024 /** \class RAxisDrawable
0025 \ingroup GrafROOT7
0026 \brief Axis drawing
0027 \author Sergey Linev <S.Linev@gsi.de>
0028 \date 2020-11-03
0029 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
0030 */
0031 
0032 class RAxisDrawable : public RDrawable {
0033 
0034    RPadPos fPos;                          ///< axis start point
0035    bool fVertical{false};                 ///< is vertical axis
0036    RPadLength fLength;                    ///< axis length
0037    std::vector<std::string> fLabels;      ///< axis labels
0038 
0039 public:
0040 
0041    RAttrAxis axis{this, "axis"};     ///<! axis attributes
0042 
0043    RAxisDrawable() : RDrawable("axis") {}
0044 
0045    RAxisDrawable(const RPadPos &pos, bool vertical, const RPadLength &len) : RAxisDrawable()
0046    {
0047       SetPos(pos);
0048       SetVertical(vertical);
0049       SetLength(len);
0050    }
0051 
0052    RAxisDrawable &SetPos(const RPadPos &pos) { fPos = pos; return *this; }
0053    RAxisDrawable &SetVertical(bool vertical = true) { fVertical = vertical; return *this; }
0054    RAxisDrawable &SetLength(const RPadLength &len) { fLength = len; return *this; }
0055    RAxisDrawable &SetLabels(const std::vector<std::string> &lbls) { fLabels = lbls; return *this; }
0056 
0057    bool IsVertical() const { return fVertical; }
0058    const RPadPos& GetPos() const { return fPos; }
0059    const RPadLength& GetLength() const { return fLength; }
0060    const std::vector<std::string> &GetLabels() const { return fLabels; }
0061 };
0062 
0063 
0064 
0065 } // namespace Experimental
0066 } // namespace ROOT
0067 
0068 #endif