26 #include "../../segment/ObjectClassMemorySegment.h"
41 for (SECRelationList::const_iterator it = relations.begin(); it != relations.end(); it++)
43 result->relations.push_back(SECRelationBasePtr::dynamicCast((*it)->ice_clone()));
56 float matchingRelationCount = 0;
58 for (SECRelationList::const_iterator itOther = other->relations.begin(); itOther != other->relations.end(); itOther++)
60 bool foundMatch =
false;
61 SECRelationBasePtr otherRel = *itOther;
63 for (SECRelationList::const_iterator it = relations.begin(); it != relations.end(); it++)
65 if (otherRel->isEqual(*it))
74 matchingRelationCount++;
78 return matchingRelationCount / (
float)relations.size();
84 for (SECRelationList::const_iterator it = relations.begin(); it != relations.end(); it++)
86 if (relation->isEqual(*it))
101 for (
unsigned int i = 0; i < newRelations.size(); i++)
108 rel->setName(newRelations.at(i)->getName());
112 relations.push_back(newRelations.at(i));
122 SECRelationList
list;
123 list.push_back(newRelation);
131 for (SECRelationList::const_iterator it = relations.begin(); it != relations.end(); it++)
146 ObjectClassList result;
148 for (SECRelationList::const_iterator it = relations.begin(); it != relations.end(); it++)
150 if ((*it)->getName() == relation->getName()
153 result.insert(result.end(), (*it)->objects2.begin(), (*it)->objects2.end());
165 for (
const SECRelationBasePtr& relation : compareRelations.relations)
177 std::stringstream result;
179 for (
size_t i = 0; i < relations.size(); i++)
181 result <<
"#" << i <<
": " << relations.at(i)->output() <<
"\n";
200 std::vector<armarx::VariantBasePtr> variants;
202 for (
unsigned int i = 0; i < relations.size(); i++)
205 variants.push_back(var);
208 obj->setVariantArray(
"relations", variants);
215 std::vector<armarx::VariantPtr> variants;
217 obj->getVariantArray(
"relations", variants);
218 relations.resize(variants.size());
220 for (
unsigned int i = 0; i < variants.size(); i++)
223 relations.at(i) = armarx::VariantPtr::dynamicCast(variants.at(i))->get<
SECRelation>();