45 : fPlotParameters(plotParameters)
47 fDirectory = std::make_unique<G4UIdirectory>(
"/analysis/plot/");
48 fDirectory->SetGuidance(
"Analysis batch plotting control");
63void G4PlotMessenger::AddIntParameter(
67 param->SetGuidance(guidance.c_str());
68 if (! range.empty()) {
69 param->SetParameterRange(range);
75void G4PlotMessenger::SetStyleCmd()
79#if defined(TOOLS_USE_FREETYPE)
81 "Set plotting style from: \n"
82 " ROOT_default: ROOT style with high resolution fonts\n"
83 " hippodraw: hippodraw style with high resolution fonts\n"
84 " inlib_default: PAW style with low resolution fonts";
86 "ROOT_default hippodraw inlib_default";
89 "Only one plotting style is available in low resolution: \n"
90 " inlib_default: PAW style with low resolution fonts";
95 fSetStyleCmd = CreateCommand<G4UIcmdWithAString>(
"setStyle", guidance);
96 fSetStyleCmd->SetParameterName(
"Style",
false);
97 fSetStyleCmd->SetCandidates(
"inlib_default");
101void G4PlotMessenger::SetLayoutCmd()
103 fSetLayoutCmd = CreateCommand<G4UIcommand>(
105 "Set page layout (number of columns and rows per page).\n"
106 " Supported layouts:\n"
107 " columns = 1 .. maxValueAllowed\n"
108 " rows = 1 .. maxValueAllowed, and >= columns\"");
110 AddIntParameter(*fSetLayoutCmd,
"columns",
111 "The number of columns in the page layout.",
112 "columns>=1 && columns<=" + std::to_string(fPlotParameters->
GetMaxColumns()));
113 AddIntParameter(*fSetLayoutCmd,
"rows",
114 "The number of rows in the page layout.",
115 "rows>=1 && rows<=" + std::to_string(fPlotParameters->
GetMaxRows()));
119void G4PlotMessenger::SetDimensionsCmd()
121 fSetDimensionsCmd = CreateCommand<G4UIcommand>(
123 "Set the plotter window size (width and height) in pixels.");
125 AddIntParameter(*fSetDimensionsCmd,
"width",
"The page width.");
126 AddIntParameter(*fSetDimensionsCmd,
"height",
"The page height.");
137 std::vector<G4String> parameters;
144 "\" parameters: " + to_string(parameters.size()) +
146 fkClass,
"WarnAboutParameters");
151 if ( command == fSetLayoutCmd.get() ) {
154 fPlotParameters->
SetLayout(columns, rows);
158 if ( command == fSetDimensionsCmd.get() ) {
165 if ( command == fSetStyleCmd.get() ) {
166 fPlotParameters->
SetStyle(newValues);
void SetNewValue(G4UIcommand *command, G4String value) final
~G4PlotMessenger() override
void SetLayout(G4int columns, G4int rows)
void SetDimensions(G4int width, G4int height)
void SetStyle(const G4String &style)
std::size_t GetParameterEntries() const
void SetParameter(G4UIparameter *const newParameter)
static G4int ConvertToInt(const char *st)
const G4String & GetCommandName() const
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)