Geant4 10.7.0
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 40 of file G4PlotParameters.hh.

Constructor & Destructor Documentation

◆ G4PlotParameters()

G4PlotParameters::G4PlotParameters ( )

Definition at line 35 of file G4PlotParameters.cc.

36 : fMessenger(nullptr),
37 fDefaultColumns(1),
38 fDefaultRows (2),
39#if defined(TOOLS_USE_FREETYPE)
40 //Have vertical A4 :
41 fDefaultWidth(2000),
42 fDefaultHeight((G4int)(29.7f/21.0f*fDefaultWidth)),
43 fDefaultStyle("ROOT_default"),
44 fDefaultScale(0.9f),
45 fMaxColumns(3),
46 fMaxRows (5),
47 fAvailableStyles("ROOT_default hippodrow inlib_default"),
48#else
49 fDefaultWidth (700),
50 fDefaultHeight((G4int)(29.7f/21.0f*fDefaultWidth)),
51 fDefaultStyle("inlib_default"),
52 fDefaultScale(0.9f),
53 fMaxColumns(2),
54 fMaxRows (3),
55 fAvailableStyles("inlib_default"),
56#endif
57 fColumns(fDefaultColumns),
58 fRows(fDefaultRows),
59 fWidth(fDefaultWidth),
60 fHeight(fDefaultHeight),
61 fScale(fDefaultScale),
62 fStyle(fDefaultStyle)
63{
64 fMessenger = G4Analysis::make_unique<G4PlotMessenger>(this);
65}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ GetAvailableStyles()

G4String G4PlotParameters::GetAvailableStyles ( )
inline

Definition at line 94 of file G4PlotParameters.hh.

95{ return fAvailableStyles; }

◆ GetColumns()

G4int G4PlotParameters::GetColumns ( ) const
inline

Definition at line 97 of file G4PlotParameters.hh.

98{ return fColumns; }

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

◆ GetHeight()

G4int G4PlotParameters::GetHeight ( ) const
inline

Definition at line 106 of file G4PlotParameters.hh.

107{ return fHeight; }

Referenced by G4PlotManager::G4PlotManager().

◆ GetMaxColumns()

G4int G4PlotParameters::GetMaxColumns ( )
inline

Definition at line 88 of file G4PlotParameters.hh.

89{ return fMaxColumns; }

◆ GetMaxRows()

G4int G4PlotParameters::GetMaxRows ( )
inline

Definition at line 91 of file G4PlotParameters.hh.

92{ return fMaxRows; }

◆ GetRows()

G4int G4PlotParameters::GetRows ( ) const
inline

Definition at line 100 of file G4PlotParameters.hh.

101{ return fRows; }

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

◆ GetScale()

G4float G4PlotParameters::GetScale ( ) const
inline

Definition at line 109 of file G4PlotParameters.hh.

110{ return fScale; }

◆ GetStyle()

G4String G4PlotParameters::GetStyle ( ) const
inline

Definition at line 112 of file G4PlotParameters.hh.

113{ return fStyle; }

Referenced by G4PlotManager::PlotAndWrite().

◆ GetWidth()

G4int G4PlotParameters::GetWidth ( ) const
inline

Definition at line 103 of file G4PlotParameters.hh.

104{ return fWidth; }

Referenced by G4PlotManager::G4PlotManager().

◆ SetDimensions()

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

Definition at line 93 of file G4PlotParameters.cc.

94{
95 fWidth = width;
96 fHeight = height;
97}

Referenced by G4PlotMessenger::SetNewValue().

◆ SetLayout()

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

Definition at line 72 of file G4PlotParameters.cc.

73{
74 if ( columns > rows ||
75 columns < 1 || columns > fMaxColumns ||
76 rows < 1 || rows > fMaxRows ) {
77 G4ExceptionDescription description;
78 description
79 << "Layout: " << columns << " x " << rows << " was ignored." << G4endl
80 << "Supported layouts: " << G4endl
81 << " columns <= rows" << G4endl
82 << " columns = 1 .. " << fMaxColumns << G4endl
83 << " rows = 1 .. " << fMaxRows << G4endl;
84 G4Exception("G4PlotParameters::SetLayout",
85 "Analysis_W013", JustWarning, description);
86 return;
87 }
88 fColumns = columns;
89 fRows = rows;
90}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57

Referenced by G4PlotMessenger::SetNewValue().

◆ SetStyle()

void G4PlotParameters::SetStyle ( const G4String style)

Definition at line 100 of file G4PlotParameters.cc.

101{
102// Set style and update scale according to the style selected
103
104 if ( fAvailableStyles.find(style) == std::string::npos ) {
105 G4ExceptionDescription description;
106 description
107 << "Style: " << style << " was ignored." << G4endl
108 << "Supported styles: " << fAvailableStyles << G4endl;
109 G4Exception("G4PlotParameters::SetLayout",
110 "Analysis_W013", JustWarning, description);
111 return;
112 }
113
114 fStyle = style;
115
116 if ( fStyle == "ROOT_default" ) {
117 fScale = fDefaultScale;
118 } else {
119 fScale = 1.f;
120 }
121}

Referenced by G4PlotMessenger::SetNewValue().


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