Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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  */
57 
58  private:
59  /** Private constructor (see ::Create class factory)
60  */
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  */
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
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define AREAID_INVALID
A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map.
Definition: CHMHMapArc.h:30
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
void onNodeDestruction(CHMHMapNode *node)
Event handler to be called just before a node is being destroyed: it should be called only for nodes ...
CHMHMapNode::TNodeID getNodeTo() const
Return the ending node of the arc:
Definition: CHMHMapArc.h:102
THypothesisIDSet m_hypotheses
The hypothesis IDs under which this arc exists.
Definition: CHMHMapArc.h:42
CHMHMapNode::TNodeID getNodeFrom() const
Return the starting node of the arc:
Definition: CHMHMapArc.h:98
mrpt::utils::safe_ptr< CHierarchicalMHMap > m_parent
The hierarchical graph in which this object is into.
Definition: CHMHMapArc.h:50
CHMHMapArc(CHMHMapNodePtr &from, CHMHMapNodePtr &to, const THypothesisIDSet &hyps, CHierarchicalMHMap *parent)
Alternative constructor, using pointers for convenience.
static CHMHMapArcPtr Create(CHMHMapNodePtr &from, CHMHMapNodePtr &to, const THypothesisIDSet &hyps, CHierarchicalMHMap *parent)
Alternative constructor, using pointers for convenience.
CHMHMapNode::TNodeID m_nodeFrom
The origin/target nodes for this arc.
Definition: CHMHMapArc.h:47
CHMHMapArc(const CHMHMapNode::TNodeID &from=0, const CHMHMapNode::TNodeID &to=0, const THypothesisIDSet &hyps=THypothesisIDSet(), CHierarchicalMHMap *parent=NULL)
Private constructor (see ::Create class factory)
static CHMHMapArcPtr Create(const CHMHMapNode::TNodeID &from, const CHMHMapNode::TNodeID &to, const THypothesisIDSet &hyps=THypothesisIDSet(), CHierarchicalMHMap *parent=NULL)
Constructor from node IDs.
virtual ~CHMHMapArc()
Destructor.
utils::CTypeSelector m_arcType
The type of the arc, the possibilities are:
Definition: CHMHMapArc.h:109
A class for representing a node in a hierarchical, multi-hypothesis map.
Definition: CHMHMapNode.h:38
mrpt::utils::TNodeID TNodeID
The type of the IDs of nodes.
Definition: CHMHMapNode.h:49
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model.
Represents a set of nodes and arcs, posibly only a part of the whole hierarchical,...
A class for storing a sequence of arcs (a path).
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:40
This class represents a std::string derived class which is also CSerializable.
Definition: CTypeSelector.h:26
#define HMTSLAM_IMPEXP
#define ASSERT_(f)
Definition: mrpt_macros.h:261
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A wrapper class for pointers that can be safely copied with "=" operator without problems.
Definition: safe_pointers.h:65



Page generated by Doxygen 1.9.1 for MRPT 1.4.0 SVN: at Sat Jan 30 21:34:41 UTC 2021