parent
342f182ee0
commit
c9fbf25362
|
@ -97,7 +97,7 @@ static bool PackAsEqualSquares(const std::vector< std::vector<Point2x> > &polyV
|
|||
trVec.resize(polyVec.size());
|
||||
Box2f bbMax;
|
||||
std::vector<Box2x> bbVec;
|
||||
for(int i=0;i<polyVec.size();++i)
|
||||
for(size_t i=0;i<polyVec.size();++i)
|
||||
{
|
||||
bbVec.push_back(getPolyBB(polyVec[i]));
|
||||
bbMax.Add(bbVec.back());
|
||||
|
@ -131,7 +131,7 @@ static bool PackAsAxisAlignedRect(const std::vector< std::vector<Point2x> > &pol
|
|||
trVec.clear();
|
||||
trVec.resize(polyVec.size());
|
||||
std::vector<Box2x> bbVec;
|
||||
for(int i=0;i<polyVec.size();++i)
|
||||
for(size_t i=0;i<polyVec.size();++i)
|
||||
{
|
||||
assert(polyVec[i].size()>0);
|
||||
bbVec.push_back(getPolyBB(polyVec[i]));
|
||||
|
@ -148,7 +148,7 @@ static bool PackAsObjectOrientedRect(const std::vector< std::vector<Point2x> > &
|
|||
trVec.resize(polyVec.size());
|
||||
std::vector<Box2x> bbVec;
|
||||
std::vector<float> rotVec;
|
||||
for(int i=0;i<polyVec.size();++i)
|
||||
for(size_t i=0;i<polyVec.size();++i)
|
||||
{
|
||||
float rot;
|
||||
bbVec.push_back(getPolyOOBB(polyVec[i],rot));
|
||||
|
@ -157,7 +157,7 @@ static bool PackAsObjectOrientedRect(const std::vector< std::vector<Point2x> > &
|
|||
|
||||
bool ret= RectPacker<float>::Pack(bbVec,containerSizeX,trVec,coveredContainer);
|
||||
|
||||
for(int i=0;i<polyVec.size();++i)
|
||||
for(size_t i=0;i<polyVec.size();++i)
|
||||
{
|
||||
trVec[i].rotRad=rotVec[i];
|
||||
}
|
||||
|
|
|
@ -88,14 +88,14 @@ static bool PackOccupancy(const std::vector<Box2x > & rectVec, /// the set of
|
|||
|
||||
Point2x scaleFactor2(containerSize[0]/maxSize[0],containerSize[1]/maxSize[1]);
|
||||
|
||||
SCALAR_TYPE unitScaleFactor = std::min(scaleFactor2[0],scaleFactor2[1]);
|
||||
// SCALAR_TYPE unitScaleFactor = std::min(scaleFactor2[0],scaleFactor2[1]);
|
||||
|
||||
SCALAR_TYPE scaleFactor = (sqrt(areaContainer)/sqrt(areaSum))*sqrt(occupancyRatio);
|
||||
|
||||
printf("unitScaleFactor %6.3f\n",unitScaleFactor);
|
||||
printf("scaleFactor %6.3f\n",scaleFactor);
|
||||
printf("areaContainer %6.3f\n",areaContainer);
|
||||
printf("areaSum %6.3f\n",areaSum);
|
||||
// printf("unitScaleFactor %6.3f\n",unitScaleFactor);
|
||||
// printf("scaleFactor %6.3f\n",scaleFactor);
|
||||
// printf("areaContainer %6.3f\n",areaContainer);
|
||||
// printf("areaSum %6.3f\n",areaSum);
|
||||
std::vector<vcg::Point2i> sizes(rectVec.size());
|
||||
for (size_t i=0;i<rectVec.size();++i)
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ static bool PackOccupancy(const std::vector<Box2x > & rectVec, /// the set of
|
|||
// rectVec[i].min[0],rectVec[i].min[1], rectVec[i].max[0],rectVec[i].max[1],
|
||||
// sizes[i][0],sizes[i][1], posiz[i][0],posiz[i][1]);
|
||||
}
|
||||
printf("globalSize (%6i %6i)\n",global_size[0],global_size[1]);
|
||||
// printf("globalSize (%6i %6i)\n",global_size[0],global_size[1]);
|
||||
coveredContainer = Point2x::Construct(global_size);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue