13 vector <G4SceneText> st;
15 auto g4t_node = gopts->getOptionNode(
"g4text");
17 for (
auto g4t_item: g4t_node) {
20 st_item.
text = gopts->get_variable_in_option<
string>(g4t_item,
"text", goptions::NODFLT);
21 st_item.
color = gopts->get_variable_in_option<
string>(g4t_item,
"color",
"black");
22 st_item.
x = gopts->get_variable_in_option<
float>(g4t_item,
"x", 0);
23 st_item.
y = gopts->get_variable_in_option<
float>(g4t_item,
"y", 0);
25 st_item.
size = gopts->get_variable_in_option<
double>(g4t_item,
"size", 24.0);
26 st.push_back(st_item);
40 help =
"If the z coordinate is specified, the text is considered 2D. \n \n";
41 help +=
"Example to add two texts: \n \n";
42 help +=
"-g4text=\"[{text: hello, x: -100}, {text: there, x: 100}]\"\n";
43 vector <GVariable> g4text = {
44 {
"text", goptions::NODFLT,
"string with the text to be displayed"},
45 {
"color",
"black",
"color of the text"},
46 {
"x", 0,
"x position of the text"},
47 {
"y", 0,
"y position of the text"},
49 {
"size", 24.0,
"size of the text"},
51 goptions.defineOption(
"g4text",
"Insert texts in the current scene", g4text, help);
#define GNOT_SPECIFIED_SCENE_TEXT_Z
GOptions addSceneTextsOptions()
vector< G4SceneText > getSceneTexts(GOptions *gopts)