31 if (objectA == 0 || objectB == 0)
33 std::cerr<<
"invalid tracks\n";
36 for (
size_t i = 0; i < objectA->objects.size() && i < objectB->objects.size(); ++i)
41 if (objectA->objects[i] == 0 || objectB->objects[i] == 0)
48 objectA->objects[i]->pose);
51 voteFromBForReferencePoseA),
52 objectA->objects[i]->pose));
54 voteFromBForReferencePoseA->patternName =
patternName;
55 voteFromBForReferencePoseA->observedId = objectB->observedId;
56 voteFromBForReferencePoseA->objectType = objectB->type;
57 voteFromBForReferencePoseA->trackIndex = i;
58 voteFromBForReferencePoseA->weight = 0;
63 objectB->objects[i]->pose);
66 voteFromAForReferencePoseB),
67 objectB->objects[i]->pose));
69 voteFromAForReferencePoseB->patternName =
patternName;
70 voteFromAForReferencePoseB->observedId = objectA->observedId;
71 voteFromAForReferencePoseB->objectType = objectA->type;
72 voteFromAForReferencePoseB->trackIndex = i;
73 voteFromAForReferencePoseB->weight = 0;
74 this->votesFromAForReferencePoseB.push_back(voteFromAForReferencePoseB);
90 std::cerr<<
"invalid tracks\n";
94 for (
size_t i = 0; i < objectA->objects.size(); ++i)
99 if (objectA->objects[i] == 0)
108 voteFromBForReferencePoseA->patternName =
patternName;
109 voteFromBForReferencePoseA->observedId = objectA->observedId;
110 voteFromBForReferencePoseA->objectType = objectA->type;
111 voteFromBForReferencePoseA->trackIndex = i;
112 voteFromBForReferencePoseA->weight = 0;
116 voteFromAForReferencePoseB->patternName =
patternName;
117 voteFromAForReferencePoseB->observedId = objectA->observedId;
118 voteFromAForReferencePoseB->objectType = objectA->type;
119 voteFromAForReferencePoseB->trackIndex = i;
120 voteFromAForReferencePoseB->weight = 0;
121 this->votesFromAForReferencePoseB.push_back(voteFromAForReferencePoseB);
178 std::ostringstream os;
179 strm <<
"Topology [";
180 for (ObjectRelations::iterator it = relations.begin(); it != relations.end();)
183 os <<
"\t- Relation " << it->first <<
" : " << it->second << std::endl;
186 if (it != relations.end())
193 strm <<
"] with relations : " << std::endl << os.str();
boost::shared_ptr< Quaternion > QuaternionPtr
static VoteSpecifierPtr createVoteSpecifier(const PosePtr &sourcePose, const PosePtr &refPose)
std::vector< ISM::VoteSpecifierPtr > getVotesFromBForReferencePoseA() const
boost::shared_ptr< ISM::ObjectRelation > ObjectRelationPtr
static PosePtr getPoseFromVote(const PosePtr &source, const VoteSpecifierPtr &vote)
std::vector< VoteSpecifierPtr > votesFromAForReferencePoseB
std::string getObjectTypeA() const
virtual void serialize(std::ostream &strm) const
std::map< unsigned int, ISM::ObjectRelationPtr, std::less< unsigned > > ObjectRelations
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
static bool poseEqual(const PosePtr &p1, const PosePtr &p2)
std::string getObjectTypeB() const
boost::shared_ptr< VoteSpecifier > VoteSpecifierPtr
std::vector< VoteSpecifierPtr > votesFromBForReferencePoseA
std::vector< ISM::VoteSpecifierPtr > getVotesFromAForReferencePoseB() const
bool containsObject(const std::string &type, const std::string &id)
std::string getObjectIdB() const
boost::shared_ptr< Track > TrackPtr
ObjectRelation(ISM::TrackPtr objectA, ISM::TrackPtr objectB, std::string patternName)
this namespace contains all generally usable classes.
std::string getObjectIdA() const