Main MRPT website > C++ reference
MRPT logo
CHierarchicalMHMap.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 CHierarchicalMHMap_H
29 #define CHierarchicalMHMap_H
30 
34 #include <mrpt/slam/CSimpleMap.h>
37 
38 
39 namespace mrpt
40 {
41  namespace hmtslam
42  {
43  using namespace mrpt::slam;
44 
46 
47  /** The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model.
48  * This class is used within the HMT-SLAM implementation in CHMTSLAM.
49  * \sa CHMTSLAM, CHMHMapArc, CHMHMapNode, CHierarchicalMHMapPartition
50  * \ingroup mrpt_hmtslam_grp
51  */
53  {
54  friend class HMTSLAM_IMPEXP CHMHMapArc;
56 
57  // This must be added to any CSerializable derived class:
59  protected:
60  /** Event handler to be called just after a node has being created: it will be added to the internal list.
61  */
62  void onNodeAddition(CHMHMapNodePtr &node);
63 
64  /** Event handler to be called just after an arc has being created: it will be added to the internal list.
65  */
66  void onArcAddition(CHMHMapArcPtr &arc);
67 
68  /** Event handler to be called just before a node is being destroyed: it will be removed from the internal list.
69  * \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.
70  */
71  void onNodeDestruction(CHMHMapNode* node);
72 
73  /** Event handler to be called just before an arc is being destroyed: it will be removed from the internal list.
74  * \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.
75  */
76  void onArcDestruction(CHMHMapArc* arc);
77 
78  public:
79  /** Default constructor
80  */
82 
83  /** Destructor
84  */
85 
86  /** Save the whole graph as a XML file */
87  void dumpAsXMLfile(std::string fileName) const;
88 
89  /** Load a graph from a XML file */
90  void loadFromXMLfile(std::string fileName);
91 
92 
93  virtual ~CHierarchicalMHMap();
94 
95  /** Erase all the contents of map (It delete all nodes/arcs objects)
96  */
97  void clear();
98 
99  }; // End of class def.
100 
101  } // End of namespace
102 } // End of namespace
103 
104 #endif



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