Geant4  10.02.p03
G4PlotParameters Class Reference

#include <G4PlotParameters.hh>

Collaboration diagram for G4PlotParameters:

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
 

Private Attributes

std::unique_ptr< G4PlotMessengerfMessenger
 
G4int fDefaultColumns
 
G4int fDefaultRows
 
G4int fDefaultWidth
 
G4int fDefaultHeight
 
G4String fDefaultStyle
 
G4float fDefaultScale
 
G4int fMaxColumns
 
G4int fMaxRows
 
G4String fAvailableStyles
 
G4int fColumns
 
G4int fRows
 
G4int fWidth
 
G4int fHeight
 
G4float fScale
 
G4String fStyle
 

Detailed Description

Definition at line 41 of file G4PlotParameters.hh.

Constructor & Destructor Documentation

◆ G4PlotParameters()

G4PlotParameters::G4PlotParameters ( )

Definition at line 36 of file G4PlotParameters.cc.

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

Member Function Documentation

◆ GetAvailableStyles()

G4String G4PlotParameters::GetAvailableStyles ( )
inline

Definition at line 95 of file G4PlotParameters.hh.

96 { return fAvailableStyles; }
Here is the caller graph for this function:

◆ GetColumns()

G4int G4PlotParameters::GetColumns ( ) const
inline

Definition at line 98 of file G4PlotParameters.hh.

99 { return fColumns; }
Here is the caller graph for this function:

◆ GetHeight()

G4int G4PlotParameters::GetHeight ( ) const
inline

Definition at line 107 of file G4PlotParameters.hh.

108 { return fHeight; }
Here is the caller graph for this function:

◆ GetMaxColumns()

G4int G4PlotParameters::GetMaxColumns ( )
inline

Definition at line 89 of file G4PlotParameters.hh.

90 { return fMaxColumns; }
Here is the caller graph for this function:

◆ GetMaxRows()

G4int G4PlotParameters::GetMaxRows ( )
inline

Definition at line 92 of file G4PlotParameters.hh.

93 { return fMaxRows; }
Here is the caller graph for this function:

◆ GetRows()

G4int G4PlotParameters::GetRows ( ) const
inline

Definition at line 101 of file G4PlotParameters.hh.

102 { return fRows; }
Here is the caller graph for this function:

◆ GetScale()

G4float G4PlotParameters::GetScale ( ) const
inline

Definition at line 110 of file G4PlotParameters.hh.

111 { return fScale; }
Here is the caller graph for this function:

◆ GetStyle()

G4String G4PlotParameters::GetStyle ( ) const
inline

Definition at line 113 of file G4PlotParameters.hh.

114 { return fStyle; }
Here is the caller graph for this function:

◆ GetWidth()

G4int G4PlotParameters::GetWidth ( ) const
inline

Definition at line 104 of file G4PlotParameters.hh.

105 { return fWidth; }
Here is the caller graph for this function:

◆ SetDimensions()

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

Definition at line 94 of file G4PlotParameters.cc.

95 {
96  fWidth = width;
97  fHeight = height;
98 }
#define width
Here is the caller graph for this function:

◆ SetLayout()

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

Definition at line 73 of file G4PlotParameters.cc.

74 {
75  if ( columns > rows ||
76  columns < 1 || columns > fMaxColumns ||
77  rows < 1 || rows > fMaxRows ) {
78  G4ExceptionDescription description;
79  description
80  << "Layout: " << columns << " x " << rows << " was ignored." << G4endl
81  << "Suported layouts: " << G4endl
82  << " columns <= rows" << G4endl
83  << " columns = 1 .. " << fMaxColumns << G4endl
84  << " rows = 1 .. " << fMaxRows << G4endl;
85  G4Exception("G4PlotParameters::SetLayout",
86  "Analysis_W013", JustWarning, description);
87  return;
88  }
89  fColumns = columns;
90  fRows = rows;
91 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStyle()

void G4PlotParameters::SetStyle ( const G4String style)

Definition at line 101 of file G4PlotParameters.cc.

102 {
103 // Set style and update scale according to the style selected
104 
105  if ( fAvailableStyles.find(style) == std::string::npos ) {
106  G4ExceptionDescription description;
107  description
108  << "Style: " << style << " was ignored." << G4endl
109  << "Supported styles: " << fAvailableStyles << G4endl;
110  G4Exception("G4PlotParameters::SetLayout",
111  "Analysis_W013", JustWarning, description);
112  return;
113  }
114 
115  fStyle = style;
116 
117  if ( fStyle == "ROOT_default" ) {
119  } else {
120  fScale = 1.f;
121  }
122 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fAvailableStyles

G4String G4PlotParameters::fAvailableStyles
private

Definition at line 77 of file G4PlotParameters.hh.

◆ fColumns

G4int G4PlotParameters::fColumns
private

Definition at line 79 of file G4PlotParameters.hh.

◆ fDefaultColumns

G4int G4PlotParameters::fDefaultColumns
private

Definition at line 68 of file G4PlotParameters.hh.

◆ fDefaultHeight

G4int G4PlotParameters::fDefaultHeight
private

Definition at line 71 of file G4PlotParameters.hh.

◆ fDefaultRows

G4int G4PlotParameters::fDefaultRows
private

Definition at line 69 of file G4PlotParameters.hh.

◆ fDefaultScale

G4float G4PlotParameters::fDefaultScale
private

Definition at line 73 of file G4PlotParameters.hh.

◆ fDefaultStyle

G4String G4PlotParameters::fDefaultStyle
private

Definition at line 72 of file G4PlotParameters.hh.

◆ fDefaultWidth

G4int G4PlotParameters::fDefaultWidth
private

Definition at line 70 of file G4PlotParameters.hh.

◆ fHeight

G4int G4PlotParameters::fHeight
private

Definition at line 82 of file G4PlotParameters.hh.

◆ fMaxColumns

G4int G4PlotParameters::fMaxColumns
private

Definition at line 75 of file G4PlotParameters.hh.

◆ fMaxRows

G4int G4PlotParameters::fMaxRows
private

Definition at line 76 of file G4PlotParameters.hh.

◆ fMessenger

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

Definition at line 66 of file G4PlotParameters.hh.

◆ fRows

G4int G4PlotParameters::fRows
private

Definition at line 80 of file G4PlotParameters.hh.

◆ fScale

G4float G4PlotParameters::fScale
private

Definition at line 83 of file G4PlotParameters.hh.

◆ fStyle

G4String G4PlotParameters::fStyle
private

Definition at line 84 of file G4PlotParameters.hh.

◆ fWidth

G4int G4PlotParameters::fWidth
private

Definition at line 81 of file G4PlotParameters.hh.


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