44 #include "linkedlist.hpp"
126 PointSet(
int nbPoints,
double *x,
double *y );
129 PointSet* extractShape(
int nbPtSh,
int imin,
int imax,
int fps,
int fpe,
double fptx,
double fpty );
131 PointSet* createProblemSpecificPointSet(
double bbmin[2],
double bbmax[2],
bool *inside );
140 static void splitPolygons( LinkedList<PointSet*> *shapes_toProcess,
141 LinkedList<PointSet*> *shapes_final,
142 double xrm,
double yrm,
char *uid );
157 double getDist(
double px,
double py,
double *rx,
double *ry );
163 void getCentroid(
double &px,
double &py,
bool forceInside =
false );
168 void getBoundingBox(
double min[2],
double max[2] )
const
170 min[0] = xmin; min[1] = ymin;
171 max[0] = xmax; max[1] = ymax;
190 inline void getPoint(
double *d,
double *ad,
double dl,
191 double *px,
double *py )
200 while ( i < nbPoints && ad[i] <= dl ) i++;
204 if ( i < nbPoints - 1 )
208 dx = x[nbPoints-1] - x[0];
209 dy = y[nbPoints-1] - y[0];
210 di = sqrt( dx * dx + dy * dy );
220 *px = x[i] + dx * distr / di;
221 *py = y[i] + dy * distr / di;