diff --git a/vcg/space/poly_packer.h b/vcg/space/poly_packer.h index a98c6942..db7c160f 100644 --- a/vcg/space/poly_packer.h +++ b/vcg/space/poly_packer.h @@ -22,6 +22,7 @@ ****************************************************************************/ #ifndef __VCG_POLY_PACKER_H__ #define __VCG_POLY_PACKER_H__ + #include #include #include @@ -32,6 +33,8 @@ #include #include + + namespace vcg { @@ -57,7 +60,7 @@ public: { const int stepNum=16; float bestAngle; - float bestArea = std::numeric_limits::max(); + float bestArea = std::numeric_limits::max(); Box2f bestBB; for(int i=0;i > &polyV std::vector &trVec, Point2x &coveredContainer) { - int minSide = int( std::min(containerSizeX[0],containerSizeX[1])); + int minSide = int(min(containerSizeX[0],containerSizeX[1])); const vcg::Point2i containerSize(minSide,minSide); - int polyPerLine = ceil(sqrt(polyVec.size())); + int polyPerLine = ceil(sqrt((double)polyVec.size())); int pixelPerPoly = minSide / (polyPerLine); if(pixelPerPoly < 1) return false; @@ -103,7 +106,7 @@ static bool PackAsEqualSquares(const std::vector< std::vector > &polyV bbMax.Add(bbVec.back()); } - float unitScale = 1.0/std::max(bbMax.DimX(),bbMax.DimY()); + float unitScale = 1.0/max(bbMax.DimX(),bbMax.DimY()); float polyScale = unitScale * pixelPerPoly; int baseX =0;