Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ( )

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
58  fColumns(fDefaultColumns),
59  fRows(fDefaultRows),
60  fWidth(fDefaultWidth),
61  fHeight(fDefaultHeight),
62  fScale(fDefaultScale),
63  fStyle(fDefaultStyle)
64 {
65  fMessenger = G4Analysis::make_unique<G4PlotMessenger>(this);
66 }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

G4String G4PlotParameters::GetAvailableStyles ( )
inline

Definition at line 95 of file G4PlotParameters.hh.

96 { return fAvailableStyles; }
G4int G4PlotParameters::GetColumns ( ) const
inline

Definition at line 98 of file G4PlotParameters.hh.

99 { return fColumns; }

Here is the caller graph for this function:

G4int G4PlotParameters::GetHeight ( ) const
inline

Definition at line 107 of file G4PlotParameters.hh.

108 { return fHeight; }

Here is the caller graph for this function:

G4int G4PlotParameters::GetMaxColumns ( )
inline

Definition at line 89 of file G4PlotParameters.hh.

90 { return fMaxColumns; }
G4int G4PlotParameters::GetMaxRows ( )
inline

Definition at line 92 of file G4PlotParameters.hh.

93 { return fMaxRows; }
G4int G4PlotParameters::GetRows ( ) const
inline

Definition at line 101 of file G4PlotParameters.hh.

102 { return fRows; }

Here is the caller graph for this function:

G4float G4PlotParameters::GetScale ( ) const
inline

Definition at line 110 of file G4PlotParameters.hh.

111 { return fScale; }
G4String G4PlotParameters::GetStyle ( ) const
inline

Definition at line 113 of file G4PlotParameters.hh.

114 { return fStyle; }

Here is the caller graph for this function:

G4int G4PlotParameters::GetWidth ( ) const
inline

Definition at line 104 of file G4PlotParameters.hh.

105 { return fWidth; }

Here is the caller graph for this function:

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

Definition at line 94 of file G4PlotParameters.cc.

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

Here is the caller graph for this function:

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:

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" ) {
118  fScale = fDefaultScale;
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:


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