13vector<G4SceneText>
getSceneTexts(
const std::shared_ptr<GOptions>& gopts) {
14 vector<G4SceneText> st;
16 auto g4t_node = gopts->getOptionNode(
"g4text");
19 for (
auto g4t_item : g4t_node) {
25 st_item.
color = gopts->get_variable_in_option<
string>(g4t_item,
"color",
"black");
26 st_item.
kind = gopts->get_variable_in_option<
string>(g4t_item,
"kind",
"2D");
27 st_item.
layout = gopts->get_variable_in_option<
string>(g4t_item,
"layout",
"");
28 st_item.
x = gopts->get_variable_in_option<
double>(g4t_item,
"x", 0);
29 st_item.
y = gopts->get_variable_in_option<
double>(g4t_item,
"y", 0);
31 st_item.
unit = gopts->get_variable_in_option<
string>(g4t_item,
"unit",
"cm");
32 st_item.
size = gopts->get_variable_in_option<
double>(g4t_item,
"size", 24.0);
33 st_item.
dx = gopts->get_variable_in_option<
double>(g4t_item,
"dx", 4.0);
34 st_item.
dy = gopts->get_variable_in_option<
double>(g4t_item,
"dy", 4.0);
36 st.push_back(st_item);
Scene text option structures and helpers for the g4display module.
One text annotation to be inserted into the Geant4 scene.
std::string layout
Optional text layout such as "right"; empty keeps Geant4 default layout.
std::string color
Text color name understood by Geant4 (e.g. "black", "red").
std::string kind
Text kind: "2D" for text2D or "3D" for text attached in scene coordinates.
double z
Z position used by 3D text.
std::string text
Text string to be displayed.
int size
Text size parameter passed to Geant4 visualization command.
std::string unit
Unit used by 3D text positions.