CbmRoot
CbmFlesCanvasTools.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmFlesCanvasTools -----
4 // ----- Created 22.10.2019 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmFlesCanvasTools_H
9 #define CbmFlesCanvasTools_H
10 
11 #include <string>
12 #include <vector>
13 
14 class TPad;
15 class TCanvas;
16 
17 class CanvasConfig {
18 public:
19  CanvasConfig();
20  CanvasConfig(std::string sName,
21  std::string sTitle,
22  uint32_t uNbPadsX,
23  uint32_t uNbPadsY);
24 
25  ~CanvasConfig();
26 
28  inline std::string GetName() const { return fsName; }
29  inline std::string GetTitle() const { return fsTitle; }
30  inline uint32_t GetNbPads() const { return fuNbPads; }
31  inline uint32_t GetNbPadsX() const { return fuNbPadsX; }
32  inline uint32_t GetNbPadsY() const { return fuNbPadsY; }
33  bool GetGridx(uint32_t uPadIdx) const;
34  bool GetGridy(uint32_t uPadIdx) const;
35  bool GetLogx(uint32_t uPadIdx) const;
36  bool GetLogy(uint32_t uPadIdx) const;
37  bool GetLogz(uint32_t uPadIdx) const;
38  uint32_t GetNbObjsInPad(uint32_t uPadIdx) const;
39  std::string GetObjName(uint32_t uPadIdx, uint32_t uObjIdx) const;
40  std::string GetOption(uint32_t uPadIdx, uint32_t uObjIdx) const;
41 
43  void SetNbPadsX(uint32_t uNbColumns);
44  void SetNbPadsY(uint32_t uNbRows);
45 
46  bool SetConfig(uint32_t uPadIdx,
47  bool bGridx,
48  bool bGridy,
49  bool bLogx,
50  bool bLogy,
51  bool bLogz,
52  std::vector<std::string> vsObjName,
53  std::vector<std::string> vsOptions);
54 
55 private:
56  std::string fsName;
57  std::string fsTitle;
58  uint32_t fuNbPads;
59  uint32_t fuNbPadsX;
60  uint32_t fuNbPadsY;
61 
62  std::vector<bool> fvbGridx;
63  std::vector<bool> fvbGridy;
64  std::vector<bool> fvbLogx;
65  std::vector<bool> fvbLogy;
66  std::vector<bool> fvbLogz;
67  std::vector<std::vector<std::string>> fvvsObjName;
68  std::vector<std::vector<std::string>> fvvsOptions;
69 
70  void ResizeFields();
71 };
72 
73 /**********************************************************************/
74 void GetNbPadsXY(TPad* pPad, uint32_t& uNbPadsX, uint32_t& uNbPadsY);
75 
79 std::string GenerateCanvasConfigString(TCanvas* pCanv);
81 CanvasConfig ExtractCanvasConfigFromString(std::string sFullConfig);
82 /**********************************************************************/
83 
84 #endif // CbmFlesCanvasTools_H
CanvasConfig::GetObjName
std::string GetObjName(uint32_t uPadIdx, uint32_t uObjIdx) const
Definition: CbmFlesCanvasTools.cxx:127
CanvasConfig::SetNbPadsX
void SetNbPadsX(uint32_t uNbColumns)
setters
Definition: CbmFlesCanvasTools.cxx:171
CanvasConfig::GetLogy
bool GetLogy(uint32_t uPadIdx) const
Definition: CbmFlesCanvasTools.cxx:91
ExtractCanvasConfigFromString
CanvasConfig ExtractCanvasConfigFromString(std::string sFullConfig)
Extraction.
Definition: CbmFlesCanvasTools.cxx:373
CanvasConfig::GetNbPadsY
uint32_t GetNbPadsY() const
Definition: CbmFlesCanvasTools.h:32
CanvasConfig::fsTitle
std::string fsTitle
Definition: CbmFlesCanvasTools.h:57
CanvasConfig::GetName
std::string GetName() const
accessors
Definition: CbmFlesCanvasTools.h:28
CanvasConfig::fvbLogx
std::vector< bool > fvbLogx
Definition: CbmFlesCanvasTools.h:64
CanvasConfig::SetConfig
bool SetConfig(uint32_t uPadIdx, bool bGridx, bool bGridy, bool bLogx, bool bLogy, bool bLogz, std::vector< std::string > vsObjName, std::vector< std::string > vsOptions)
Definition: CbmFlesCanvasTools.cxx:206
CanvasConfig::GetLogz
bool GetLogz(uint32_t uPadIdx) const
Definition: CbmFlesCanvasTools.cxx:103
CanvasConfig::fvbLogz
std::vector< bool > fvbLogz
Definition: CbmFlesCanvasTools.h:66
CanvasConfig
Definition: CbmFlesCanvasTools.h:17
CanvasConfig::GetNbObjsInPad
uint32_t GetNbObjsInPad(uint32_t uPadIdx) const
Definition: CbmFlesCanvasTools.cxx:115
CanvasConfig::GetTitle
std::string GetTitle() const
Definition: CbmFlesCanvasTools.h:29
CanvasConfig::SetNbPadsY
void SetNbPadsY(uint32_t uNbRows)
Definition: CbmFlesCanvasTools.cxx:188
CanvasConfig::fuNbPadsX
uint32_t fuNbPadsX
Definition: CbmFlesCanvasTools.h:59
CanvasConfig::fvbLogy
std::vector< bool > fvbLogy
Definition: CbmFlesCanvasTools.h:65
CanvasConfig::fvvsOptions
std::vector< std::vector< std::string > > fvvsOptions
Definition: CbmFlesCanvasTools.h:68
CanvasConfig::fvbGridx
std::vector< bool > fvbGridx
Definition: CbmFlesCanvasTools.h:62
CanvasConfig::fsName
std::string fsName
Definition: CbmFlesCanvasTools.h:56
CanvasConfig::GetOption
std::string GetOption(uint32_t uPadIdx, uint32_t uObjIdx) const
Definition: CbmFlesCanvasTools.cxx:148
CanvasConfig::fvbGridy
std::vector< bool > fvbGridy
Definition: CbmFlesCanvasTools.h:63
CanvasConfig::GetLogx
bool GetLogx(uint32_t uPadIdx) const
Definition: CbmFlesCanvasTools.cxx:79
CanvasConfig::~CanvasConfig
~CanvasConfig()
Definition: CbmFlesCanvasTools.cxx:39
CanvasConfig::GetNbPads
uint32_t GetNbPads() const
Definition: CbmFlesCanvasTools.h:30
CanvasConfig::GetGridy
bool GetGridy(uint32_t uPadIdx) const
Definition: CbmFlesCanvasTools.cxx:67
CanvasConfig::fuNbPads
uint32_t fuNbPads
Definition: CbmFlesCanvasTools.h:58
CanvasConfig::CanvasConfig
CanvasConfig()
Definition: CbmFlesCanvasTools.cxx:9
CanvasConfig::fvvsObjName
std::vector< std::vector< std::string > > fvvsObjName
Definition: CbmFlesCanvasTools.h:67
CanvasConfig::GetNbPadsX
uint32_t GetNbPadsX() const
Definition: CbmFlesCanvasTools.h:31
CanvasConfig::fuNbPadsY
uint32_t fuNbPadsY
Definition: CbmFlesCanvasTools.h:60
GenerateCanvasConfigString
std::string GenerateCanvasConfigString(TCanvas *pCanv)
Definition: CbmFlesCanvasTools.cxx:296
CanvasConfig::ResizeFields
void ResizeFields()
Definition: CbmFlesCanvasTools.cxx:233
GetNbPadsXY
void GetNbPadsXY(TPad *pPad, uint32_t &uNbPadsX, uint32_t &uNbPadsY)
Definition: CbmFlesCanvasTools.cxx:258
CanvasConfig::GetGridx
bool GetGridx(uint32_t uPadIdx) const
accessors
Definition: CbmFlesCanvasTools.cxx:55