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://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 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                   * \ingroup mrpt_hmtslam_grp
00051                  */
00052                 class HMTSLAM_IMPEXP CHierarchicalMHMap : public mrpt::utils::CSerializable, public CHierarchicalMapMHPartition
00053                 {
00054                         friend class HMTSLAM_IMPEXP CHMHMapArc;
00055                         friend class HMTSLAM_IMPEXP CHMHMapNode;
00056 
00057                         // This must be added to any CSerializable derived class:
00058                         DEFINE_SERIALIZABLE( CHierarchicalMHMap )
00059                 protected:
00060                         /** Event handler to be called just after a node has being created: it will be added to the internal list.
00061                           */
00062                          void  onNodeAddition(CHMHMapNodePtr &node);
00063 
00064                         /** Event handler to be called just after an arc has being created: it will be added to the internal list.
00065                           */
00066                          void  onArcAddition(CHMHMapArcPtr &arc);
00067 
00068                         /** Event handler to be called just before a node is being destroyed: it will be removed from the internal list.
00069                           * \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.
00070                           */
00071                          void  onNodeDestruction(CHMHMapNode* node);
00072 
00073                         /** Event handler to be called just before an arc is being destroyed: it will be removed from the internal list.
00074                           * \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.
00075                           */
00076                          void  onArcDestruction(CHMHMapArc* arc);
00077 
00078                 public:
00079                          /** Default constructor
00080                           */
00081                          CHierarchicalMHMap();
00082 
00083                          /** Destructor
00084                           */
00085                          
00086                          /** Save the whole graph as a XML file */
00087                          void  dumpAsXMLfile(std::string fileName) const;
00088 
00089                          /** Load a graph from a XML file */
00090                          void loadFromXMLfile(std::string fileName);
00091 
00092 
00093                          virtual ~CHierarchicalMHMap();
00094 
00095                          /** Erase all the contents of map (It delete all nodes/arcs objects)
00096                            */
00097                          void  clear();
00098 
00099                 }; // End of class def.
00100 
00101         } // End of namespace
00102 } // End of namespace
00103 
00104 #endif



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