MRPT  2.0.4
CHierarchicalMHMap.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
15 #include <mrpt/maps/CSimpleMap.h>
17 
18 namespace mrpt::hmtslam
19 {
20 /** The most high level class for storing hybrid, multi-hypothesis maps in a
21  * graph-based model.
22  * This class is used within the HMT-SLAM implementation in CHMTSLAM.
23  * \sa CHMTSLAM, CHMHMapArc, CHMHMapNode, CHierarchicalMHMapPartition
24  * \ingroup mrpt_hmtslam_grp
25  */
28 {
29  friend class CHMHMapArc;
30  friend class CHMHMapNode;
31 
33  protected:
34  /** Event handler to be called just after a node has being created: it will
35  * be added to the internal list.
36  */
37  void onNodeAddition(CHMHMapNode::Ptr& node);
38 
39  /** Event handler to be called just after an arc has being created: it will
40  * be added to the internal list.
41  */
42  void onArcAddition(CHMHMapArc::Ptr& arc);
43 
44  /** Event handler to be called just before a node is being destroyed: it
45  * will be removed from the internal list.
46  * \note At *addition we use a smart pointer to assure all the implied guys
47  * use the same smrt. pnt., but at destructors the objects don't know
48  * anything but "this", thus the usage of plain pointers.
49  */
50  void onNodeDestruction(CHMHMapNode* node);
51 
52  /** Event handler to be called just before an arc is being destroyed: it
53  * will be removed from the internal list.
54  * \note At *addition we use a smart pointer to assure all the implied guys
55  * use the same smrt. pnt., but at destructors the objects don't know
56  * anything but "this", thus the usage of plain pointers.
57  */
58  void onArcDestruction(CHMHMapArc* arc);
59 
60  public:
61  /** Default constructor
62  */
64 
65  /** Destructor
66  */
67 
68  /** Save the whole graph as a XML file */
69  void dumpAsXMLfile(std::string fileName) const;
70 
71  /** Load a graph from a XML file */
72  void loadFromXMLfile(std::string fileName);
73 
74  ~CHierarchicalMHMap() override;
75 
76  /** Erase all the contents of map (It delete all nodes/arcs objects)
77  */
78  void clear();
79 
80 }; // End of class def.
81 
82 } // namespace mrpt::hmtslam
void onArcAddition(CHMHMapArc::Ptr &arc)
Event handler to be called just after an arc has being created: it will be added to the internal list...
Represents a set of nodes and arcs, posibly only a part of the whole hierarchical, multi-hypothesis map.
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
void onArcDestruction(CHMHMapArc *arc)
Event handler to be called just before an arc is being destroyed: it will be removed from the interna...
void onNodeDestruction(CHMHMapNode *node)
Event handler to be called just before a node is being destroyed: it will be removed from the interna...
void clear()
Erase all the contents of map (It delete all nodes/arcs objects)
void dumpAsXMLfile(std::string fileName) const
Destructor.
void loadFromXMLfile(std::string fileName)
Load a graph from a XML file.
void onNodeAddition(CHMHMapNode::Ptr &node)
Event handler to be called just after a node has being created: it will be added to the internal list...
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map...
Definition: CHMHMapArc.h:28
CHierarchicalMHMap()
Default constructor.
A class for representing a node in a hierarchical, multi-hypothesis map.
Definition: CHMHMapNode.h:33



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020