Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:35

0001 // Author:  Sergey Linev, GSI  10/04/2017
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_TWebPainting
0012 #define ROOT_TWebPainting
0013 
0014 #include "TObject.h"
0015 #include "TAttLine.h"
0016 #include "TAttFill.h"
0017 #include "TAttText.h"
0018 #include "TAttMarker.h"
0019 #include "TArrayF.h"
0020 
0021 class TColor;
0022 
0023 #include <string>
0024 
0025 class TWebPainting : public TObject {
0026 
0027    protected:
0028       std::string fOper;      ///< list of operations, separated by semicolons
0029       Int_t fSize{0};         ///<! filled buffer size
0030       TArrayF fBuf;           ///< array of points for all operations
0031       TAttLine fLastLine;     ///<! last line attributes
0032       TAttFill fLastFill;     ///<! last fill attributes
0033       TAttMarker fLastMarker; ///<! last marker attributes
0034 
0035    public:
0036 
0037       TWebPainting();
0038       ~TWebPainting() override = default;
0039 
0040       Bool_t IsEmpty() const { return fOper.empty() && (fBuf.GetSize() == 0); }
0041 
0042       void AddOper(const std::string &oper);
0043 
0044       void AddLineAttr(const TAttLine &attr);
0045       void AddFillAttr(const TAttFill &attr);
0046       void AddTextAttr(const TAttText &attr);
0047       void AddMarkerAttr(const TAttMarker &attr);
0048 
0049       Float_t *Reserve(Int_t sz);
0050 
0051       void AddColor(Int_t indx, TColor *col);
0052 
0053       // Set actual filled size
0054       void FixSize() { fBuf.Set(fSize); }
0055 
0056       static std::string MakeTextOper(const char *str);
0057 
0058 
0059    ClassDefOverride(TWebPainting, 1) // store for all paint operation of TVirtualPadPainter
0060 };
0061 
0062 #endif