5 #include <KrisLibrary/utils/AnyCollection.h> 11 void Convert(
const T& x,AnyCollection& c) { c = x; }
14 bool Convert(
const AnyCollection& c,T& x) {
return c.as<T>(x); }
18 void Convert(
const std::vector<T>& v,AnyCollection& c)
21 for(
size_t i=0;i<v.size();i++)
27 bool Convert(
const AnyCollection& c,std::vector<T>& v)
30 for(
size_t i=0;i<v.size();i++)
31 if(!
Convert(c[(
int)i],v[i]))
return false;
35 template <>
void Convert(
const Vector3& x,AnyCollection& c);
36 template <>
void Convert(
const Vector& x,AnyCollection& c);
37 template <>
void Convert(
const IKGoal& g,AnyCollection& c);
38 template <>
void Convert(
const Hold& h,AnyCollection& c);
39 template <>
void Convert(
const Grasp& g,AnyCollection& c);
40 template <>
void Convert(
const Stance& s,AnyCollection& c);
41 template <>
bool Convert(
const AnyCollection& c,Vector3& x);
42 template <>
bool Convert(
const AnyCollection& c,Vector& x);
43 template <>
bool Convert(
const AnyCollection& c,IKGoal& g);
44 template <>
bool Convert(
const AnyCollection& c,Hold& h);
45 template <>
bool Convert(
const AnyCollection& c,Grasp& g);
46 template <>
bool Convert(
const AnyCollection& c,Stance& s);
49 void SaveJSON(std::ostream& out,
const T& x) {
57 bool LoadJSON(std::istream& in,
const T& x) {
void Convert(const LinearPath &in, MultiPath &out)
Exact, direct conversion from LinearPath to MultiPath.
Defines all Klampt Resource types, and packing / unpacking utilities.
Definition: ContactDistance.h:6