BioDynaMo  v1.05.120-25dc9790
style.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef CORE_ANALYSIS_STYLE_H_
16 #define CORE_ANALYSIS_STYLE_H_
17 
18 #include "TStyle.h"
19 
20 namespace bdm {
21 namespace experimental {
22 
26 class Style : public TNamed,
27  public TAttLine,
28  public TAttFill,
29  public TAttMarker,
30  public TAttText {
31  public:
32  Style();
33  ~Style();
34  operator TStyle*() const;
35  TStyle* GetTStyle() const;
36 
37  private:
38  mutable TStyle* tstyle_ = nullptr;
39 
40  // The following attributes were copied from TStyle
41 
42  TAttAxis fXaxis;
43  TAttAxis fYaxis;
44  TAttAxis fZaxis;
45  Float_t fBarWidth;
46  Float_t fBarOffset;
47  Int_t fColorModelPS;
48  Int_t fDrawBorder;
49  Int_t fOptLogx;
50  Int_t fOptLogy;
51  Int_t fOptLogz;
52  Int_t fOptDate;
53  Int_t fOptStat;
54  Int_t fOptTitle;
55  Int_t fOptFile;
56  Int_t fOptFit;
58  Int_t fShowEditor;
59  Int_t fShowToolBar;
60 
62  TAttText fAttDate;
63  Float_t fDateX;
64  Float_t fDateY;
65  Float_t fEndErrorSize;
66  Float_t fErrorX;
67  Color_t fFuncColor;
68  Style_t fFuncStyle;
69  Width_t fFuncWidth;
70  Color_t fGridColor;
71  Style_t fGridStyle;
72  Width_t fGridWidth;
74  Color_t fLegendFillColor;
75  Style_t fLegendFont;
76  Double_t fLegendTextSize;
77  Int_t fHatchesLineWidth;
79  Double_t fHatchesSpacing;
80  Color_t fFrameFillColor;
81  Color_t fFrameLineColor;
82  Style_t fFrameFillStyle;
83  Style_t fFrameLineStyle;
84  Width_t fFrameLineWidth;
85  Width_t fFrameBorderSize;
87  Color_t fHistFillColor;
88  Color_t fHistLineColor;
89  Style_t fHistFillStyle;
90  Style_t fHistLineStyle;
91  Width_t fHistLineWidth;
93  Double_t fHistTopMargin;
95  Bool_t fCanvasPreferGL;
96  Color_t fCanvasColor;
99  Int_t fCanvasDefH;
100  Int_t fCanvasDefW;
101  Int_t fCanvasDefX;
102  Int_t fCanvasDefY;
103  Color_t fPadColor;
104  Width_t fPadBorderSize;
107  Float_t fPadTopMargin;
108  Float_t fPadLeftMargin;
109  Float_t fPadRightMargin;
110  Bool_t fPadGridX;
111  Bool_t fPadGridY;
112  Int_t fPadTickX;
113  Int_t fPadTickY;
114  Float_t fPaperSizeX;
115  Float_t fPaperSizeY;
116  Float_t
118  Color_t fStatColor;
119  Color_t fStatTextColor;
120  Width_t fStatBorderSize;
121  Style_t fStatFont;
122  Float_t
124  Style_t fStatStyle;
125  TString fStatFormat;
126  Float_t fStatX;
127  Float_t fStatY;
128  Float_t fStatW;
129  Float_t fStatH;
130  Bool_t fStripDecimals;
131  Int_t fTitleAlign;
132  Color_t fTitleColor;
133  Color_t fTitleTextColor;
135  Style_t fTitleFont;
136  Float_t
138  Style_t fTitleStyle;
139  Float_t fTitleX;
140  Float_t fTitleY;
141  Float_t fTitleW;
142  Float_t fTitleH;
143  Float_t fLegoInnerR;
144  // This is the attribute that causes problems
145  // TString fLineStyle[30]; ///< String describing line style i (for
146  // postScript)
147  TString fHeaderPS;
148  TString fTitlePS;
149  TString fFitFormat;
151  Float_t fLineScalePS;
152  Int_t fJoinLinePS;
153  Int_t fCapLinePS;
155  Double_t fTimeOffset;
157  Float_t fImageScaling;
158 
160  void ToTStyle() const;
161  void FromTStyle(TStyle* style);
162 
163  ClassDefNV(Style, 1);
164 };
165 
166 } // namespace experimental
167 } // namespace bdm
168 
169 #endif // CORE_ANALYSIS_STYLE_H_
bdm::experimental::Style::fImageScaling
Float_t fImageScaling
Definition: style.h:157
bdm::experimental::Style::fCanvasDefY
Int_t fCanvasDefY
Default canvas top Y position.
Definition: style.h:102
bdm::experimental::Style::fNumberContours
Int_t fNumberContours
Default number of contours for 2-d plots.
Definition: style.h:61
bdm::experimental::Style::fStatFormat
TString fStatFormat
Printing format for stats.
Definition: style.h:125
bdm::experimental::Style::FromTStyle
void FromTStyle(TStyle *style)
Definition: style.cc:194
bdm::experimental::Style::fLegendTextSize
Double_t fLegendTextSize
Definition: style.h:76
bdm::experimental::Style::fPadBottomMargin
Float_t fPadBottomMargin
Pad bottom margin.
Definition: style.h:106
bdm::experimental::Style::fFrameLineWidth
Width_t fFrameLineWidth
Pad frame line width.
Definition: style.h:84
bdm::experimental::Style::fHistFillColor
Color_t fHistFillColor
Histogram fill color.
Definition: style.h:87
bdm::experimental::Style::fStatY
Float_t fStatY
Y position of top right corner of stat box.
Definition: style.h:127
bdm::experimental::Style::fGridStyle
Style_t fGridStyle
Grid line style.
Definition: style.h:71
bdm::experimental::Style::fCanvasDefW
Int_t fCanvasDefW
Default canvas width.
Definition: style.h:100
bdm::experimental::Style::fTitlePS
TString fTitlePS
User defined Postscript file title.
Definition: style.h:148
bdm::experimental::Style::fHistLineWidth
Width_t fHistLineWidth
Histogram line width.
Definition: style.h:91
bdm::experimental::Style::fOptTitle
Int_t fOptTitle
True if option Title is selected.
Definition: style.h:54
bdm
Definition: agent.cc:39
bdm::experimental::Style::fHistTopMargin
Double_t fHistTopMargin
Margin between histogram's top and pad's top.
Definition: style.h:94
bdm::experimental::Style::fFuncColor
Color_t fFuncColor
Function color.
Definition: style.h:67
bdm::experimental::Style::fPadBorderMode
Int_t fPadBorderMode
Pad border mode.
Definition: style.h:105
bdm::experimental::Style::fLegendFillColor
Color_t fLegendFillColor
Legend fill color.
Definition: style.h:74
bdm::experimental::Style::fPadColor
Color_t fPadColor
Pad color.
Definition: style.h:103
bdm::experimental::Style::fStatFontSize
Float_t fStatFontSize
Font size in pixels for fonts with precision type 3.
Definition: style.h:123
bdm::experimental::Style::fScreenFactor
Float_t fScreenFactor
Multiplication factor for canvas size and position.
Definition: style.h:117
bdm::experimental::Style::fDrawBorder
Int_t fDrawBorder
Flag to draw border(=1) or not (0)
Definition: style.h:48
bdm::experimental::Style::fFitFormat
TString fFitFormat
Printing format for fit parameters.
Definition: style.h:149
bdm::experimental::Style::fBarOffset
Float_t fBarOffset
Offset of bar for graphs.
Definition: style.h:46
bdm::experimental::Style::fPadBorderSize
Width_t fPadBorderSize
Pad border size.
Definition: style.h:104
bdm::experimental::Style::fOptLogx
Int_t fOptLogx
True if log scale in X.
Definition: style.h:49
bdm::experimental::Style::ClassDefNV
ClassDefNV(Style, 1)
bdm::experimental::Style::fHatchesSpacing
Double_t fHatchesSpacing
Hatches spacing for hatch styles > 3100.
Definition: style.h:79
bdm::experimental::Style::fShowEventStatus
Int_t fShowEventStatus
Show event status panel.
Definition: style.h:57
bdm::experimental::Style::fTitleW
Float_t fTitleW
Width of title box.
Definition: style.h:141
bdm::experimental::Style::fDateX
Float_t fDateX
X position of the date in the canvas (in NDC)
Definition: style.h:63
bdm::experimental::Style::fBarWidth
Float_t fBarWidth
Width of bar for graphs.
Definition: style.h:45
bdm::experimental::Style::fLegendFont
Style_t fLegendFont
Legend font style.
Definition: style.h:75
bdm::experimental::Style::fJoinLinePS
Int_t fJoinLinePS
Definition: style.h:152
bdm::experimental::Style::fTimeOffset
Double_t fTimeOffset
Time offset to the beginning of an axis.
Definition: style.h:156
bdm::experimental::Style::fOptLogy
Int_t fOptLogy
True if log scale in y.
Definition: style.h:50
bdm::experimental::Style::fAttDate
TAttText fAttDate
Canvas date attribute.
Definition: style.h:62
bdm::experimental::Style::Style
Style()
Definition: style.cc:21
bdm::experimental::Style::fPadLeftMargin
Float_t fPadLeftMargin
Pad left margin.
Definition: style.h:108
bdm::experimental::Style::fLegendBorderSize
Width_t fLegendBorderSize
Legend box border size.
Definition: style.h:73
bdm::experimental::Style::fFrameBorderMode
Int_t fFrameBorderMode
Pad frame border mode.
Definition: style.h:86
bdm::experimental::Style::fGridWidth
Width_t fGridWidth
Grid line width.
Definition: style.h:72
bdm::experimental::Style
Definition: style.h:26
bdm::experimental::Style::fPaperSizeX
Float_t fPaperSizeX
PostScript paper size along X.
Definition: style.h:114
bdm::experimental::Style::fHistFillStyle
Style_t fHistFillStyle
Histogram fill style.
Definition: style.h:89
bdm::experimental::Style::fCanvasColor
Color_t fCanvasColor
Canvas color.
Definition: style.h:96
bdm::experimental::Style::fPadGridX
Bool_t fPadGridX
True to get the grid along X.
Definition: style.h:110
bdm::experimental::Style::fFrameBorderSize
Width_t fFrameBorderSize
Pad frame border size.
Definition: style.h:85
bdm::experimental::Style::fPadRightMargin
Float_t fPadRightMargin
Pad right margin.
Definition: style.h:109
bdm::experimental::Style::fCanvasPreferGL
Bool_t fCanvasPreferGL
If true, rendering in canvas is with GL.
Definition: style.h:95
bdm::experimental::Style::fStatFont
Style_t fStatFont
Font style of Stats PaveLabel.
Definition: style.h:121
bdm::experimental::Style::fOptFit
Int_t fOptFit
True if option Fit is selected.
Definition: style.h:56
bdm::experimental::Style::fYaxis
TAttAxis fYaxis
Y axis attributes.
Definition: style.h:43
bdm::experimental::Style::fHistMinimumZero
Bool_t fHistMinimumZero
Definition: style.h:92
bdm::experimental::Style::fPadGridY
Bool_t fPadGridY
True to get the grid along Y.
Definition: style.h:111
bdm::experimental::Style::fStripDecimals
Bool_t fStripDecimals
Strip decimals in axis labels.
Definition: style.h:130
bdm::experimental::Style::fHeaderPS
TString fHeaderPS
User defined additional Postscript header.
Definition: style.h:147
bdm::experimental::Style::fPadTopMargin
Float_t fPadTopMargin
Pad top margin.
Definition: style.h:107
bdm::experimental::Style::fTitleX
Float_t fTitleX
X position of top left corner of title box.
Definition: style.h:139
bdm::experimental::Style::fOptFile
Int_t fOptFile
True if option File is selected.
Definition: style.h:55
bdm::experimental::Style::fFrameLineStyle
Style_t fFrameLineStyle
Pad frame line style.
Definition: style.h:83
bdm::experimental::Style::fLegoInnerR
Float_t fLegoInnerR
Inner radius for cylindrical legos.
Definition: style.h:143
bdm::experimental::Style::ToTStyle
void ToTStyle() const
Definition: style.cc:45
bdm::experimental::Style::fErrorX
Float_t fErrorX
Per cent of bin width for errors along X.
Definition: style.h:66
bdm::experimental::Style::fTitleColor
Color_t fTitleColor
Title fill area color.
Definition: style.h:132
bdm::experimental::Style::fTitleAlign
Int_t fTitleAlign
Title box alignment.
Definition: style.h:131
bdm::experimental::Style::fStatColor
Color_t fStatColor
Stat fill area color.
Definition: style.h:118
bdm::experimental::Style::fFrameFillStyle
Style_t fFrameFillStyle
Pad frame fill style.
Definition: style.h:82
bdm::experimental::Style::fCanvasBorderMode
Int_t fCanvasBorderMode
Canvas border mode.
Definition: style.h:98
bdm::experimental::Style::fEndErrorSize
Float_t fEndErrorSize
Size of lines at the end of error bars.
Definition: style.h:65
bdm::experimental::Style::fTitleBorderSize
Width_t fTitleBorderSize
Border size of Title PavelLabel.
Definition: style.h:134
bdm::experimental::Style::fCanvasBorderSize
Width_t fCanvasBorderSize
Canvas border size.
Definition: style.h:97
bdm::experimental::Style::fShowToolBar
Int_t fShowToolBar
Show toolbar.
Definition: style.h:59
bdm::experimental::Style::fColorModelPS
Int_t fColorModelPS
PostScript color model: 0 = RGB, 1 = CMYK.
Definition: style.h:47
bdm::experimental::Style::fTitleFont
Style_t fTitleFont
Font style of Title PaveLabel.
Definition: style.h:135
bdm::experimental::Style::~Style
~Style()
Definition: style.cc:26
bdm::experimental::Style::GetTStyle
TStyle * GetTStyle() const
Definition: style.cc:33
bdm::experimental::Style::fTitleY
Float_t fTitleY
Y position of top left corner of title box.
Definition: style.h:140
bdm::experimental::Style::fHistLineColor
Color_t fHistLineColor
Histogram line color.
Definition: style.h:88
bdm::experimental::Style::fTitleFontSize
Float_t fTitleFontSize
Font size in pixels for fonts with precision type 3.
Definition: style.h:137
bdm::experimental::Style::fTitleH
Float_t fTitleH
Height of title box.
Definition: style.h:142
bdm::experimental::Style::fFuncWidth
Width_t fFuncWidth
Function line width.
Definition: style.h:69
bdm::experimental::Style::fPaintTextFormat
TString fPaintTextFormat
Printing format for TH2::PaintText.
Definition: style.h:150
bdm::experimental::Style::fTitleStyle
Style_t fTitleStyle
Fill area style of title PaveLabel.
Definition: style.h:138
bdm::experimental::Style::fCanvasDefH
Int_t fCanvasDefH
Default canvas height.
Definition: style.h:99
bdm::experimental::Style::fStatH
Float_t fStatH
Height of stat box.
Definition: style.h:129
bdm::experimental::Style::fStatX
Float_t fStatX
X position of top right corner of stat box.
Definition: style.h:126
bdm::experimental::Style::fFrameLineColor
Color_t fFrameLineColor
Pad frame line color.
Definition: style.h:81
bdm::experimental::Style::fPaperSizeY
Float_t fPaperSizeY
PostScript paper size along Y.
Definition: style.h:115
bdm::experimental::Style::fHatchesLineWidth
Int_t fHatchesLineWidth
Hatches line width for hatch styles > 3100.
Definition: style.h:78
bdm::experimental::Style::fFrameFillColor
Color_t fFrameFillColor
Pad frame fill color.
Definition: style.h:80
bdm::experimental::Style::fOptLogz
Int_t fOptLogz
True if log scale in z.
Definition: style.h:51
bdm::experimental::Style::fFuncStyle
Style_t fFuncStyle
Function style.
Definition: style.h:68
bdm::experimental::Style::fLineScalePS
Float_t fLineScalePS
Line scale factor when drawing lines on Postscript.
Definition: style.h:151
bdm::experimental::Style::fPadTickY
Int_t fPadTickY
True to set special pad ticks along Y.
Definition: style.h:113
bdm::experimental::Style::tstyle_
TStyle * tstyle_
Definition: style.h:38
bdm::experimental::Style::fStatTextColor
Color_t fStatTextColor
Stat text color.
Definition: style.h:119
bdm::experimental::Style::fHistLineStyle
Style_t fHistLineStyle
Histogram line style.
Definition: style.h:90
bdm::experimental::Style::fStatW
Float_t fStatW
Width of stat box.
Definition: style.h:128
bdm::experimental::Style::fGridColor
Color_t fGridColor
Grid line color (if 0 use axis line color)
Definition: style.h:70
bdm::experimental::Style::fStatBorderSize
Width_t fStatBorderSize
Border size of Stats PaveLabel.
Definition: style.h:120
bdm::experimental::Style::fDateY
Float_t fDateY
Y position of the date in the canvas (in NDC)
Definition: style.h:64
bdm::experimental::Style::fCanvasDefX
Int_t fCanvasDefX
Default canvas top X position.
Definition: style.h:101
bdm::experimental::Style::fOptDate
Int_t fOptDate
True if date option is selected.
Definition: style.h:52
bdm::experimental::Style::fShowEditor
Int_t fShowEditor
Show pad editor.
Definition: style.h:58
bdm::experimental::Style::fPadTickX
Int_t fPadTickX
True to set special pad ticks along X.
Definition: style.h:112
bdm::experimental::Style::fCapLinePS
Int_t fCapLinePS
Definition: style.h:154
bdm::experimental::Style::fXaxis
TAttAxis fXaxis
X axis attributes.
Definition: style.h:42
bdm::experimental::Style::fStatStyle
Style_t fStatStyle
Fill area style of Stats PaveLabel.
Definition: style.h:124
bdm::experimental::Style::fTitleTextColor
Color_t fTitleTextColor
Title text color.
Definition: style.h:133
bdm::experimental::Style::fZaxis
TAttAxis fZaxis
Z axis attributes.
Definition: style.h:44
bdm::experimental::Style::fOptStat
Int_t fOptStat
True if option Stat is selected.
Definition: style.h:53