41 #define M_PI 3.14159265358979323846 45 #define M_PI_2 1.57079632679489661923 49 #define M_SQRT2 1.41421356237309504880 52 void pal::Util::sort(
void** items,
int N,
bool ( *greater )(
void *l,
void *r ) )
58 unsigned int n =
static_cast< unsigned int >( N ), i = n / 2, parent, child;
80 if ( child + 1 < n && greater( items[child + 1], items[child] ) )
84 if ( greater( items[child], t ) )
86 items[parent] = items[child];
88 child = parent * 2 + 1;
104 const GEOSGeometry *geom;
106 queue->
append( the_geom );
115 int type = GEOSGeomTypeId_r( geosctxt, geom );
118 case GEOS_MULTIPOINT:
119 case GEOS_MULTILINESTRING:
120 case GEOS_MULTIPOLYGON:
121 nGeom = GEOSGetNumGeometries_r( geosctxt, geom );
122 for ( i = 0; i < nGeom; i++ )
124 queue->
append( GEOSGetGeometryN_r( geosctxt, geom, i ) );
128 case GEOS_LINESTRING:
130 final_queue->
append( geom );
static QLinkedList< const GEOSGeometry * > * unmulti(const GEOSGeometry *the_geom)
static void sort(void **items, int N, bool(*greater)(void *l, void *r))
Sort an array of pointers.
GEOSContextHandle_t geosContext()
Get GEOS context handle to be used in all GEOS library calls with reentrant API.
void append(const T &value)