Main MRPT website > C++ reference
MRPT logo

CHierarchicalMHMap.h

Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                   http://mrpt.sourceforge.net/                            |
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 CHierarchicalMHMap_H
00029 #define CHierarchicalMHMap_H
00030 
00031 #include <mrpt/hmtslam/CHMHMapNode.h>
00032 #include <mrpt/hmtslam/CHMHMapArc.h>
00033 #include <mrpt/hmtslam/CHierarchicalMapMHPartition.h>
00034 #include <mrpt/slam/CSimpleMap.h>
00035 #include <mrpt/slam/CMultiMetricMap.h>
00036 #include <mrpt/utils/CSerializable.h>
00037 
00038 
00039 namespace mrpt
00040 {
00041         namespace hmtslam
00042         {
00043                 using namespace mrpt::slam;
00044 
00045                 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CHierarchicalMHMap, mrpt::utils::CSerializable,  HMTSLAM_IMPEXP )
00046 
00047                 /** The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model.
00048                  *   This class is used within the HMT-SLAM implementation in CHMTSLAM.
00049                  * \sa CHMTSLAM, CHMHMapArc, CHMHMapNode, CHierarchicalMHMapPartition
00050                  */
00051                 class HMTSLAM_IMPEXP CHierarchicalMHMap : public mrpt::utils::CSerializable, public CHierarchicalMapMHPartition
00052                 {
00053                         friend class HMTSLAM_IMPEXP CHMHMapArc;
00054                         friend class HMTSLAM_IMPEXP CHMHMapNode;
00055 
00056                         // This must be added to any CSerializable derived class:
00057                         DEFINE_SERIALIZABLE( CHierarchicalMHMap )
00058                 protected:
00059                         /** Event handler to be called just after a node has being created: it will be added to the internal list.
00060                           */
00061                          void  onNodeAddition(CHMHMapNodePtr &node);
00062 
00063                         /** Event handler to be called just after an arc has being created: it will be added to the internal list.
00064                           */
00065                          void  onArcAddition(CHMHMapArcPtr &arc);
00066 
00067                         /** Event handler to be called just before a node is being destroyed: it will be removed from the internal list.
00068                           * \note At *addition we use a smart pointer to assure all the implied guys use the same smrt. pnt., but at destructors the objects don't know anything but "this", thus the usage of plain pointers.
00069                           */
00070                          void  onNodeDestruction(CHMHMapNode* node);
00071 
00072                         /** Event handler to be called just before an arc is being destroyed: it will be removed from the internal list.
00073                           * \note At *addition we use a smart pointer to assure all the implied guys use the same smrt. pnt., but at destructors the objects don't know anything but "this", thus the usage of plain pointers.
00074                           */
00075                          void  onArcDestruction(CHMHMapArc* arc);
00076 
00077                 public:
00078                          /** Default constructor
00079                           */
00080                          CHierarchicalMHMap();
00081 
00082                          /** Destructor
00083                           */
00084                          
00085                          /** Save the whole graph as a XML file */
00086                          void  dumpAsXMLfile(std::string fileName) const;
00087 
00088                          /** Load a graph from a XML file */
00089                          void loadFromXMLfile(std::string fileName);
00090 
00091 
00092                          virtual ~CHierarchicalMHMap();
00093 
00094                          /** Erase all the contents of map (It delete all nodes/arcs objects)
00095                            */
00096                          void  clear();
00097 
00098                 }; // End of class def.
00099 
00100         } // End of namespace
00101 } // End of namespace
00102 
00103 #endif



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011