2010-04-28 03:49:27 +02:00
|
|
|
#ifndef TOSTRING_H
|
|
|
|
#define TOSTRING_H
|
|
|
|
#include <QString>
|
|
|
|
#include <cstdlib>
|
|
|
|
|
2010-09-02 00:01:03 +02:00
|
|
|
inline QString toString( const vcg::Point4f& p ){
|
2010-04-28 03:49:27 +02:00
|
|
|
QString s;
|
|
|
|
s.sprintf("%f %f %f %f", p[0], p[1], p[2], p[3]);
|
|
|
|
return s;
|
|
|
|
}
|
2010-09-02 00:01:03 +02:00
|
|
|
inline QString toString( const vcg::Point3f& p ){
|
2010-04-28 03:49:27 +02:00
|
|
|
QString s;
|
|
|
|
s.sprintf("%f %f %f", p[0], p[1], p[2]);
|
|
|
|
return s;
|
|
|
|
}
|
2010-09-02 00:01:03 +02:00
|
|
|
inline QString toString( const vcg::Point2f& p ){
|
2010-04-28 03:49:27 +02:00
|
|
|
QString s;
|
|
|
|
s.sprintf("%f %f", p[0], p[1]);
|
|
|
|
return s;
|
|
|
|
}
|
2010-09-02 00:01:03 +02:00
|
|
|
inline QString toString( const vcg::Point2i& p ){
|
2010-04-28 03:49:27 +02:00
|
|
|
QString s;
|
|
|
|
s.sprintf("%d %d", p[0], p[1]);
|
|
|
|
return s;
|
|
|
|
}
|
2010-09-02 00:01:03 +02:00
|
|
|
inline QString toString(vcg::Matrix44f& m){
|
2010-04-28 03:49:27 +02:00
|
|
|
QString mat;
|
|
|
|
for(int i=0; i<3; i++){
|
|
|
|
mat.append( toString( m.GetRow4(i) ) );
|
|
|
|
mat.append("\n");
|
|
|
|
}
|
|
|
|
return mat;
|
|
|
|
}
|
|
|
|
#endif // TOSTRING_H
|