MRPT
2.0.4
mrpt
opengl
graph_tools.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#pragma once
10
11
#include <
mrpt/opengl/CSetOfObjects.h
>
12
#include <
mrpt/system/TParameters.h
>
13
14
namespace
mrpt
15
{
16
/** \ingroup mrpt_opengl_grp */
17
namespace
opengl
18
{
19
/** Tool functions for graphs of pose constraints. \ingroup mrpt_opengl_grp */
20
namespace
graph_tools
21
{
22
/** @name Tool functions for graphs of pose constraints
23
@{ */
24
25
/** Returns an opengl objects representation of an arbitrary graph, as a network
26
*of 3D pose frames.
27
* Note that the "global" coordinates of each node are taken from
28
*mrpt::graphs::CNetworkOfPoses::nodes, so
29
* if a node appears in "edges" but not in "nodes" it will be not displayed.
30
*
31
* \param g The graph
32
* \param extra_params An extra set of optional parameters (see below).
33
* List of accepted extra parameters (note that all are double values, booleans
34
*are emulated with 0 & !=0 values):
35
*
36
* <table align="center" >
37
* <tr> <td align="center" ><b>Parameter name</b></td> <td align="center" >
38
*<b>Description</b> </td> <td align="center" ><b>Default value</b></td> </tr>
39
* <tr>
40
* <td align="center" ><code> show_ID_labels </code></td>
41
* <td> If set to !=0, show poses ID labels </td>
42
* <td align="center" > 0 (don't show) </td>
43
* </tr>
44
* <tr>
45
* <td align="center" ><code> show_ground_grid </code></td>
46
* <td> If set to !=0, create a gray grid on the ground level
47
*(mrpt::opengl::CGridPlaneXY). The extension of the grid is computed to cover
48
*the entire graph extension </td>
49
* <td align="center" > 1 (do show) </td>
50
* </tr>
51
* <tr>
52
* <td align="center" ><code> show_edges </code></td>
53
* <td> If set to !=0, draw lines between nodes with at least one edge
54
*between them. </td>
55
* <td align="center" > 1 (do show) </td>
56
* </tr>
57
* <tr>
58
* <td align="center" ><code> show_node_corners </code></td>
59
* <td> If set to !=0, draw a small 3D corner frame at each node (see
60
*mrpt::opengl::stock_objects::CornerXYZSimple). </td>
61
* <td align="center" > 1 (do show) </td>
62
* </tr>
63
* <tr>
64
* <td align="center" ><code> show_edge_rel_poses </code></td>
65
* <td> If set to !=0, draw the relative poses stored in each edge as a
66
*small extra 3D corner frame at each node pose (+) the edge pose (see
67
*mrpt::opengl::stock_objects::CornerXYZSimple). </td>
68
* <td align="center" > 1 (do show) </td>
69
* </tr>
70
* <tr>
71
* <td align="center" ><code> nodes_point_size </code></td>
72
* <td> If set to !=0, draw a point of the given size (glPointSize) at
73
*each node.</td>
74
* <td align="center" > 0 (no points) </td>
75
* </tr>
76
*
77
* <tr>
78
* <td align="center" ><code> nodes_corner_scale </code></td>
79
* <td> If show_node_corners!=0, the size (length) of te corner lines.
80
*</td>
81
* <td align="center" > 0.7 </td>
82
* </tr>
83
* <tr>
84
* <td align="center" ><code> nodes_edges_corner_scale </code></td>
85
* <td> If show_edge_rel_poses is !=0, the size of the corners at the
86
*end of each drawn edge.</td>
87
* <td align="center" > 0.4 </td>
88
* </tr>
89
* <tr>
90
* <td align="center" ><code> nodes_point_color </code></td>
91
* <td> If nodes_point_size!=0, set this value to a hexadecimal int
92
*value 0xRRGGBB with the desired RGB color of points.</td>
93
* <td align="center" > 0xA0A0A0 (light gray) </td>
94
* </tr>
95
* <tr>
96
* <td align="center" ><code> edge_color </code></td>
97
* <td> If show_edges is !=0, the color of those edges as a
98
*hexadecimal int value 0xAARRGGBB with Alpha+RGB color
99
*(Alpha=0xFF:opaque,0x00:transparent).</td>
100
* <td align="center" > 0x400000FF </td>
101
* </tr>
102
*
103
* <tr>
104
* <td align="center" ><code> edge_rel_poses_color </code></td>
105
* <td> If show_edge_rel_poses is !=0, the color of those edges as a
106
*hexadecimal int value 0xAARRGGBB with Alpha+RGB color
107
*(Alpha=0xFF:opaque,0x00:transparent).</td>
108
* <td align="center" > 0x40FF8000 </td>
109
* </tr>
110
* <tr>
111
* <td align="center" ><code> edge_width </code></td>
112
* <td> If show_edges is !=0, the width of edge lines.</td>
113
* <td align="center" > 2.0 </td>
114
* </tr>
115
*
116
* </table>
117
*
118
* \sa mrpt::graphs::CNetworkOfPoses2D, mrpt::graphs::CNetworkOfPoses3D,
119
*mrpt::graphs::CNetworkOfPoses2DInf, mrpt::graphs::CNetworkOfPoses3DInf
120
* \note Implemented as headers-only in \a graph_tools_impl.h
121
* \ingroup mrpt_opengl_grp
122
*/
123
template
<
class
GRAPH_T>
124
CSetOfObjects::Ptr
graph_visualize
(
125
const
GRAPH_T& g,
const
mrpt::system::TParametersDouble
& extra_params =
126
mrpt::system::TParametersDouble
());
127
128
/** @} */
129
}
// namespace graph_tools
130
}
// namespace opengl
131
132
}
// namespace mrpt
133
134
#include "
graph_tools_impl.h
"
graph_tools_impl.h
CSetOfObjects.h
std::shared_ptr
Definition:
TTypeName.h:21
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TParameters.h
mrpt::opengl::graph_tools::graph_visualize
CSetOfObjects::Ptr graph_visualize(const GRAPH_T &g, const mrpt::system::TParametersDouble &extra_params=mrpt::system::TParametersDouble())
Returns an opengl objects representation of an arbitrary graph, as a network of 3D pose frames...
Definition:
graph_tools_impl.h:23
mrpt::system::TParameters
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
Definition:
TParameters.h:54
Page generated by
Doxygen 1.8.14
for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020