38 CHMHMapArcPtr CHMHMapArc::Create(
44 CHMHMapArcPtr
obj = CHMHMapArcPtr(
new CHMHMapArc(from,to,hyps,parent));
50 node->onArcAddition(
obj);
52 node->onArcAddition(
obj);
86 CHMHMapArcPtr
obj = CHMHMapArcPtr(
new CHMHMapArc(from,to,hyps,parent));
92 if (from) from->onArcAddition(
obj);
93 if (to) to->onArcAddition(
obj);
107 node->onArcDestruction(
this);
109 node->onArcDestruction(
this);
164 if (it->pointer()==
this)
170 ASSERTMSG_(myPtr.present(),
"I cannot be found in my parent HMT map!")
178 node->onArcAddition(myPtr);
180 node->onArcAddition(myPtr);
195 printf(
"Dumping arcs list: %u elements\n", (
unsigned int)
size());
198 printf(
"\t'%s'\t-> '%s'\n", (*i)->m_parent->getNodeByID( (*i)->getNodeFrom() )->m_label.c_str(),
199 (*i)->m_parent->getNodeByID( (*i)->getNodeTo() )->m_label.c_str() );
218 out << static_cast<uint32_t>(this->
size());
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
#define ARC_TYPES
Used in constructor of mrpt::hmtslam::CHMHMapArc.
A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map.
CHMHMapArc(const CHMHMapNode::TNodeID &from=0, const CHMHMapNode::TNodeID &to=0, const THypothesisIDSet &hyps=THypothesisIDSet(), CHierarchicalMHMap *parent=NULL)
Private constructor (see ::Create class factory)
utils::CMHPropertiesValuesList m_annotations
The annotations of the arc, see the general description of the class for possible properties and valu...
THypothesisIDSet m_hypotheses
The hypothesis IDs under which this arc exists.
mrpt::utils::safe_ptr< CHierarchicalMHMap > m_parent
The hierarchical graph in which this object is into.
static CHMHMapArcPtr Create()
CHMHMapNode::TNodeID m_nodeFrom
The origin/target nodes for this arc.
CHMHMapNode::TNodeID m_nodeTo
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
void onNodeDestruction(CHMHMapNode *node)
Event handler to be called just before a node is being destroyed: it should be called only for nodes ...
virtual ~CHMHMapArc()
Destructor.
utils::CTypeSelector m_arcType
The type of the arc, the possibilities are:
A class for representing a node in a hierarchical, multi-hypothesis map.
mrpt::utils::TNodeID TNodeID
The type of the IDs of nodes.
TNodeID getID() const
Reads the ID of the node (read-only property)
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model.
void onArcAddition(CHMHMapArcPtr &arc)
Event handler to be called just after an arc has being created: it will be added to the internal list...
CHMHMapNodePtr getNodeByID(CHMHMapNode::TNodeID id)
Returns the node with the given ID, or NULL if it does not exist.
void read(utils::CStream &in)
void write(utils::CStream &out) const
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
std::string getType() const
Gets the currently selected type, from the set of posibilities.
void setType(const std::string &type)
Sets the currently selected type.
const Scalar * const_iterator
EIGEN_STRONG_INLINE void push_back(Scalar val)
Insert an element at the end of the container (for 1D vectors/arrays)
EIGEN_STRONG_INLINE iterator begin()
GLsizei GLsizei GLuint * obj
GLuint GLuint GLsizei GLenum type
GLsizei const GLchar ** string
uint64_t TNodeID
The type for node IDs in graphs of different types.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define ASSERTMSG_(f, __ERROR_MSG)
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
class HMTSLAM_IMPEXP CHMHMapArc
void clear()
Clear the contents of this container.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned __int32 uint32_t