ObjectSet.cpp
Go to the documentation of this file.
1 
18 #include "ObjectSet.hpp"
20 
21 namespace ISM {
22 bool sortObjectPtrAscAlpha(const ObjectPtr& lhs, const ObjectPtr& rhs)
23  {
24  std::stringstream ssl;
25  std::stringstream ssr;
26  ssl << lhs;
27  ssr << rhs;
28  return ssl.str() < ssr.str();
29 }
30  std::ostream& operator<<(std::ostream &strm, const ISM::ObjectSet &o) {
31  strm<<"object set: ["<<std::endl;
32  std::vector<ISM::ObjectPtr> os = o.objects;
33  std::sort(os.begin(), os.end(), sortObjectPtrAscAlpha);
34  for (ObjectPtr& object : os) {
35  strm<<object<<std::endl;
36  };
37  return strm<<"]";
38  }
39 
40  std::ostream& operator<<(std::ostream &strm, const ISM::ObjectSetPtr &o) {
41  return strm<<(*o);
42  }
43 
45  if(!o)
46  {
47  std::cerr << "ObjectSet::insert not valid pointer" << std::endl;
48  throw std::runtime_error("ObjectSet::insert not valid pointer");
49  }
50  o->pose->quat = GeometryHelper::normalize(o->pose->quat);
51  objects.push_back(o);
52  }
53 }
void insert(ObjectPtr o)
Definition: ObjectSet.cpp:44
bool sortObjectPtrAscAlpha(const ObjectPtr &lhs, const ObjectPtr &rhs)
Definition: ObjectSet.cpp:22
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
boost::shared_ptr< ObjectSet > ObjectSetPtr
Definition: ObjectSet.hpp:53
std::vector< ObjectPtr > objects
Definition: ObjectSet.hpp:49
this namespace contains all generally usable classes.
boost::shared_ptr< Object > ObjectPtr
Definition: Object.hpp:82
static QuaternionPtr normalize(const QuaternionPtr &quat)


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40