20 class CPOSE,
class MAPS_IMPLEMENTATION,
class NODE_ANNOTATIONS,
21 class EDGE_ANNOTATIONS>
27 "CMRVisualizer standard (non-specialized) edition doesn't server any " 29 "In case you use this visualizer specify TMRSlamNodeAnnotations" 30 "as the 3rd template argument");
34 class CPOSE,
class MAPS_IMPLEMENTATION,
class NODE_ANNOTATIONS,
35 class EDGE_ANNOTATIONS>
40 class CPOSE,
class MAPS_IMPLEMENTATION,
class NODE_ANNOTATIONS,
41 class EDGE_ANNOTATIONS>
43 CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS>::
51 class CPOSE,
class MAPS_IMPLEMENTATION,
class NODE_ANNOTATIONS,
52 class EDGE_ANNOTATIONS>
54 CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS>::
68 template <
class CPOSE,
class MAPS_IMPLEMENTATION,
class EDGE_ANNOTATIONS>
76 template <
class CPOSE,
class MAPS_IMPLEMENTATION,
class EDGE_ANNOTATIONS>
79 EDGE_ANNOTATIONS>::~CMRVisualizer() =
default;
81 template <
class CPOSE,
class MAPS_IMPLEMENTATION,
class EDGE_ANNOTATIONS>
93 const double nodes_point_size =
102 map<string, CPointCloud::Ptr> strid_to_cloud;
104 map<string, TColorf> strid_to_color;
109 this->m_graph.nodes.begin();
110 n_it != this->m_graph.nodes.end(); ++n_it)
118 const string& curr_strid = curr_node.agent_ID_str;
121 if (strid_to_cloud.find(curr_strid) != strid_to_cloud.end())
126 strid_to_color.find(curr_strid) != strid_to_color.end(),
127 "Agent string ID not found in colors map even though its " 128 "CPointCloud exists.");
133 strid_to_cloud.insert(
134 make_pair(curr_strid, std::make_shared<CPointCloud>()));
136 strid_to_color.insert(
140 curr_cloud->setColor(strid_to_color.at(curr_strid));
141 curr_cloud->setPointSize(nodes_point_size);
142 curr_cloud->enablePointSmooth();
152 curr_cloud->insertPoint(
p.x(),
p.y(),
p.z());
157 for (
auto it = strid_to_cloud.begin(); it != strid_to_cloud.end(); ++it)
159 object->insert(it->second);
164 template <
class CPOSE,
class MAPS_IMPLEMENTATION,
class EDGE_ANNOTATIONS>
174 ASSERTMSG_(viz_params,
"Pointer to viz_params was not provided.");
181 PairToSetOfLines_t id_to_set_of_lines;
183 map<string, TColorf> strid_to_color;
189 const double interconnecting_edge_width =
194 edge_it != this->m_graph.end(); ++edge_it)
196 const TNodeID& start_node = edge_it->first.first;
197 const TNodeID& end_node = edge_it->first.second;
201 this->m_graph.nodes.find(start_node);
203 this->m_graph.nodes.find(end_node);
206 if (n_it1 == this->m_graph.nodes.end() ||
207 n_it2 == this->m_graph.nodes.end())
218 std::string curr_end_strid = n_it2->second.agent_ID_str;
219 bool is_interconnecting_edge =
220 n_it1->second.agent_ID_str != n_it2->second.agent_ID_str;
222 pair<string, bool> curr_pair =
223 make_pair(curr_end_strid, is_interconnecting_edge);
226 if (id_to_set_of_lines.find(curr_pair) != id_to_set_of_lines.end())
233 id_to_set_of_lines.insert(
234 make_pair(curr_pair, std::make_shared<CSetOfLines>()));
238 if (strid_to_color.find(curr_end_strid) == strid_to_color.end())
240 strid_to_color.insert(make_pair(
247 id_to_set_of_lines.at(curr_pair);
250 curr_set_of_lines->setColor(strid_to_color.at(curr_end_strid));
253 double curr_width = is_interconnecting_edge
254 ? interconnecting_edge_width
256 curr_set_of_lines->setLineWidth(curr_width);
266 curr_set_of_lines->appendLine(
273 for (
auto it = id_to_set_of_lines.begin(); it != id_to_set_of_lines.end();
276 object->insert(it->second);
~CMRVisualizer() override
#define THROW_EXCEPTION(msg)
Abstract graph and tree data structures, plus generic graph algorithms.
Base class for C*Visualizer classes.
mrpt::img::TColorf getNextTColorf()
Get the next RGB triad in TColorf form.
A directed graph of pose constraints, with edges being the relative poses between pairs of nodes iden...
Internal functions for MRPT.
CMRVisualizer(const GRAPH_T &graph_in)
The type of each global pose in nodes: an extension of the constraint_no_pdf_t pose with any optional...
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
double x() const
Common members of all points & poses classes.
GLsizei const GLchar ** string
RET getWithDefaultVal(const std::string &s, const RET &defaultVal) const
A const version of the [] operator and with a default value in case the parameter is not set (for usa...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
The namespace for 3D scene representation and rendering.
typename edges_map_t::const_iterator const_iterator
uint64_t TNodeID
A generic numeric type for unique IDs of nodes or entities.
Manage R, G, B color triads and ask class instance of the next unique RGB combination.
Struct to be used as the NODE_ANNOTATIONS template argument in CNetworkOfPoses class instances for us...
Wrapper class that provides visualization of a network of poses that have been registered by many gra...