Back to home page

EIC code displayed by LXR

 
 

    


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

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_RBox
0010 #define ROOT7_RBox
0011 
0012 #include <ROOT/ROnFrameDrawable.hxx>
0013 #include <ROOT/RAttrFill.hxx>
0014 #include <ROOT/RAttrBorder.hxx>
0015 #include <ROOT/RPadPos.hxx>
0016 
0017 #include <initializer_list>
0018 
0019 namespace ROOT {
0020 namespace Experimental {
0021 
0022 /** \class RBox
0023 \ingroup GrafROOT7
0024 \brief A simple box.
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 welcome!
0028 */
0029 
0030 class RBox : public ROnFrameDrawable {
0031 
0032    RPadPos fP1, fP2;                                   ///< box corners coordinates
0033 
0034 protected:
0035    // constructor for derived classes
0036    RBox(const char *csstype) : ROnFrameDrawable(csstype) {}
0037 
0038 public:
0039 
0040    RAttrBorder border{this, "border"};            ///<! box border attributes
0041    RAttrFill fill{this, "fill"};                  ///<! box fill attributes
0042 
0043    RBox() : RBox("box") {}
0044 
0045    RBox(const RPadPos &p1, const RPadPos &p2) : RBox()
0046    {
0047       fP1 = p1;
0048       fP2 = p2;
0049    }
0050 
0051    RBox &SetP1(const RPadPos &p1) { fP1 = p1; return *this; }
0052    RBox &SetP2(const RPadPos &p2) { fP2 = p2; return *this; }
0053 
0054    const RPadPos &GetP1() const { return fP1; }
0055    const RPadPos &GetP2() const { return fP2; }
0056 };
0057 
0058 } // namespace Experimental
0059 } // namespace ROOT
0060 
0061 #endif