From 6bf2eda3b647a0eaeae716ba84df974e21cc4b4d Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Thu, 9 Feb 2012 13:58:22 +0000 Subject: [PATCH] --- apps/sample/space_packer/space_packer.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/sample/space_packer/space_packer.cpp b/apps/sample/space_packer/space_packer.cpp index 876a58c0..8f0bb8a6 100644 --- a/apps/sample/space_packer/space_packer.cpp +++ b/apps/sample/space_packer/space_packer.cpp @@ -32,7 +32,7 @@ using namespace vcg; using namespace std; -void buildRandRectSet(int rectNum, vector &rectVec) +static void buildRandRectSet(int rectNum, vector &rectVec) { math::MarsenneTwisterRNG rnd; float exp=3.0f; @@ -96,8 +96,9 @@ void buildRandPolySet(int polyNum, vector< vector > &polyVec) } } -int main( int /*argc*/, char **/*argv*/ ) +int main( int argc, char **argv ) { + QApplication pippo(argc,argv); vector rectVec; buildRandRectSet(1000, rectVec); @@ -106,12 +107,22 @@ int main( int /*argc*/, char **/*argv*/ ) Point2f finalSize; buildRandPolySet(100,polySet); PolyDumperParam pp; - PolyPacker::PackAsEqualSquares(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); + /* PolyPacker::PackAsEqualSquares(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); dumpPolySet("testpolyEq.png",polySet,trVec,pp); PolyPacker::PackAsAxisAlignedRect(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); dumpPolySet("testpolyAA.png",polySet,trVec,pp); PolyPacker::PackAsObjectOrientedRect(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); - dumpPolySet("testpolyOO.png",polySet,trVec,pp); + dumpPolySet("testpolyOO.png",polySet,trVec,pp);*/ + + //PolyPacker::PackAsAxisAlignedRect(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); + PolyPacker::PackAsObjectOrientedRect(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); + //dumpPolySetPNG("testpolyEq.png",polySet,trVec,pp); + PolyDumper::dumpPolySetSVG("testpolyEq.svg",polySet,trVec,pp); + + /*PolyPacker::PackAsAxisAlignedRect(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); + dumpPolySetSVG("testpolyAA.svg",polySet,trVec,pp); + PolyPacker::PackAsObjectOrientedRect(polySet,Point2f(1024.0f,1024.0f),trVec,finalSize); + dumpPolySetSVG("testpolyOO.svg",polySet,trVec,pp);*/ return 0; }