56 std::string _str_(std::string_view section, std::string_view key) {
60 template <
typename T >
61 T _typed_(std::string_view section, std::string_view key) {
68 style.
size = _str_(
"notebook",
"graphSize");
69 style.rankDir = _str_(
"notebook",
"graphRankDir");
70 style.layout = _str_(
"notebook",
"graphLayout");
71 style.arcColor = _str_(
"notebook",
"arcColor");
72 style.nodeBgColor = _str_(
"notebook",
"nodeBgColor");
78 std::string
configFgColor(std::string_view section, std::string_view key) {
79 constexpr std::string_view fgSuffix =
"FgColor";
80 if (!key.ends_with(fgSuffix)) {
83 const std::string bgKey = std::string(key.substr(0, key.size() - fgSuffix.size())) +
"BgColor";
85 _str_(section, bgKey),
86 _str_(
"notebook",
"arcColor"));
93 style.
nodeBgColor = _str_(
"credalnet",
"nodeBgColor");
100 static_cast< DotStyle&
>(style) = _notebook_();
101 style.
size = _str_(
"notebook",
"junctionTreeGraphSize");
103 style.
withNames = _typed_< bool >(
"notebook",
"junctionTreeWithNames");
107 =
static_cast< int >(_typed_< std::int64_t >(
"notebook",
"junctionTreeSeparatorFontSize"));
108 style.
cliqueBgColor = _str_(
"notebook",
"junctionTreeCliqueBgColor");
111 =
static_cast< int >(_typed_< std::int64_t >(
"notebook",
"junctionTreeCliqueFontSize"));
113 style.
mapCliqueScale = _typed_< double >(
"notebook",
"junctionTreeMapCliqueScale");
114 style.
mapSepScale = _typed_< double >(
"notebook",
"junctionTreeMapSepScale");
115 style.
mapEdgeLen = _typed_< double >(
"notebook",
"junctionTreeMapEdgeLen");
116 style.
mapSize = _str_(
"notebook",
"junctionTreeMapSize");
122 static_cast< DotStyle&
>(style) = _notebook_();
123 style.
layout = _str_(
"factorgraph",
"graphLayout");
124 style.
nodeBgColor = _str_(
"factorgraph",
"nodeBgColor");
129 style.
edgeLength = _typed_< double >(
"factorgraph",
"edgeLength");
135 static_cast< DotStyle&
>(style) = _notebook_();
136 style.
size = _str_(
"influenceDiagram",
"graphSize");
138 style.
chanceBgColor = _str_(
"influenceDiagram",
"chanceBgColor");
140 style.
chanceShape = _str_(
"influenceDiagram",
"chanceShape");
142 style.
utilityBgColor = _str_(
"influenceDiagram",
"utilityBgColor");
144 style.
utilityShape = _str_(
"influenceDiagram",
"utilityShape");
148 style.
decisionShape = _str_(
"influenceDiagram",
"decisionShape");
157 static_cast< DotStyle&
>(style) = _notebook_();
158 style.
size = _str_(
"causal",
"graphSize");
159 style.
nodeBgColor = _str_(
"causal",
"nodeBgColor");
170 static_cast< DotStyle&
>(style) = _notebook_();
171 style.
size = _str_(
"dynamicBN",
"graphSize");
T typed(std::string_view section, std::string_view key) const
Value of section.key converted according to its declared type.
std::string get(std::string_view section, std::string_view key) const
Value of section.key, as a string.
Exception: at least one argument passed to a function is not what was expected.
Typed, documented, sectioned configuration singleton read from an .ini content.
Colors of the graphs drawn with graphviz: reading of a color, brightness, readable text color.
Look of the graphs drawn with graphviz, read from the configuration.
#define GUM_ERROR(type, msg)
constexpr std::string_view ADAPTIVE_COLOR
the special value of a font color: black or white, according to the brightness of the background
std::string resolveFgColor(std::string_view fgColor, std::string_view bgColor, std::string_view fallback)
The font color to use on a background, once the special value adaptive is resolved.
std::string configFgColor(std::string_view section, std::string_view key)
A font color of the configuration, resolved against the background color which goes with it.
Configuration & config()
A short name for Configuration::instance() : gum::config().epsilonStandard(). It is not inline so tha...
The style of a causal model (section causal): nodeBgColor and nodeFgColor are the ones of the observe...
std::string latentBgColor
std::string latentFgColor
static CausalDotStyle read()
bool showLatentNames
show the names of the latent variables
The look shared by all the graphs: size, direction, layout, colors of the arcs and of the nodes.
std::string size
graphviz size of the graph, in inches (5, or 12! for an exact size)
std::string nodeFgColor
font color of the nodes
std::string layout
graphviz layout engine (dot, neato...)
static DotStyle readCredalNet()
the style of the credal networks : the colors of the nodes are the ones of the section credalnet
static DotStyle read()
the style of the graphs of the section notebook
std::string nodeBgColor
background color of the nodes
std::string arcColor
color of the arcs and edges, and of the border of the nodes
The style of a dynamic Bayesian network (section dynamicBN) : the colors of its clusters.
std::string atemporalBgColor
background color of the cluster of the atemporal variables
static DynamicBNDotStyle read()
std::string replicatedSliceBgColor
background color of the cluster of the replicated slice
std::string timeSliceBgColor
background color of the cluster of a time slice
The style of a factor graph (section factorgraph): layout, nodeBgColor and nodeFgColor are the ones o...
double edgeLength
length of the edges
std::string factorFgColor
the font color of the factors: adaptive against their background
static FactorGraphDotStyle read()
std::string factorBgColor
The style of an influence diagram (section influenceDiagram).
std::string decisionFgColor
std::string utilityFgColor
std::string utilityArcStyle
graphviz style of the arcs pointing to a utility node
std::string decisionBgColor
std::string chanceFgColor
std::string decisionArcStyle
graphviz style of the arcs pointing to a decision node
std::string utilityBgColor
static InfluenceDiagramDotStyle read()
std::string chanceBgColor
std::string decisionShape
The style of a junction tree (section notebook): size is the size of the tree, not the one of its map...
bool withNames
show the names of the variables in the cliques
std::string cliqueBgColor
double mapEdgeLen
length of the edges in the map of a junction tree
std::string separatorBgColor
std::string cliqueFgColor
double mapCliqueScale
scale of the cliques in the map of a junction tree
static JunctionTreeDotStyle read()
double mapSepScale
scale of the separators in the map of a junction tree
std::string mapSize
size of the map of a junction tree
std::string separatorFgColor