Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PlotParameters Class Reference

#include <G4PlotParameters.hh>

Public Member Functions

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

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
47 fStyle(fDefaultStyle)
48{
49 fMessenger = std::make_unique<G4PlotMessenger>(this);
50}

Member Function Documentation

◆ GetAvailableStyles()

G4String G4PlotParameters::GetAvailableStyles ( )
inline

Definition at line 110 of file G4PlotParameters.hh.

111{ return fAvailableStyles; }

◆ GetColumns()

G4int G4PlotParameters::GetColumns ( ) const
inline

Definition at line 113 of file G4PlotParameters.hh.

114{ return fColumns; }

Referenced by G4PlotManager::G4PlotManager(), and G4PlotManager::PlotAndWrite().

◆ GetHeight()

G4int G4PlotParameters::GetHeight ( ) const
inline

Definition at line 122 of file G4PlotParameters.hh.

123{ return fHeight; }

Referenced by G4PlotManager::G4PlotManager().

◆ GetMaxColumns()

G4int G4PlotParameters::GetMaxColumns ( )
inline

Definition at line 104 of file G4PlotParameters.hh.

105{ return fkMaxColumns; }

◆ GetMaxRows()

G4int G4PlotParameters::GetMaxRows ( )
inline

Definition at line 107 of file G4PlotParameters.hh.

108{ return fkMaxRows; }

◆ GetRows()

G4int G4PlotParameters::GetRows ( ) const
inline

Definition at line 116 of file G4PlotParameters.hh.

117{ return fRows; }

Referenced by G4PlotManager::G4PlotManager(), and G4PlotManager::PlotAndWrite().

◆ GetScale()

G4float G4PlotParameters::GetScale ( ) const
inline

Definition at line 125 of file G4PlotParameters.hh.

126{ return fScale; }

◆ GetStyle()

G4String G4PlotParameters::GetStyle ( ) const
inline

Definition at line 128 of file G4PlotParameters.hh.

129{ return fStyle; }

Referenced by G4PlotManager::PlotAndWrite().

◆ GetWidth()

G4int G4PlotParameters::GetWidth ( ) const
inline

Definition at line 119 of file G4PlotParameters.hh.

120{ return 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}

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}
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)

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" ) {
96 fScale = fkDefaultScale;
97 } else {
98 fScale = 1.f;
99 }
100}

Referenced by G4PlotMessenger::SetNewValue().


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