1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
13 **********************************************************************
14 **********************************************************************/
17 //#define _CRTDBG_MAP_ALLOC
24 #include <geos/geom/GeometryFactory.h>
25 #include <geos/geom/Polygon.h>
28 using namespace geos::geom
;
31 * Run relate between two large geometries to test the performance
32 * of the sweepline intersection detection algorithm
35 void run(int nPts
, GeometryFactory
*fact
) {
36 clock_t startTime
, endTime
;
40 Polygon
*poly
=GeometryTestFactory::createSineStar(fact
,0.0,0.0,size
,armLen
,nArms
,nPts
);
41 Polygon
*box
=GeometryTestFactory::createSineStar(fact
,0.0,size
/2,size
,armLen
,nArms
,nPts
);
42 //Polygon *box=GeometryTestFactory::createBox(fact,0,0,1,100.0);
45 poly
->intersects(box
);
47 double totalTime
=(double)(endTime
-startTime
);
48 printf( "n Pts: %i Executed in %6.0f ms.\n",nPts
,totalTime
);
49 //cout << "n Pts: " << nPts << " Executed in " << totalTime << endl;
51 // FIXME - mloskot: Why generated test geometries are not destroyed?"
54 int main(int /* argc */, char** /* argv[] */) {
56 GeometryFactory::unique_ptr factptr
= GeometryFactory::create();
57 GeometryFactory
* fact
= factptr
.get();
71 // _CrtDumpMemoryLeaks();
73 cout
<< "Done" << endl
;