refactoring
This commit is contained in:
parent
74d417ac13
commit
6cd9d7aa91
|
|
@ -33,7 +33,7 @@ struct RotoTranslation
|
||||||
{
|
{
|
||||||
RotoTranslation(){}
|
RotoTranslation(){}
|
||||||
Scalar _v[6];
|
Scalar _v[6];
|
||||||
void ToMatrix(vcg::Matrix44<Scalar> & m)
|
void toMatrix(vcg::Matrix44<Scalar> & m)
|
||||||
{
|
{
|
||||||
vcg::Matrix44<Scalar> rot,tra;
|
vcg::Matrix44<Scalar> rot,tra;
|
||||||
rot.FromEulerAngles(_v[0],_v[1],_v[2]);
|
rot.FromEulerAngles(_v[0],_v[1],_v[2]);
|
||||||
|
|
@ -52,7 +52,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Compute a scaling transformation that bring PMov point as close as possible to Pfix
|
* Compute a scaling transformation that bring PMov point as close as possible to Pfix
|
||||||
*/
|
*/
|
||||||
static void ComputeScalingMatchMatrix(
|
static void computeScalingMatchMatrix(
|
||||||
vcg::Matrix44d &res,
|
vcg::Matrix44d &res,
|
||||||
std::vector<vcg::Point3d> &Pfix,
|
std::vector<vcg::Point3d> &Pfix,
|
||||||
std::vector<vcg::Point3d> &Pmov)
|
std::vector<vcg::Point3d> &Pmov)
|
||||||
|
|
@ -73,7 +73,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Compute a rototranslation + scaling transformation that bring PMov point as close as possible to Pfix
|
* Compute a rototranslation + scaling transformation that bring PMov point as close as possible to Pfix
|
||||||
*/
|
*/
|
||||||
static void ComputeRotoTranslationScalingMatchMatrix(
|
static void computeRotoTranslationScalingMatchMatrix(
|
||||||
vcg::Matrix44d &res,
|
vcg::Matrix44d &res,
|
||||||
std::vector<vcg::Point3d> &Pfix,
|
std::vector<vcg::Point3d> &Pfix,
|
||||||
std::vector<vcg::Point3d> &Pmov)
|
std::vector<vcg::Point3d> &Pmov)
|
||||||
|
|
@ -91,7 +91,7 @@ public:
|
||||||
RotoTranslation<double> rt;
|
RotoTranslation<double> rt;
|
||||||
vcg::Matrix44d rtm;
|
vcg::Matrix44d rtm;
|
||||||
memcpy(&rt._v[0],&x[1],6*sizeof(double));
|
memcpy(&rt._v[0],&x[1],6*sizeof(double));
|
||||||
rt.ToMatrix(rtm);
|
rt.toMatrix(rtm);
|
||||||
|
|
||||||
// res= scaling w.r.t. barycenter
|
// res= scaling w.r.t. barycenter
|
||||||
res.SetTranslate( b.Center()*(1.0-x[0]));
|
res.SetTranslate( b.Center()*(1.0-x[0]));
|
||||||
|
|
@ -120,7 +120,7 @@ public:
|
||||||
RotoTranslation<double> rt;
|
RotoTranslation<double> rt;
|
||||||
vcg::Matrix44d m;
|
vcg::Matrix44d m;
|
||||||
memcpy(&rt._v[0],&x[1],6*sizeof(double));
|
memcpy(&rt._v[0],&x[1],6*sizeof(double));
|
||||||
rt.ToMatrix(m);
|
rt.toMatrix(m);
|
||||||
|
|
||||||
for(; i != mov->end(); ++i,++ifix) {
|
for(; i != mov->end(); ++i,++ifix) {
|
||||||
dist += vcg::SquaredDistance( m*(((*i)-b.Center())*(x[0])+b.Center()),*ifix);
|
dist += vcg::SquaredDistance( m*(((*i)-b.Center())*(x[0])+b.Center()),*ifix);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue