PackInt function made public

In order to make the new Ponchio's nexus work properly
This commit is contained in:
Matteo Dellepiane 2016-11-29 11:37:19 +01:00
parent 77b144b796
commit e977c746bd
1 changed files with 142 additions and 142 deletions

View File

@ -240,26 +240,6 @@ static bool PackOccupancyMulti(const std::vector<Box2x > & rectVec, /// the se
return true;
}
private:
class ComparisonFunctor
{
public:
const std::vector<vcg::Point2i> & v;
inline ComparisonFunctor( const std::vector<vcg::Point2i> & nv ) : v(nv) { }
inline bool operator() ( int a, int b )
{
const Point2i &va=v[a];
const Point2i &vb=v[b];
return (va[1]!=vb[1])?(va[1]>vb[1]):
(va[0]>vb[0]);
}
};
/* This is the low level function that packs a set of int rects onto a grid.
Based on the criptic code written by Claudio Rocchini
@ -402,6 +382,26 @@ static bool PackInt(const std::vector<vcg::Point2i> & sizes, // the sizes of the
return true;
}
private:
class ComparisonFunctor
{
public:
const std::vector<vcg::Point2i> & v;
inline ComparisonFunctor( const std::vector<vcg::Point2i> & nv ) : v(nv) { }
inline bool operator() ( int a, int b )
{
const Point2i &va=v[a];
const Point2i &vb=v[b];
return (va[1]!=vb[1])?(va[1]>vb[1]):
(va[0]>vb[0]);
}
};
// Versione multitexture
static bool PackIntMulti( const std::vector<Point2i> & sizes,
const int ntexture,