48 }
while (m_parent->getNodeByID(m_ID));
55 CHMHMapNode::~CHMHMapNode()
58 if (m_parent.get()) m_parent->onNodeDestruction(
this);
62 (*it)->onNodeDestruction(
this);
65 uint8_t CHMHMapNode::serializeGetVersion()
const {
return 0; }
68 out << m_ID << m_label;
74 void CHMHMapNode::serializeFrom(
81 in >> m_ID >> m_label >> m_nodeType >> m_annotations >>
107 if (it != m_arcs.end()) m_arcs.erase(it);
121 if (arc->m_nodeFrom == m_ID || arc->m_nodeTo == m_ID)
125 if (it == m_arcs.end()) m_arcs.push_back(arc);
137 unsigned int CHMHMapNode::getLevelInTheHierarchy()
140 unsigned int level = 0;
142 for (itArc = m_arcs.begin(); itArc != m_arcs.end(); itArc++)
146 if ((*itArc)->m_arcType ==
"Membership" &&
147 (*itArc)->m_nodeTo == this->m_ID)
149 unsigned int L = m_parent->getNodeByID((*itArc)->m_nodeFrom)
150 ->getLevelInTheHierarchy();
161 unsigned int CHMHMapNode::getRelatedArcsCount()
163 return (
unsigned int)m_arcs.size();
173 if ((*it)->m_hypotheses.has(hyp_id)) out.push_back(*it);
179 void CHMHMapNode::getArcs(
183 for (
const auto&
a : m_arcs)
184 if (
a->m_hypotheses.has(hyp_id) &&
a->m_arcType == arcType)
191 bool CHMHMapNode::isNeighbor(
195 if ((*it)->m_hypotheses.has(hyp_id) &&
196 ((*it)->m_nodeFrom == otherArea || (*it)->m_nodeTo == otherArea))