Main MRPT website > C++ reference
MRPT logo
graph_tools.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef opengl_graph_tools_H
29 #define opengl_graph_tools_H
30 
32 #include <mrpt/utils/TParameters.h>
33 
34 namespace mrpt
35 {
36  /** \ingroup mrpt_opengl_grp */
37  namespace opengl
38  {
39  /** Tool functions for graphs of pose constraints. \ingroup mrpt_opengl_grp */
40  namespace graph_tools
41  {
42  /** @name Tool functions for graphs of pose constraints
43  @{ */
44 
45  /** Returns an opengl objects representation of an arbitrary graph, as a network of 3D pose frames.
46  * Note that the "global" coordinates of each node are taken from mrpt::graphs::CNetworkOfPoses::nodes, so
47  * if a node appears in "edges" but not in "nodes" it will be not displayed.
48  *
49  * \param g The graph
50  * \param extra_params An extra set of optional parameters (see below).
51  * List of accepted extra parameters (note that all are double values, booleans are emulated with 0 & !=0 values):
52  *
53  * <table align="center" >
54  * <tr> <td align="center" ><b>Parameter name</b></td> <td align="center" > <b>Description</b> </td> <td align="center" ><b>Default value</b></td> </tr>
55  * <tr>
56  * <td align="center" ><code> show_ID_labels </code></td>
57  * <td> If set to !=0, show poses ID labels </td>
58  * <td align="center" > 0 (don't show) </td>
59  * </tr>
60  * <tr>
61  * <td align="center" ><code> show_ground_grid </code></td>
62  * <td> If set to !=0, create a gray grid on the ground level (mrpt::opengl::CGridPlaneXY). The extension of the grid is computed to cover the entire graph extension </td>
63  * <td align="center" > 1 (do show) </td>
64  * </tr>
65  * <tr>
66  * <td align="center" ><code> show_edges </code></td>
67  * <td> If set to !=0, draw lines between nodes with at least one edge between them. </td>
68  * <td align="center" > 1 (do show) </td>
69  * </tr>
70  * <tr>
71  * <td align="center" ><code> edge_color </code></td>
72  * <td> If show_edges is !=0, the color of those edges as a hexadecimal int value 0xAARRGGBB with Alpha+RGB color (Alpha=0xFF:opaque,0x00:transparent).</td>
73  * <td align="center" > 0x400000FF </td>
74  * </tr>
75  * <tr>
76  * <td align="center" ><code> edge_width </code></td>
77  * <td> If show_edges is !=0, the width of edge lines.</td>
78  * <td align="center" > 2.0 </td>
79  * </tr>
80  * <tr>
81  * <td align="center" ><code> show_node_corners </code></td>
82  * <td> If set to !=0, draw a small 3D corner frame at each node (see mrpt::opengl::stock_objects::CornerXYZSimple). </td>
83  * <td align="center" > 1 (do show) </td>
84  * </tr>
85  * <tr>
86  * <td align="center" ><code> show_edge_rel_poses </code></td>
87  * <td> If set to !=0, draw the relative poses stored in each edge as a small extra 3D corner frame at each node pose (+) the edge pose (see mrpt::opengl::stock_objects::CornerXYZSimple). </td>
88  * <td align="center" > 1 (do show) </td>
89  * </tr>
90  * <tr>
91  * <td align="center" ><code> edge_rel_poses_color </code></td>
92  * <td> If show_edge_rel_poses is !=0, the color of those edges as a hexadecimal int value 0xAARRGGBB with Alpha+RGB color (Alpha=0xFF:opaque,0x00:transparent).</td>
93  * <td align="center" > 0x40FF8000 </td>
94  * </tr>
95  * <tr>
96  * <td align="center" ><code> nodes_edges_corner_scale </code></td>
97  * <td> If show_edge_rel_poses is !=0, the size of the corners at the end of each drawn edge.</td>
98  * <td align="center" > 0.4 </td>
99  * </tr>
100  * <tr>
101  * <td align="center" ><code> nodes_corner_scale </code></td>
102  * <td> If show_node_corners!=0, the size (length) of te corner lines. </td>
103  * <td align="center" > 0.7 </td>
104  * </tr>
105  * <tr>
106  * <td align="center" ><code> nodes_point_size </code></td>
107  * <td> If set to !=0, draw a point of the given size (glPointSize) at each node.</td>
108  * <td align="center" > 0 (no points) </td>
109  * </tr>
110  * <tr>
111  * <td align="center" ><code> nodes_point_color </code></td>
112  * <td> If nodes_point_size!=0, set this value to a hexadecimal int value 0xRRGGBB with the desired RGB color of points.</td>
113  * <td align="center" > 0xA0A0A0 (light gray) </td>
114  * </tr>
115  * </table>
116  *
117  * \sa mrpt::graphs::CNetworkOfPoses2D, mrpt::graphs::CNetworkOfPoses3D, mrpt::graphs::CNetworkOfPoses2DInf, mrpt::graphs::CNetworkOfPoses3DInf
118  * \note Implemented as headers-only in \a graph_tools_impl.h
119  * \ingroup mrpt_opengl_grp
120  */
121  template<class GRAPH_T>
123  const GRAPH_T &g,
125  );
126 
127  /** @} */
128  }
129  }
130 
131 } // End of namespace
132 
133 #include "graph_tools_impl.h"
134 
135 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013