Main MRPT website > C++ reference
MRPT logo
graph_tools.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                       http://www.mrpt.org/                                |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 #ifndef opengl_graph_tools_H
00029 #define opengl_graph_tools_H
00030 
00031 #include <mrpt/opengl/CSetOfObjects.h>
00032 #include <mrpt/utils/TParameters.h>
00033 
00034 namespace mrpt
00035 {
00036         /** \ingroup mrpt_opengl_grp */
00037         namespace opengl
00038         {
00039                 /** Tool functions for graphs of pose constraints. \ingroup mrpt_opengl_grp  */
00040                 namespace graph_tools
00041                 {
00042                         /** @name Tool functions for graphs of pose constraints
00043                             @{ */
00044 
00045                         /** Returns an opengl objects representation of an arbitrary graph, as a network of 3D pose frames.
00046                           *  Note that the "global" coordinates of each node are taken from mrpt::graphs::CNetworkOfPoses::nodes, so
00047                           *   if a node appears in "edges" but not in "nodes" it will be not displayed.
00048                           *
00049                           *  \param g             The graph
00050                           *  \param extra_params  An extra set of optional parameters (see below).
00051                           * List of accepted extra parameters (note that all are double values, booleans are emulated with 0 & !=0 values):
00052                           *
00053                           *   <table align="center" >
00054                           *   <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>
00055                           *   <tr>
00056                           *        <td align="center" ><code> show_ID_labels </code></td>
00057                           *        <td> If set to !=0, show poses ID labels </td>
00058                           *        <td align="center" > 0 (don't show) </td>
00059                           *   </tr>
00060                           *   <tr>
00061                           *        <td align="center" ><code> show_ground_grid </code></td>
00062                           *        <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>
00063                           *        <td align="center" > 1 (do show) </td>
00064                           *   </tr>
00065                           *   <tr>
00066                           *        <td align="center" ><code> show_edges </code></td>
00067                           *        <td> If set to !=0, draw lines between nodes with at least one edge between them. </td>
00068                           *        <td align="center" > 1 (do show) </td>
00069                           *   </tr>
00070                           *   <tr>
00071                           *        <td align="center" ><code> edge_color </code></td>
00072                           *        <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>
00073                           *        <td align="center" > 0x400000FF </td>
00074                           *   </tr>
00075                           *   <tr>
00076                           *        <td align="center" ><code> edge_width </code></td>
00077                           *        <td> If show_edges is !=0, the width of edge lines.</td>
00078                           *        <td align="center" > 2.0 </td>
00079                           *   </tr>
00080                           *   <tr>
00081                           *        <td align="center" ><code> show_node_corners </code></td>
00082                           *        <td> If set to !=0, draw a small 3D corner frame at each node (see mrpt::opengl::stock_objects::CornerXYZSimple). </td>
00083                           *        <td align="center" > 1 (do show) </td>
00084                           *   </tr>
00085                           *   <tr>
00086                           *        <td align="center" ><code> nodes_corner_scale </code></td>
00087                           *        <td> If show_node_corners!=0, the size (length) of te corner lines. </td>
00088                           *        <td align="center" > 0.7 </td>
00089                           *   </tr>
00090                           *   <tr>
00091                           *        <td align="center" ><code> nodes_point_size </code></td>
00092                           *        <td> If set to !=0, draw a point of the given size (glPointSize) at each node.</td>
00093                           *        <td align="center" > 0 (no points) </td>
00094                           *   </tr>
00095                           *   <tr>
00096                           *        <td align="center" ><code> nodes_point_color </code></td>
00097                           *        <td> If nodes_point_size!=0, set this value to a hexadecimal int value 0xRRGGBB with the desired RGB color of points.</td>
00098                           *        <td align="center" > 0xA0A0A0 (light gray) </td>
00099                           *   </tr>
00100                           *       </table>
00101                           *
00102                           * \sa mrpt::graphs::CNetworkOfPoses2D, mrpt::graphs::CNetworkOfPoses3D, mrpt::graphs::CNetworkOfPoses2DInf, mrpt::graphs::CNetworkOfPoses3DInf
00103                           * \note Implemented as headers-only in \a graph_tools_impl.h
00104                           * \ingroup mrpt_opengl_grp
00105                           */
00106                         template<class GRAPH_T>
00107                         CSetOfObjectsPtr graph_visualize(
00108                                 const GRAPH_T &g,
00109                                 const mrpt::utils::TParametersDouble &extra_params = mrpt::utils::TParametersDouble()
00110                                 );
00111 
00112                         /** @} */
00113                 }
00114         }
00115 
00116 } // End of namespace
00117 
00118 #include "graph_tools_impl.h"
00119 
00120 #endif



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011