Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 09:10:07

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 fClassName; ///< class name of object produced this painting
0029       std::string fObjectName; ///< object name
0030       std::string fOper;      ///< list of operations, separated by semicolons
0031       Int_t fSize{0};         ///<! filled buffer size
0032       TArrayF fBuf;           ///< array of points for all operations
0033       TAttLine fLastLine;     ///<! last line attributes
0034       TAttFill fLastFill;     ///<! last fill attributes
0035       TAttMarker fLastMarker; ///<! last marker attributes
0036 
0037    public:
0038 
0039       TWebPainting();
0040       ~TWebPainting() override = default;
0041 
0042       void SetClassName(const std::string &classname) { fClassName = classname; }
0043       const std::string &GetClassName() const { return fClassName; }
0044 
0045       void SetObjectName(const std::string &objname) { fObjectName = objname; }
0046       const std::string &GetObjectName() const { return fObjectName; }
0047 
0048       Bool_t IsEmpty() const { return fOper.empty() && (fBuf.GetSize() == 0); }
0049 
0050       void AddOper(const std::string &oper);
0051 
0052       void AddLineAttr(const TAttLine &attr);
0053       void AddFillAttr(const TAttFill &attr);
0054       void AddTextAttr(const TAttText &attr);
0055       void AddMarkerAttr(const TAttMarker &attr);
0056 
0057       Float_t *Reserve(Int_t sz);
0058 
0059       void AddColor(Int_t indx, TColor *col);
0060 
0061       // Set actual filled size
0062       void FixSize() { fBuf.Set(fSize); }
0063 
0064       static std::string MakeTextOper(const char *str);
0065 
0066 
0067    ClassDefOverride(TWebPainting, 2) // store for all paint operation of TVirtualPadPainter
0068 };
0069 
0070 #endif