Main MRPT website > C++ reference
MRPT logo
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-2014, 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 
15 
16 namespace mrpt
17 {
18  namespace hmtslam
19  {
20  using namespace mrpt::slam;
22 
23  /** A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map.
24  * The arc itself will be considered only if some given hypothesisID matchs its own ID.
25  * \note Create objects by invoking the class factory "::Create"
26  *
27  * \sa CHierarchicalMHMap,CHMHMapNode
28  * \ingroup mrpt_hmtslam_grp
29  */
31  {
35  friend class TArcList;
36 
37  // This must be added to any CSerializable derived class:
39 
40  public:
41  /** The hypothesis IDs under which this arc exists.
42  */
43  THypothesisIDSet m_hypotheses;
44 
45  protected:
46  /** The origin/target nodes for this arc.
47  */
48  CHMHMapNode::TNodeID m_nodeFrom, m_nodeTo;
49 
50  /** The hierarchical graph in which this object is into.
51  */
53 
54 
55  /** 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
56  * 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.
57  */
58  void onNodeDestruction(CHMHMapNode *node);
59 
60  private:
61  /** Private constructor (see ::Create class factory)
62  */
63  CHMHMapArc(
64  const CHMHMapNode::TNodeID &from =0,
65  const CHMHMapNode::TNodeID &to =0,
66  const THypothesisIDSet &hyps = THypothesisIDSet(),
67  CHierarchicalMHMap *parent=NULL);
68 
69  /** Alternative constructor, using pointers for convenience.
70  */
71  CHMHMapArc(
72  CHMHMapNodePtr &from,
73  CHMHMapNodePtr &to,
74  const THypothesisIDSet &hyps,
75  CHierarchicalMHMap *parent);
76 
77  public:
78  /** Constructor from node IDs
79  */
80  static CHMHMapArcPtr Create(
81  const CHMHMapNode::TNodeID &from,
82  const CHMHMapNode::TNodeID &to,
83  const THypothesisIDSet &hyps = THypothesisIDSet(),
84  CHierarchicalMHMap *parent=NULL);
85 
86  /** Alternative constructor, using pointers for convenience.
87  */
88  static CHMHMapArcPtr Create(
89  CHMHMapNodePtr &from,
90  CHMHMapNodePtr &to,
91  const THypothesisIDSet &hyps,
92  CHierarchicalMHMap *parent);
93 
94  /** Destructor
95  */
96  virtual ~CHMHMapArc();
97 
98  /** Return the starting node of the arc:
99  */
100  CHMHMapNode::TNodeID getNodeFrom() const { ASSERT_(m_nodeFrom!=AREAID_INVALID); return m_nodeFrom; }
101 
102  /** Return the ending node of the arc:
103  */
104  CHMHMapNode::TNodeID getNodeTo() const { ASSERT_(m_nodeTo!=AREAID_INVALID); return m_nodeTo; }
105 
106  /** The type of the arc, the possibilities are:
107  - "Membership": for abstractions
108  - "Navegability"
109  - "RelativePose"
110  */
112 
113  /** The annotations of the arc, see the general description of the class for possible properties and values.
114  */
116 
117  }; // End of class def.
119 
120 
121  } // End of namespace
122 } // End of namespace
123 
124 #endif
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
#define HMTSLAM_IMPEXP
CHMHMapNode::TNodeID getNodeTo() const
Return the ending node of the arc:
Definition: CHMHMapArc.h:104
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:35
utils::CMHPropertiesValuesList m_annotations
The annotations of the arc, see the general description of the class for possible properties and valu...
Definition: CHMHMapArc.h:115
uint64_t TNodeID
The type for node IDs in graphs of different types.
Definition: types_simple.h:39
#define AREAID_INVALID
utils::CTypeSelector m_arcType
The type of the arc, the possibilities are:
Definition: CHMHMapArc.h:111
This namespace contains algorithms for SLAM, localization, map building, representation of robot's ac...
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:30
#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:39
A wrapper class for pointers that can be safely copied with "=" operator without problems.
Definition: safe_pointers.h:67
mrpt::utils::TNodeID TNodeID
The type of the IDs of nodes.
Definition: CHMHMapNode.h:51



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014