CbmRoot
Loading...
Searching...
No Matches
CbmFlesCanvasTools.h
Go to the documentation of this file.
1/* Copyright (C) 2019 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmFlesCanvasTools -----
8// ----- Created 22.10.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmFlesCanvasTools_H
13#define CbmFlesCanvasTools_H
14
15#include <cstdint>
16#include <string>
17#include <vector>
18
19class TPad;
20class TCanvas;
21
23 public:
25 CanvasConfig(std::string sName, std::string sTitle, uint32_t uNbPadsX, uint32_t uNbPadsY);
26
28
30 inline std::string GetName() const { return fsName; }
31 inline std::string GetTitle() const { return fsTitle; }
32 inline uint32_t GetNbPads() const { return fuNbPads; }
33 inline uint32_t GetNbPadsX() const { return fuNbPadsX; }
34 inline uint32_t GetNbPadsY() const { return fuNbPadsY; }
35 bool GetGridx(uint32_t uPadIdx) const;
36 bool GetGridy(uint32_t uPadIdx) const;
37 bool GetLogx(uint32_t uPadIdx) const;
38 bool GetLogy(uint32_t uPadIdx) const;
39 bool GetLogz(uint32_t uPadIdx) const;
40 uint32_t GetNbObjsInPad(uint32_t uPadIdx) const;
41 std::string GetObjName(uint32_t uPadIdx, uint32_t uObjIdx) const;
42 std::string GetOption(uint32_t uPadIdx, uint32_t uObjIdx) const;
43
45 void SetNbPadsX(uint32_t uNbColumns);
46 void SetNbPadsY(uint32_t uNbRows);
47
48 bool SetConfig(uint32_t uPadIdx, bool bGridx, bool bGridy, bool bLogx, bool bLogy, bool bLogz,
49 std::vector<std::string> vsObjName, std::vector<std::string> vsOptions);
50
51 private:
52 std::string fsName;
53 std::string fsTitle;
54 uint32_t fuNbPads;
55 uint32_t fuNbPadsX;
56 uint32_t fuNbPadsY;
57
58 std::vector<bool> fvbGridx;
59 std::vector<bool> fvbGridy;
60 std::vector<bool> fvbLogx;
61 std::vector<bool> fvbLogy;
62 std::vector<bool> fvbLogz;
63 std::vector<std::vector<std::string>> fvvsObjName;
64 std::vector<std::vector<std::string>> fvvsOptions;
65
66 void ResizeFields();
67};
68
69/**********************************************************************/
70void GetNbPadsXY(TPad* pPad, uint32_t& uNbPadsX, uint32_t& uNbPadsY);
71
75std::string GenerateCanvasConfigString(TCanvas* pCanv);
77CanvasConfig ExtractCanvasConfigFromString(std::string sFullConfig);
78/**********************************************************************/
79
80#endif // CbmFlesCanvasTools_H
std::string GenerateCanvasConfigString(TCanvas *pCanv)
void GetNbPadsXY(TPad *pPad, uint32_t &uNbPadsX, uint32_t &uNbPadsY)
CanvasConfig ExtractCanvasConfigFromString(std::string sFullConfig)
Extraction.
uint32_t GetNbPadsY() const
bool GetLogz(uint32_t uPadIdx) const
std::vector< bool > fvbLogx
std::vector< bool > fvbLogz
void SetNbPadsX(uint32_t uNbColumns)
setters
std::string fsTitle
std::vector< std::vector< std::string > > fvvsOptions
bool GetGridy(uint32_t uPadIdx) const
bool GetLogy(uint32_t uPadIdx) const
std::string GetOption(uint32_t uPadIdx, uint32_t uObjIdx) const
std::string GetTitle() const
std::string GetName() const
accessors
void SetNbPadsY(uint32_t uNbRows)
std::vector< bool > fvbGridx
std::vector< bool > fvbLogy
std::vector< std::vector< std::string > > fvvsObjName
std::string fsName
bool GetLogx(uint32_t uPadIdx) const
uint32_t GetNbObjsInPad(uint32_t uPadIdx) const
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)
bool GetGridx(uint32_t uPadIdx) const
accessors
uint32_t GetNbPadsX() const
std::vector< bool > fvbGridy
std::string GetObjName(uint32_t uPadIdx, uint32_t uObjIdx) const
uint32_t GetNbPads() const