Main MRPT website > C++ reference for MRPT 1.5.7
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
mrpt::hmtslam::CHMHMapNode Class Reference

Detailed Description

A class for representing a node in a hierarchical, multi-hypothesis map.

The node itself will be considered only if some given hypothesisID matchs its own ID.

Note
Create objects by invoking the class factory "::Create"
See also
CHierarchicalMHMap,CHMHMapArc

Definition at line 37 of file CHMHMapNode.h.

#include <mrpt/hmtslam/CHMHMapNode.h>

Inheritance diagram for mrpt::hmtslam::CHMHMapNode:
Inheritance graph

Public Types

typedef mrpt::utils::TNodeID TNodeID
 The type of the IDs of nodes. More...
 

Public Member Functions

voidoperator new (size_t size)
 
voidoperator new[] (size_t size)
 
void operator delete (void *ptr) throw ()
 
void operator delete[] (void *ptr) throw ()
 
void operator delete (void *memory, void *ptr) throw ()
 
voidoperator new (size_t size, const std::nothrow_t &) throw ()
 
void operator delete (void *ptr, const std::nothrow_t &) throw ()
 
virtual ~CHMHMapNode ()
 Destructor. More...
 
TNodeID getID () const
 Reads the ID of the node (read-only property) More...
 
unsigned int getLevelInTheHierarchy ()
 Returns the level of this node in the hierarchy of arcs "arcType_Belongs", where level=0 is the ground level, 1=its parents, etc. More...
 
unsigned int getRelatedArcsCount ()
 Returns the number of arcs starting from/ending into this node. More...
 
void getArcs (TArcList &out) const
 Returns a list with the arcs from/to this node. More...
 
void getArcs (TArcList &out, const THypothesisID &hyp_id) const
 Returns a list with the arcs from/to this node existing in a given hypothesis ID. More...
 
void getArcs (TArcList &out, const char *arcType, const THypothesisID &hyp_id) const
 Returns a list with the arcs from/to this node existing in a given hypothesis ID and of a given type. More...
 
bool isNeighbor (const TNodeID &otherArea, const THypothesisID &hyp_id) const
 Check whether an arc exists towards the given area. More...
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More...
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static voidoperator new (size_t size, void *ptr)
 
static CHMHMapNodePtr Create (CHierarchicalMHMap *parent=NULL, const THypothesisIDSet &hyps=THypothesisIDSet())
 Class factory. More...
 

Public Attributes

THypothesisIDSet m_hypotheses
 The hypothesis IDs under which this node exists. More...
 
utils::CMHPropertiesValuesList m_annotations
 The annotations of the node, see the general description of the class for possible properties and values. More...
 
utils::CTypeSelector m_nodeType
 The type of the node, the possibilities are: More...
 
std::string m_label
 The label of the node, only for display it to the user. More...
 

Static Public Attributes

static const mrpt::utils::TRuntimeClassId classCObject
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCSerializable
 

Protected Member Functions

void onArcDestruction (CHMHMapArc *arc)
 Event handler for arc destruction: It should be only called for arcs from/to this node, altought other case must be handled without effects. More...
 
void onArcAddition (CHMHMapArcPtr &arc)
 Event handler for arc addition: It should be only called for arcs from/to this node, altought other cases have no effects. More...
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
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 be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 

Protected Attributes

TNodeID m_ID
 An unique identifier for the node: it is randomly generated at construction or read from stream when loaded. More...
 
TArcList m_arcs
 The list of all arcs from/to this node: More...
 
mrpt::utils::safe_ptr< CHierarchicalMHMapm_parent
 The hierarchical graph in which this object is into. More...
 

Private Member Functions

 CHMHMapNode (CHierarchicalMHMap *parent=NULL, const THypothesisIDSet &hyps=THypothesisIDSet())
 Private constructor (see ::Create class factory) More...
 

Friends

class HMTSLAM_IMPEXP CHierarchicalMHMap
 
class HMTSLAM_IMPEXP CHierarchicalMHMapPartition
 
class HMTSLAM_IMPEXP CHMHMapArc
 

RTTI stuff

typedef CHMHMapNodePtr Ptr
 
typedef CHMHMapNodePtr ConstPtr
 
static mrpt::utils::CLASSINIT _init_CHMHMapNode
 
static mrpt::utils::TRuntimeClassId classCHMHMapNode
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CHMHMapNodePtr Create ()
 

Member Typedef Documentation

typedef CHMHMapNodePtr mrpt::hmtslam::CHMHMapNode::ConstPtr

Definition at line 44 of file CHMHMapNode.h.

typedef CHMHMapNodePtr mrpt::hmtslam::CHMHMapNode::Ptr

A typedef for the associated smart pointer

Definition at line 44 of file CHMHMapNode.h.

The type of the IDs of nodes.

Definition at line 49 of file CHMHMapNode.h.

Constructor & Destructor Documentation

CHMHMapNode::CHMHMapNode ( CHierarchicalMHMap parent = NULL,
const THypothesisIDSet hyps = THypothesisIDSet() 
)
private

Private constructor (see ::Create class factory)

Definition at line 24 of file CHMHMapNode.cpp.

CHMHMapNode::~CHMHMapNode ( )
virtual

Destructor.

Definition at line 63 of file CHMHMapNode.cpp.

Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::hmtslam::CHMHMapNode::_GetBaseClass ( )
staticprotected
CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 143 of file CObject.h.

static CHMHMapNodePtr mrpt::hmtslam::CHMHMapNode::Create ( )
static
CHMHMapNodePtr CHMHMapNode::Create ( CHierarchicalMHMap parent = NULL,
const THypothesisIDSet hyps = THypothesisIDSet() 
)
static

Class factory.

Definition at line 50 of file CHMHMapNode.cpp.

References mrpt::hmtslam::CHMHMapNode, and mrpt::hmtslam::CHierarchicalMHMap::onNodeAddition().

static mrpt::utils::CObject* mrpt::hmtslam::CHMHMapNode::CreateObject ( )
static
virtual mrpt::utils::CObject* mrpt::hmtslam::CHMHMapNode::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 140 of file CObject.h.

Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().

void mrpt::hmtslam::CHMHMapNode::getArcs ( TArcList out) const
inline

Returns a list with the arcs from/to this node.

Definition at line 125 of file CHMHMapNode.h.

References DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE, and HMTSLAM_IMPEXP.

void CHMHMapNode::getArcs ( TArcList out,
const THypothesisID hyp_id 
) const

Returns a list with the arcs from/to this node existing in a given hypothesis ID.

Definition at line 202 of file CHMHMapNode.cpp.

void CHMHMapNode::getArcs ( TArcList out,
const char *  arcType,
const THypothesisID hyp_id 
) const

Returns a list with the arcs from/to this node existing in a given hypothesis ID and of a given type.

Definition at line 214 of file CHMHMapNode.cpp.

CHMHMapNode::TNodeID CHMHMapNode::getID ( ) const

Reads the ID of the node (read-only property)

Definition at line 164 of file CHMHMapNode.cpp.

Referenced by mrpt::hmtslam::CHierarchicalMHMap::onNodeDestruction(), and mrpt::hmtslam::CHMHMapArc::onNodeDestruction().

unsigned int CHMHMapNode::getLevelInTheHierarchy ( )

Returns the level of this node in the hierarchy of arcs "arcType_Belongs", where level=0 is the ground level, 1=its parents, etc.

Definition at line 172 of file CHMHMapNode.cpp.

unsigned int CHMHMapNode::getRelatedArcsCount ( )

Returns the number of arcs starting from/ending into this node.

Definition at line 194 of file CHMHMapNode.cpp.

virtual const mrpt::utils::TRuntimeClassId* mrpt::hmtslam::CHMHMapNode::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

bool CHMHMapNode::isNeighbor ( const TNodeID otherArea,
const THypothesisID hyp_id 
) const

Check whether an arc exists towards the given area.

Definition at line 225 of file CHMHMapNode.cpp.

void CHMHMapNode::onArcAddition ( CHMHMapArcPtr &  arc)
protected

Event handler for arc addition: It should be only called for arcs from/to this node, altought other cases have no effects.

Definition at line 146 of file CHMHMapNode.cpp.

References MRPT_END, and MRPT_START.

void CHMHMapNode::onArcDestruction ( CHMHMapArc arc)
protected

Event handler for arc destruction: It should be only called for arcs from/to this node, altought other case must be handled without effects.

Note
At *addition we use a smart pointer to assure all the implied guys use the same smrt. pnt., but at destructors the objects don't know anything but "this", thus the usage of plain pointers.

Definition at line 124 of file CHMHMapNode.cpp.

References mrpt::hmtslam::CHMHMapArc::m_nodeFrom, mrpt::hmtslam::CHMHMapArc::m_nodeTo, MRPT_END, and MRPT_START.

void mrpt::hmtslam::CHMHMapNode::operator delete ( void ptr)
throw (
)
inline

Definition at line 44 of file CHMHMapNode.h.

void mrpt::hmtslam::CHMHMapNode::operator delete ( void memory,
void ptr 
)
throw (
)
inline

Definition at line 44 of file CHMHMapNode.h.

void mrpt::hmtslam::CHMHMapNode::operator delete ( void ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 44 of file CHMHMapNode.h.

void mrpt::hmtslam::CHMHMapNode::operator delete[] ( void ptr)
throw (
)
inline

Definition at line 44 of file CHMHMapNode.h.

void* mrpt::hmtslam::CHMHMapNode::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 44 of file CHMHMapNode.h.

void* mrpt::hmtslam::CHMHMapNode::operator new ( size_t  size)
inline

Definition at line 44 of file CHMHMapNode.h.

static void* mrpt::hmtslam::CHMHMapNode::operator new ( size_t  size,
void ptr 
)
inlinestatic

Definition at line 44 of file CHMHMapNode.h.

void* mrpt::hmtslam::CHMHMapNode::operator new[] ( size_t  size)
inline

Definition at line 44 of file CHMHMapNode.h.

void CHMHMapNode::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 97 of file CHMHMapNode.cpp.

References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB.

Definition at line 79 of file CSerializable.h.

References BASE_IMPEXP, DEFINE_MRPT_OBJECT_POST, mrpt::utils::ObjectToOctetVector(), mrpt::utils::ObjectToRawString(), mrpt::utils::ObjectToString(), mrpt::utils::OctetVectorToObject(), mrpt::utils::RawStringToObject(), and mrpt::utils::StringToObject().

Referenced by mrpt::poses::operator<<(), mrpt::utils::TCamera::readFromStream(), mrpt::obs::CObservationImage::readFromStream(), mrpt::obs::CObservationStereoImages::readFromStream(), mrpt::obs::CObservation2DRangeScan::readFromStream(), and mrpt::utils::CImage::readFromStream().

void CHMHMapNode::writeToStream ( mrpt::utils::CStream out,
int getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 78 of file CHMHMapNode.cpp.

Friends And Related Function Documentation

friend class HMTSLAM_IMPEXP CHierarchicalMHMap
friend

Definition at line 39 of file CHMHMapNode.h.

friend class HMTSLAM_IMPEXP CHierarchicalMHMapPartition
friend

Definition at line 40 of file CHMHMapNode.h.

friend class HMTSLAM_IMPEXP CHMHMapArc
friend

Definition at line 41 of file CHMHMapNode.h.

Member Data Documentation

mrpt::utils::CLASSINIT mrpt::hmtslam::CHMHMapNode::_init_CHMHMapNode
staticprotected

Definition at line 44 of file CHMHMapNode.h.

mrpt::utils::TRuntimeClassId mrpt::hmtslam::CHMHMapNode::classCHMHMapNode
static

Definition at line 44 of file CHMHMapNode.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 128 of file CObject.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 42 of file CSerializable.h.

const mrpt::utils::TRuntimeClassId* mrpt::hmtslam::CHMHMapNode::classinfo
static

Definition at line 44 of file CHMHMapNode.h.

utils::CMHPropertiesValuesList mrpt::hmtslam::CHMHMapNode::m_annotations

The annotations of the node, see the general description of the class for possible properties and values.

Definition at line 97 of file CHMHMapNode.h.

TArcList mrpt::hmtslam::CHMHMapNode::m_arcs
protected

The list of all arcs from/to this node:

Definition at line 62 of file CHMHMapNode.h.

THypothesisIDSet mrpt::hmtslam::CHMHMapNode::m_hypotheses

The hypothesis IDs under which this node exists.

Definition at line 53 of file CHMHMapNode.h.

TNodeID mrpt::hmtslam::CHMHMapNode::m_ID
protected

An unique identifier for the node: it is randomly generated at construction or read from stream when loaded.

Definition at line 58 of file CHMHMapNode.h.

std::string mrpt::hmtslam::CHMHMapNode::m_label

The label of the node, only for display it to the user.

Definition at line 113 of file CHMHMapNode.h.

utils::CTypeSelector mrpt::hmtslam::CHMHMapNode::m_nodeType

The type of the node, the possibilities are:

  • Place
  • Area
  • TopologicalMap
  • Object

Definition at line 105 of file CHMHMapNode.h.

mrpt::utils::safe_ptr<CHierarchicalMHMap> mrpt::hmtslam::CHMHMapNode::m_parent
protected

The hierarchical graph in which this object is into.

Definition at line 75 of file CHMHMapNode.h.




Page generated by Doxygen 1.8.11 for MRPT 1.5.7 Git: 2190203 Tue May 15 02:01:15 2018 +0200 at miƩ may 16 12:40:16 CEST 2018