Main Page
Namespaces
Classes
Files
File List
File Members
libism
ISM
common_type
ObjectSet.cpp
Go to the documentation of this file.
1
18
#include "
ObjectSet.hpp
"
19
#include "
utility/GeometryHelper.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
44
void
ObjectSet::insert
(
ObjectPtr
o) {
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
}
GeometryHelper.hpp
ISM::ObjectSet::insert
void insert(ObjectPtr o)
Definition:
ObjectSet.cpp:44
ISM::sortObjectPtrAscAlpha
bool sortObjectPtrAscAlpha(const ObjectPtr &lhs, const ObjectPtr &rhs)
Definition:
ObjectSet.cpp:22
ISM::operator<<
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
Definition:
ObjectRelation.cpp:167
ISM::ObjectSetPtr
boost::shared_ptr< ObjectSet > ObjectSetPtr
Definition:
ObjectSet.hpp:53
ISM::ObjectSet
Definition:
ObjectSet.hpp:31
ISM::ObjectSet::objects
std::vector< ObjectPtr > objects
Definition:
ObjectSet.hpp:49
ISM
this namespace contains all generally usable classes.
Definition:
AcceptanceFunction.hpp:22
ObjectSet.hpp
ISM::ObjectPtr
boost::shared_ptr< Object > ObjectPtr
Definition:
Object.hpp:82
ISM::GeometryHelper::normalize
static QuaternionPtr normalize(const QuaternionPtr &quat)
Definition:
GeometryHelper.hpp:210
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