Geant4-11
Public Member Functions | Private Attributes | Static Private Attributes
G4PlotParameters Class Reference

#include <G4PlotParameters.hh>

Public Member Functions

 G4PlotParameters ()
 
G4String GetAvailableStyles ()
 
G4int GetColumns () const
 
G4int GetHeight () const
 
G4int GetMaxColumns ()
 
G4int GetMaxRows ()
 
G4int GetRows () const
 
G4float GetScale () const
 
G4String GetStyle () const
 
G4int GetWidth () const
 
void SetDimensions (G4int width, G4int height)
 
void SetLayout (G4int columns, G4int rows)
 
void SetStyle (const G4String &style)
 

Private Attributes

G4String fAvailableStyles
 
G4int fColumns { fkDefaultColumns }
 
G4String fDefaultStyle
 
G4int fHeight { fkDefaultHeight }
 
std::unique_ptr< G4PlotMessengerfMessenger
 
G4int fRows { fkDefaultRows }
 
G4float fScale { fkDefaultScale }
 
G4String fStyle
 
G4int fWidth { fkDefaultWidth }
 

Static Private Attributes

static constexpr std::string_view fkClass { "G4PlotParameters" }
 
static constexpr G4int fkDefaultColumns { 1 }
 
static constexpr G4int fkDefaultHeight { static_cast<G4int>(29.7f/21.0f*fkLRDefaultWidth) }
 
static constexpr G4int fkDefaultRows { 2 }
 
static constexpr G4float fkDefaultScale { 0.9f }
 
static constexpr G4int fkDefaultWidth { fkLRDefaultWidth }
 
static constexpr G4int fkHRDefaultWidth { 2000 }
 
static constexpr G4int fkLRDefaultWidth { 700 }
 
static constexpr G4int fkMaxColumns { 2 }
 
static constexpr G4int fkMaxRows { 3 }
 

Detailed Description

Definition at line 41 of file G4PlotParameters.hh.

Constructor & Destructor Documentation

◆ G4PlotParameters()

G4PlotParameters::G4PlotParameters ( )

Definition at line 38 of file G4PlotParameters.cc.

39 : fMessenger(nullptr),
40#if defined(TOOLS_USE_FREETYPE)
41 fDefaultStyle("ROOT_default"),
42 fAvailableStyles("ROOT_default hippodrow inlib_default"),
43#else
44 fDefaultStyle("inlib_default"),
45 fAvailableStyles("inlib_default"),
46#endif
48{
49 fMessenger = std::make_unique<G4PlotMessenger>(this);
50}
std::unique_ptr< G4PlotMessenger > fMessenger

References fMessenger.

Member Function Documentation

◆ GetAvailableStyles()

G4String G4PlotParameters::GetAvailableStyles ( )
inline

Definition at line 110 of file G4PlotParameters.hh.

111{ return fAvailableStyles; }

References fAvailableStyles.

Referenced by G4PlotMessenger::SetStyleCmd().

◆ GetColumns()

G4int G4PlotParameters::GetColumns ( ) const
inline

◆ GetHeight()

G4int G4PlotParameters::GetHeight ( ) const
inline

Definition at line 122 of file G4PlotParameters.hh.

123{ return fHeight; }

References fHeight.

Referenced by G4PlotManager::G4PlotManager().

◆ GetMaxColumns()

G4int G4PlotParameters::GetMaxColumns ( )
inline

Definition at line 104 of file G4PlotParameters.hh.

105{ return fkMaxColumns; }
static constexpr G4int fkMaxColumns

References fkMaxColumns.

Referenced by G4PlotMessenger::SetLayoutCmd().

◆ GetMaxRows()

G4int G4PlotParameters::GetMaxRows ( )
inline

Definition at line 107 of file G4PlotParameters.hh.

108{ return fkMaxRows; }
static constexpr G4int fkMaxRows

References fkMaxRows.

Referenced by G4PlotMessenger::SetLayoutCmd().

◆ GetRows()

G4int G4PlotParameters::GetRows ( ) const
inline

◆ GetScale()

G4float G4PlotParameters::GetScale ( ) const
inline

Definition at line 125 of file G4PlotParameters.hh.

126{ return fScale; }

References fScale.

Referenced by G4PlotManager::WritePage().

◆ GetStyle()

G4String G4PlotParameters::GetStyle ( ) const
inline

Definition at line 128 of file G4PlotParameters.hh.

129{ return fStyle; }

References fStyle.

Referenced by G4PlotManager::PlotAndWrite().

◆ GetWidth()

G4int G4PlotParameters::GetWidth ( ) const
inline

Definition at line 119 of file G4PlotParameters.hh.

120{ return fWidth; }

References fWidth.

Referenced by G4PlotManager::G4PlotManager().

◆ SetDimensions()

void G4PlotParameters::SetDimensions ( G4int  width,
G4int  height 
)

Definition at line 75 of file G4PlotParameters.cc.

76{
77 fWidth = width;
78 fHeight = height;
79}

References fHeight, and fWidth.

Referenced by G4PlotMessenger::SetNewValue().

◆ SetLayout()

void G4PlotParameters::SetLayout ( G4int  columns,
G4int  rows 
)

Definition at line 57 of file G4PlotParameters.cc.

58{
59 if ( columns > rows ||
60 columns < 1 || columns > fkMaxColumns ||
61 rows < 1 || rows > fkMaxRows ) {
62 Warn("Layout: " + to_string(columns) + " x " + to_string(rows) +
63 " was ignored.\n"
64 "Supported layouts (columns <= rows): \n" +
65 " columns = 1 .. " + to_string(fkMaxColumns) + "\n" +
66 " rows = 1 .. " + to_string(fkMaxRows),
67 fkClass, "SetLayout");
68 return;
69 }
70 fColumns = columns;
71 fRows = rows;
72}
static constexpr std::string_view fkClass
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)

References fColumns, fkClass, fkMaxColumns, fkMaxRows, fRows, and G4Analysis::Warn().

Referenced by G4PlotMessenger::SetNewValue().

◆ SetStyle()

void G4PlotParameters::SetStyle ( const G4String style)

Definition at line 82 of file G4PlotParameters.cc.

83{
84// Set style and update scale according to the style selected
85
86 if ( fAvailableStyles.find(style) == std::string::npos ) {
87 Warn("Style: " + style + " was ignored.\n" +
88 "Supported styles: " + fAvailableStyles,
89 fkClass, "SetStyle");
90 return;
91 }
92
93 fStyle = style;
94
95 if ( fStyle == "ROOT_default" ) {
97 } else {
98 fScale = 1.f;
99 }
100}
static constexpr G4float fkDefaultScale

References fAvailableStyles, fkClass, fkDefaultScale, fScale, fStyle, and G4Analysis::Warn().

Referenced by G4PlotMessenger::SetNewValue().

Field Documentation

◆ fAvailableStyles

G4String G4PlotParameters::fAvailableStyles
private

Definition at line 92 of file G4PlotParameters.hh.

Referenced by GetAvailableStyles(), and SetStyle().

◆ fColumns

G4int G4PlotParameters::fColumns { fkDefaultColumns }
private

Definition at line 94 of file G4PlotParameters.hh.

Referenced by GetColumns(), and SetLayout().

◆ fDefaultStyle

G4String G4PlotParameters::fDefaultStyle
private

Definition at line 91 of file G4PlotParameters.hh.

◆ fHeight

G4int G4PlotParameters::fHeight { fkDefaultHeight }
private

Definition at line 97 of file G4PlotParameters.hh.

Referenced by GetHeight(), and SetDimensions().

◆ fkClass

constexpr std::string_view G4PlotParameters::fkClass { "G4PlotParameters" }
staticconstexprprivate

Definition at line 66 of file G4PlotParameters.hh.

Referenced by SetLayout(), and SetStyle().

◆ fkDefaultColumns

constexpr G4int G4PlotParameters::fkDefaultColumns { 1 }
staticconstexprprivate

Definition at line 69 of file G4PlotParameters.hh.

◆ fkDefaultHeight

constexpr G4int G4PlotParameters::fkDefaultHeight { static_cast<G4int>(29.7f/21.0f*fkLRDefaultWidth) }
staticconstexprprivate

Definition at line 82 of file G4PlotParameters.hh.

◆ fkDefaultRows

constexpr G4int G4PlotParameters::fkDefaultRows { 2 }
staticconstexprprivate

Definition at line 70 of file G4PlotParameters.hh.

◆ fkDefaultScale

constexpr G4float G4PlotParameters::fkDefaultScale { 0.9f }
staticconstexprprivate

Definition at line 71 of file G4PlotParameters.hh.

Referenced by SetStyle().

◆ fkDefaultWidth

constexpr G4int G4PlotParameters::fkDefaultWidth { fkLRDefaultWidth }
staticconstexprprivate

Definition at line 81 of file G4PlotParameters.hh.

◆ fkHRDefaultWidth

constexpr G4int G4PlotParameters::fkHRDefaultWidth { 2000 }
staticconstexprprivate

Definition at line 67 of file G4PlotParameters.hh.

◆ fkLRDefaultWidth

constexpr G4int G4PlotParameters::fkLRDefaultWidth { 700 }
staticconstexprprivate

Definition at line 68 of file G4PlotParameters.hh.

◆ fkMaxColumns

constexpr G4int G4PlotParameters::fkMaxColumns { 2 }
staticconstexprprivate

Definition at line 84 of file G4PlotParameters.hh.

Referenced by GetMaxColumns(), and SetLayout().

◆ fkMaxRows

constexpr G4int G4PlotParameters::fkMaxRows { 3 }
staticconstexprprivate

Definition at line 85 of file G4PlotParameters.hh.

Referenced by GetMaxRows(), and SetLayout().

◆ fMessenger

std::unique_ptr<G4PlotMessenger> G4PlotParameters::fMessenger
private

Definition at line 89 of file G4PlotParameters.hh.

Referenced by G4PlotParameters().

◆ fRows

G4int G4PlotParameters::fRows { fkDefaultRows }
private

Definition at line 95 of file G4PlotParameters.hh.

Referenced by GetRows(), and SetLayout().

◆ fScale

G4float G4PlotParameters::fScale { fkDefaultScale }
private

Definition at line 98 of file G4PlotParameters.hh.

Referenced by GetScale(), and SetStyle().

◆ fStyle

G4String G4PlotParameters::fStyle
private

Definition at line 99 of file G4PlotParameters.hh.

Referenced by GetStyle(), and SetStyle().

◆ fWidth

G4int G4PlotParameters::fWidth { fkDefaultWidth }
private

Definition at line 96 of file G4PlotParameters.hh.

Referenced by GetWidth(), and SetDimensions().


The documentation for this class was generated from the following files: