Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:35

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_RLine
0010 #define ROOT7_RLine
0011 
0012 #include <ROOT/ROnFrameDrawable.hxx>
0013 #include <ROOT/RAttrLine.hxx>
0014 #include <ROOT/RPadPos.hxx>
0015 
0016 #include <initializer_list>
0017 
0018 namespace ROOT {
0019 namespace Experimental {
0020 
0021 /** \class RLine
0022 \ingroup GrafROOT7
0023 \brief A simple line.
0024 \authors Olivier Couet <Olivier.Couet@cern.ch>, Sergey Linev <S.Linev@gsi.de>
0025 \date 2017-10-16
0026 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
0027 */
0028 
0029 class RLine : public ROnFrameDrawable {
0030 
0031    RPadPos fP1, fP2; ///< line begin/end
0032 public:
0033    RAttrLine line{this, "line"}; ///<! line attributes
0034 
0035    RLine() : ROnFrameDrawable("line") {}
0036 
0037    RLine(const RPadPos &p1, const RPadPos &p2) : RLine()
0038    {
0039       fP1 = p1;
0040       fP2 = p2;
0041    }
0042 
0043    RLine &SetP1(const RPadPos &p1)
0044    {
0045       fP1 = p1;
0046       return *this;
0047    }
0048 
0049    RLine &SetP2(const RPadPos &p2)
0050    {
0051       fP2 = p2;
0052       return *this;
0053    }
0054 
0055    const RPadPos &GetP1() const { return fP1; }
0056    const RPadPos &GetP2() const { return fP2; }
0057 };
0058 
0059 } // namespace Experimental
0060 } // namespace ROOT
0061 
0062 #endif