Main MRPT website > C++ reference
MRPT logo
CHMHMapArc.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 CHMHMapArc_H
29 #define CHMHMapArc_H
30 
34 
35 namespace mrpt
36 {
37  namespace hmtslam
38  {
39  using namespace mrpt::slam;
41 
42  /** A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map.
43  * The arc itself will be considered only if some given hypothesisID matchs its own ID.
44  * \note Create objects by invoking the class factory "::Create"
45  *
46  * \sa CHierarchicalMHMap,CHMHMapNode
47  * \ingroup mrpt_hmtslam_grp
48  */
50  {
54  friend class TArcList;
55 
56  // This must be added to any CSerializable derived class:
58 
59  public:
60  /** The hypothesis IDs under which this arc exists.
61  */
62  THypothesisIDSet m_hypotheses;
63 
64  protected:
65  /** The origin/target nodes for this arc.
66  */
67  CHMHMapNode::TNodeID m_nodeFrom, m_nodeTo;
68 
69  /** The hierarchical graph in which this object is into.
70  */
72 
73 
74  /** 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
75  * 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.
76  */
77  void onNodeDestruction(CHMHMapNode *node);
78 
79  private:
80  /** Private constructor (see ::Create class factory)
81  */
82  CHMHMapArc(
83  const CHMHMapNode::TNodeID &from =0,
84  const CHMHMapNode::TNodeID &to =0,
85  const THypothesisIDSet &hyps = THypothesisIDSet(),
86  CHierarchicalMHMap *parent=NULL);
87 
88  /** Alternative constructor, using pointers for convenience.
89  */
90  CHMHMapArc(
91  CHMHMapNodePtr &from,
92  CHMHMapNodePtr &to,
93  const THypothesisIDSet &hyps,
94  CHierarchicalMHMap *parent);
95 
96  public:
97  /** Constructor from node IDs
98  */
99  static CHMHMapArcPtr Create(
100  const CHMHMapNode::TNodeID &from,
101  const CHMHMapNode::TNodeID &to,
102  const THypothesisIDSet &hyps = THypothesisIDSet(),
103  CHierarchicalMHMap *parent=NULL);
104 
105  /** Alternative constructor, using pointers for convenience.
106  */
107  static CHMHMapArcPtr Create(
108  CHMHMapNodePtr &from,
109  CHMHMapNodePtr &to,
110  const THypothesisIDSet &hyps,
111  CHierarchicalMHMap *parent);
112 
113  /** Destructor
114  */
115  virtual ~CHMHMapArc();
116 
117  /** Return the starting node of the arc:
118  */
119  CHMHMapNode::TNodeID getNodeFrom() const { ASSERT_(m_nodeFrom!=AREAID_INVALID); return m_nodeFrom; }
120 
121  /** Return the ending node of the arc:
122  */
123  CHMHMapNode::TNodeID getNodeTo() const { ASSERT_(m_nodeTo!=AREAID_INVALID); return m_nodeTo; }
124 
125  /** The type of the arc, the possibilities are:
126  - "Membership": for abstractions
127  - "Navegability"
128  - "RelativePose"
129  */
131 
132  /** The annotations of the arc, see the general description of the class for possible properties and values.
133  */
135 
136  }; // End of class def.
137 
138 
139  } // End of namespace
140 } // End of namespace
141 
142 #endif



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