Commit ccaa02c3 authored by Sandro Santilli's avatar Sandro Santilli

Add some const qualifiers for 3d distance functions

git-svn-id: http://svn.osgeo.org/postgis/[email protected] b70326c6-7e19-0410-871a-916f4a2858ee
parent 08599fa1
...@@ -1159,14 +1159,14 @@ extern double distance3d_pt_pt(const POINT3D *p1, const POINT3D *p2); ...@@ -1159,14 +1159,14 @@ extern double distance3d_pt_pt(const POINT3D *p1, const POINT3D *p2);
extern double distance3d_pt_seg(const POINT3D *p, const POINT3D *A, const POINT3D *B); extern double distance3d_pt_seg(const POINT3D *p, const POINT3D *A, const POINT3D *B);
extern LWGEOM* lwgeom_furthest_line_3d(LWGEOM *lw1, LWGEOM *lw2); extern LWGEOM* lwgeom_furthest_line_3d(LWGEOM *lw1, LWGEOM *lw2);
extern LWGEOM* lwgeom_closest_line_3d(LWGEOM *lw1, LWGEOM *lw2); extern LWGEOM* lwgeom_closest_line_3d(const LWGEOM *lw1, const LWGEOM *lw2);
extern LWGEOM* lwgeom_closest_point_3d(LWGEOM *lw1, LWGEOM *lw2); extern LWGEOM* lwgeom_closest_point_3d(const LWGEOM *lw1, const LWGEOM *lw2);
extern double lwgeom_mindistance3d(LWGEOM *lw1, LWGEOM *lw2); extern double lwgeom_mindistance3d(const LWGEOM *lw1, const LWGEOM *lw2);
extern double lwgeom_mindistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance); extern double lwgeom_mindistance3d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance);
extern double lwgeom_maxdistance3d(LWGEOM *lw1, LWGEOM *lw2); extern double lwgeom_maxdistance3d(const LWGEOM *lw1, const LWGEOM *lw2);
extern double lwgeom_maxdistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance); extern double lwgeom_maxdistance3d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance);
extern double lwgeom_area(const LWGEOM *geom); extern double lwgeom_area(const LWGEOM *geom);
......
...@@ -39,7 +39,7 @@ get_3dcross_product(VECTOR3D *v1,VECTOR3D *v2, VECTOR3D *v) ...@@ -39,7 +39,7 @@ get_3dcross_product(VECTOR3D *v1,VECTOR3D *v2, VECTOR3D *v)
LWGEOM * LWGEOM *
lwgeom_closest_line_3d(LWGEOM *lw1, LWGEOM *lw2) lwgeom_closest_line_3d(const LWGEOM *lw1, const LWGEOM *lw2)
{ {
return lw_dist3d_distanceline(lw1, lw2, lw1->srid, DIST_MIN); return lw_dist3d_distanceline(lw1, lw2, lw1->srid, DIST_MIN);
} }
...@@ -51,7 +51,7 @@ lwgeom_furthest_line_3d(LWGEOM *lw1, LWGEOM *lw2) ...@@ -51,7 +51,7 @@ lwgeom_furthest_line_3d(LWGEOM *lw1, LWGEOM *lw2)
} }
LWGEOM * LWGEOM *
lwgeom_closest_point_3d(LWGEOM *lw1, LWGEOM *lw2) lwgeom_closest_point_3d(const LWGEOM *lw1, const LWGEOM *lw2)
{ {
return lw_dist3d_distancepoint(lw1, lw2, lw1->srid, DIST_MIN); return lw_dist3d_distancepoint(lw1, lw2, lw1->srid, DIST_MIN);
} }
...@@ -61,7 +61,7 @@ lwgeom_closest_point_3d(LWGEOM *lw1, LWGEOM *lw2) ...@@ -61,7 +61,7 @@ lwgeom_closest_point_3d(LWGEOM *lw1, LWGEOM *lw2)
Function initializing 3dshortestline and 3dlongestline calculations. Function initializing 3dshortestline and 3dlongestline calculations.
*/ */
LWGEOM * LWGEOM *
lw_dist3d_distanceline(LWGEOM *lw1, LWGEOM *lw2, int srid, int mode) lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
{ {
double x1,x2,y1,y2, z1, z2; double x1,x2,y1,y2, z1, z2;
double initdistance = ( mode == DIST_MIN ? FLT_MAX : -1.0); double initdistance = ( mode == DIST_MIN ? FLT_MAX : -1.0);
...@@ -110,7 +110,7 @@ lw_dist3d_distanceline(LWGEOM *lw1, LWGEOM *lw2, int srid, int mode) ...@@ -110,7 +110,7 @@ lw_dist3d_distanceline(LWGEOM *lw1, LWGEOM *lw2, int srid, int mode)
Function initializing 3dclosestpoint calculations. Function initializing 3dclosestpoint calculations.
*/ */
LWGEOM * LWGEOM *
lw_dist3d_distancepoint(LWGEOM *lw1, LWGEOM *lw2, int srid, int mode) lw_dist3d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
{ {
double x,y,z; double x,y,z;
DISTPTS3D thedl; DISTPTS3D thedl;
...@@ -151,7 +151,7 @@ lw_dist3d_distancepoint(LWGEOM *lw1, LWGEOM *lw2, int srid, int mode) ...@@ -151,7 +151,7 @@ lw_dist3d_distancepoint(LWGEOM *lw1, LWGEOM *lw2, int srid, int mode)
Function initializing 3d max distance calculation Function initializing 3d max distance calculation
*/ */
double double
lwgeom_maxdistance3d(LWGEOM *lw1, LWGEOM *lw2) lwgeom_maxdistance3d(const LWGEOM *lw1, const LWGEOM *lw2)
{ {
LWDEBUG(2, "lwgeom_maxdistance3d is called"); LWDEBUG(2, "lwgeom_maxdistance3d is called");
...@@ -163,7 +163,7 @@ Function handling 3d max distance calculations and dfullywithin calculations. ...@@ -163,7 +163,7 @@ Function handling 3d max distance calculations and dfullywithin calculations.
The difference is just the tolerance. The difference is just the tolerance.
*/ */
double double
lwgeom_maxdistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance) lwgeom_maxdistance3d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
{ {
/*double thedist;*/ /*double thedist;*/
DISTPTS3D thedl; DISTPTS3D thedl;
...@@ -184,7 +184,7 @@ lwgeom_maxdistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance) ...@@ -184,7 +184,7 @@ lwgeom_maxdistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance)
Function initializing 3d min distance calculation Function initializing 3d min distance calculation
*/ */
double double
lwgeom_mindistance3d(LWGEOM *lw1, LWGEOM *lw2) lwgeom_mindistance3d(const LWGEOM *lw1, const LWGEOM *lw2)
{ {
LWDEBUG(2, "lwgeom_mindistance3d is called"); LWDEBUG(2, "lwgeom_mindistance3d is called");
return lwgeom_mindistance3d_tolerance( lw1, lw2, 0.0 ); return lwgeom_mindistance3d_tolerance( lw1, lw2, 0.0 );
...@@ -195,7 +195,7 @@ lwgeom_mindistance3d(LWGEOM *lw1, LWGEOM *lw2) ...@@ -195,7 +195,7 @@ lwgeom_mindistance3d(LWGEOM *lw1, LWGEOM *lw2)
The difference is just the tolerance. The difference is just the tolerance.
*/ */
double double
lwgeom_mindistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance) lwgeom_mindistance3d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
{ {
DISTPTS3D thedl; DISTPTS3D thedl;
LWDEBUG(2, "lwgeom_mindistance3d_tolerance is called"); LWDEBUG(2, "lwgeom_mindistance3d_tolerance is called");
...@@ -306,7 +306,7 @@ int lw_dist3d_recursive(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS3D *dl) ...@@ -306,7 +306,7 @@ int lw_dist3d_recursive(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS3D *dl)
This function distributes the brute-force for 3D so far the only type, tasks depending on type This function distributes the brute-force for 3D so far the only type, tasks depending on type
*/ */
int int
lw_dist3d_distribute_bruteforce(LWGEOM *lwg1, LWGEOM *lwg2, DISTPTS3D *dl) lw_dist3d_distribute_bruteforce(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS3D *dl)
{ {
int t1 = lwg1->type; int t1 = lwg1->type;
......
...@@ -49,15 +49,15 @@ PLANE3D; ...@@ -49,15 +49,15 @@ PLANE3D;
/* /*
Geometry returning functions Geometry returning functions
*/ */
LWGEOM * lw_dist3d_distancepoint(LWGEOM *lw1, LWGEOM *lw2,int srid,int mode); LWGEOM * lw_dist3d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2,int srid,int mode);
LWGEOM * lw_dist3d_distanceline(LWGEOM *lw1, LWGEOM *lw2,int srid,int mode); LWGEOM * lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2,int srid,int mode);
/* /*
Preprocessing functions Preprocessing functions
*/ */
int lw_dist3d_distribute_bruteforce(LWGEOM *lwg1, LWGEOM *lwg2, DISTPTS3D *dl); int lw_dist3d_distribute_bruteforce(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS3D *dl);
int lw_dist3d_recursive(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS3D *dl); int lw_dist3d_recursive(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS3D *dl);
int lw_dist3d_distribute_fast(LWGEOM *lwg1, LWGEOM *lwg2, DISTPTS3D *dl); int lw_dist3d_distribute_fast(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS3D *dl);
/* /*
Brute force functions Brute force functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment