30 #ifndef PAL_GEOM_FUNCTION
31 #define PAL_GEOM_FUNCTION
36 #include "qgis_core.h"
62 static inline double cross_product(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3 )
64 return ( x2 - x1 ) * ( y3 - y1 ) - ( x3 - x1 ) * ( y2 - y1 );
67 static inline double dist_euc2d(
double x1,
double y1,
double x2,
double y2 )
69 return std::sqrt( ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) );
72 static inline double dist_euc2d_sq(
double x1,
double y1,
double x2,
double y2 )
74 return ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 );
77 static void findLineCircleIntersection(
double cx,
double cy,
double radius,
78 double x1,
double y1,
double x2,
double y2,
79 double &xRes,
double &yRes );
90 static int convexHullId(
int *
id,
const std::vector< double > &x,
const std::vector< double > &y,
int n,
int *&cHull );
95 static bool isSegIntersects(
double x1,
double y1,
double x2,
double y2,
96 double x3,
double y3,
double x4,
double y4 );
102 static bool computeLineIntersection(
double x1,
double y1,
double x2,
double y2,
103 double x3,
double y3,
double x4,
double y4,
104 double *x,
double *y );
107 static int reorderPolygon(
int nbPoints, std::vector< double > &x, std::vector< double> &y );
119 static bool containsCandidate(
const GEOSPreparedGeometry *geom,
double x,
double y,
double width,
double height,
double alpha );
Pal labeling engine geometry functions.
static double dist_euc2d(double x1, double y1, double x2, double y2)
static double cross_product(double x1, double y1, double x2, double y2, double x3, double y3)
static double dist_euc2d_sq(double x1, double y1, double x2, double y2)