3535#include " hydra_visualizer/layer_info.h"
3636
3737#include < config_utilities/config.h>
38+ #include < config_utilities/types/enum.h>
3839#include < spark_dsg/node_attributes.h>
3940
4041namespace hydra ::visualizer {
@@ -71,6 +72,22 @@ void declare_config(LayerConfig::Edges& config) {
7172 field (config.draw , " draw" );
7273 field (config.scale , " scale" );
7374 field (config.alpha , " alpha" );
75+ enum_field (config.color ,
76+ " color" ,
77+ {
78+ {NamedColors::BLACK, " black" },
79+ {NamedColors::WHITE, " white" },
80+ {NamedColors::RED, " red" },
81+ {NamedColors::GREEN, " green" },
82+ {NamedColors::BLUE, " blue" },
83+ {NamedColors::YELLOW, " yellow" },
84+ {NamedColors::ORANGE, " orange" },
85+ {NamedColors::PURPLE, " purple" },
86+ {NamedColors::CYAN, " cyan" },
87+ {NamedColors::MAGENTA, " magenta" },
88+ {NamedColors::PINK, " pink" },
89+ {NamedColors::GRAY, " gray" },
90+ });
7491 field (config.use_color , " use_color" );
7592 field (config.draw_interlayer , " draw_interlayer" );
7693 field (config.interlayer_use_source , " interlayer_use_source" );
@@ -91,6 +108,22 @@ void declare_config(LayerConfig::Text& config) {
91108 field (config.scale , " scale" );
92109 field (config.add_jitter , " add_jitter" );
93110 field (config.jitter_scale , " jitter_scale" );
111+ enum_field (config.color ,
112+ " color" ,
113+ {
114+ {NamedColors::BLACK, " black" },
115+ {NamedColors::WHITE, " white" },
116+ {NamedColors::RED, " red" },
117+ {NamedColors::GREEN, " green" },
118+ {NamedColors::BLUE, " blue" },
119+ {NamedColors::YELLOW, " yellow" },
120+ {NamedColors::ORANGE, " orange" },
121+ {NamedColors::PURPLE, " purple" },
122+ {NamedColors::CYAN, " cyan" },
123+ {NamedColors::MAGENTA, " magenta" },
124+ {NamedColors::PINK, " pink" },
125+ {NamedColors::GRAY, " gray" },
126+ });
94127}
95128
96129void declare_config (LayerConfig::BoundingBoxes& config) {
@@ -162,6 +195,14 @@ LayerInfo& LayerInfo::graph(const DynamicSceneGraph& graph, LayerId layer) {
162195 return *this ;
163196}
164197
198+ Color LayerInfo::text_color () const {
199+ return colorFromName (config.text .color );
200+ }
201+
202+ Color LayerInfo::edge_color () const {
203+ return colorFromName (config.edges .color );
204+ }
205+
165206bool LayerInfo::shouldVisualize (const spark_dsg::SceneGraphNode& node) const {
166207 if (!config.visualize ) {
167208 return false ;
0 commit comments