Main MRPT website > C++ reference for MRPT 1.5.7
CHMHMapArc.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef CHMHMapArc_H
10 #define CHMHMapArc_H
11 
12 #include <mrpt/obs/CSensoryFrame.h>
15 
16 namespace mrpt
17 {
18  namespace hmtslam
19  {
21 
22  /** A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map.
23  * The arc itself will be considered only if some given hypothesisID matchs its own ID.
24  * \note Create objects by invoking the class factory "::Create"
25  *
26  * \sa CHierarchicalMHMap,CHMHMapNode
27  * \ingroup mrpt_hmtslam_grp
28  */
30  {
31  friend class CHierarchicalMHMap;
32  friend class CHMHMapNode;
34  friend class TArcList;
35 
36  // This must be added to any CSerializable derived class:
38 
39  public:
40  /** The hypothesis IDs under which this arc exists.
41  */
43 
44  protected:
45  /** The origin/target nodes for this arc.
46  */
48 
49  /** The hierarchical graph in which this object is into. */
51 
52 
53  /** Event handler to be called just before a node is being destroyed: it should be called only for nodes involved in the arc, altought other cases must be handled without effects
54  * When a node involved in the arc is delected, the corresponding pointer in the arc will be set to NULL and the arc is no longer a valid one.
55  */
56  void onNodeDestruction(CHMHMapNode *node);
57 
58  private:
59  /** Private constructor (see ::Create class factory)
60  */
61  CHMHMapArc(
62  const CHMHMapNode::TNodeID &from =0,
63  const CHMHMapNode::TNodeID &to =0,
64  const THypothesisIDSet &hyps = THypothesisIDSet(),
65  CHierarchicalMHMap *parent=NULL);
66 
67  /** Alternative constructor, using pointers for convenience.
68  */
69  CHMHMapArc(
70  CHMHMapNodePtr &from,
71  CHMHMapNodePtr &to,
72  const THypothesisIDSet &hyps,
73  CHierarchicalMHMap *parent);
74 
75  public:
76  /** Constructor from node IDs
77  */
78  static CHMHMapArcPtr Create(
79  const CHMHMapNode::TNodeID &from,
80  const CHMHMapNode::TNodeID &to,
81  const THypothesisIDSet &hyps = THypothesisIDSet(),
82  CHierarchicalMHMap *parent=NULL);
83 
84  /** Alternative constructor, using pointers for convenience.
85  */
86  static CHMHMapArcPtr Create(
87  CHMHMapNodePtr &from,
88  CHMHMapNodePtr &to,
89  const THypothesisIDSet &hyps,
90  CHierarchicalMHMap *parent);
91 
92  /** Destructor
93  */
94  virtual ~CHMHMapArc();
95 
96  /** Return the starting node of the arc:
97  */
98  CHMHMapNode::TNodeID getNodeFrom() const { ASSERT_(m_nodeFrom!=AREAID_INVALID); return m_nodeFrom; }
99 
100  /** Return the ending node of the arc:
101  */
102  CHMHMapNode::TNodeID getNodeTo() const { ASSERT_(m_nodeTo!=AREAID_INVALID); return m_nodeTo; }
103 
104  /** The type of the arc, the possibilities are:
105  - "Membership": for abstractions
106  - "Navegability"
107  - "RelativePose"
108  */
110 
111  /** The annotations of the arc, see the general description of the class for possible properties and values.
112  */
114 
115  }; // End of class def.
117 
118 
119  } // End of namespace
120 } // End of namespace
121 
122 #endif
THypothesisIDSet m_hypotheses
The hypothesis IDs under which this arc exists.
Definition: CHMHMapArc.h:42
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
Represents a set of nodes and arcs, posibly only a part of the whole hierarchical, multi-hypothesis map.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
utils::CMHPropertiesValuesList m_annotations
The annotations of the arc, see the general description of the class for possible properties and valu...
Definition: CHMHMapArc.h:113
class HMTSLAM_IMPEXP CHMHMapArc
Definition: CHMHMapNode.h:26
CHMHMapNode::TNodeID m_nodeTo
Definition: CHMHMapArc.h:47
#define AREAID_INVALID
utils::CTypeSelector m_arcType
The type of the arc, the possibilities are:
Definition: CHMHMapArc.h:109
CHMHMapNode::TNodeID getNodeFrom() const
Return the starting node of the arc:
Definition: CHMHMapArc.h:98
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
This class represents a std::string derived class which is also CSerializable.
Definition: CTypeSelector.h:25
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model...
#define ASSERT_(f)
A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map...
Definition: CHMHMapArc.h:29
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
A class for storing a sequence of arcs (a path).
A class for representing a node in a hierarchical, multi-hypothesis map.
Definition: CHMHMapNode.h:37
A wrapper class for pointers that can be safely copied with "=" operator without problems.
Definition: safe_pointers.h:64
mrpt::utils::safe_ptr< CHierarchicalMHMap > m_parent
The hierarchical graph in which this object is into.
Definition: CHMHMapArc.h:50
mrpt::utils::TNodeID TNodeID
The type of the IDs of nodes.
Definition: CHMHMapNode.h:49
CHMHMapNode::TNodeID getNodeTo() const
Return the ending node of the arc:
Definition: CHMHMapArc.h:102



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019