Anal retentive function renaming: ptarray_isclosed -> ptarray_is_closed

git-svn-id: http://svn.osgeo.org/postgis/trunk@10339 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Paul Ramsey 2012-09-28 21:08:29 +00:00
parent 2002bd670a
commit ddb17de1da
11 changed files with 42 additions and 42 deletions

View file

@ -852,10 +852,10 @@ extern int ptarray_remove_point(POINTARRAY *pa, int where);
extern POINTARRAY *ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where);
extern POINTARRAY *ptarray_removePoint(POINTARRAY *pa, uint32_t where);
extern POINTARRAY *ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2);
extern int ptarray_isclosed(const POINTARRAY *pa);
extern int ptarray_isclosed2d(const POINTARRAY *pa);
extern int ptarray_isclosed3d(const POINTARRAY *pa);
extern int ptarray_isclosedz(const POINTARRAY *pa);
extern int ptarray_is_closed(const POINTARRAY *pa);
extern int ptarray_is_closed_2d(const POINTARRAY *pa);
extern int ptarray_is_closed_3d(const POINTARRAY *pa);
extern int ptarray_is_closed_z(const POINTARRAY *pa);
extern void ptarray_longitude_shift(POINTARRAY *pa);
extern void ptarray_reverse(POINTARRAY *pa);
extern POINTARRAY* ptarray_flip_coordinates(POINTARRAY *pa);

View file

@ -255,9 +255,9 @@ int
lwcircstring_is_closed(const LWCIRCSTRING *curve)
{
if (FLAGS_GET_Z(curve->flags))
return ptarray_isclosed3d(curve->points);
return ptarray_is_closed_3d(curve->points);
return ptarray_isclosed2d(curve->points);
return ptarray_is_closed_2d(curve->points);
}
int lwcircstring_is_empty(const LWCIRCSTRING *circ)

View file

@ -189,7 +189,7 @@ ptarray_close2d(POINTARRAY* ring)
POINTARRAY* newring;
/* close the ring if not already closed (2d only) */
if ( ! ptarray_isclosed2d(ring) )
if ( ! ptarray_is_closed_2d(ring) )
{
/* close it up */
newring = ptarray_addPoint(ring,

View file

@ -485,7 +485,7 @@ static LWPOLY* lwpoly_from_wkb_state(wkb_parse_state *s)
}
/* Check that first and last points are the same. */
if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed2d(pa) )
if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed_2d(pa) )
{
LWDEBUGF(2, "%s must have closed rings", lwtype_name(s->lwtype));
lwerror("%s must have closed rings", lwtype_name(s->lwtype));
@ -540,13 +540,13 @@ static LWTRIANGLE* lwtriangle_from_wkb_state(wkb_parse_state *s)
return NULL;
}
if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed(pa) )
if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed(pa) )
{
lwerror("%s must have closed rings", lwtype_name(s->lwtype));
return NULL;
}
if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_isclosedz(pa) )
if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_is_closed_z(pa) )
{
lwerror("%s must have closed rings", lwtype_name(s->lwtype));
return NULL;

View file

@ -420,7 +420,7 @@ LWGEOM* wkt_parser_triangle_new(POINTARRAY *pa, char *dimensionality)
}
/* Triangles need closure. */
if( ! ptarray_isclosed(pa) )
if( ! ptarray_is_closed(pa) )
{
ptarray_free(pa);
SET_PARSER_ERROR(PARSER_ERROR_UNCLOSED);
@ -486,7 +486,7 @@ LWGEOM* wkt_parser_polygon_add_ring(LWGEOM *poly, POINTARRAY *pa, char dimcheck)
/* Apply check for not closed rings, if requested. */
if( (global_parser_result.parser_check_flags & LW_PARSER_CHECK_CLOSURE) &&
! (dimcheck == 'Z' ? ptarray_isclosedz(pa) : ptarray_isclosed2d(pa)) )
! (dimcheck == 'Z' ? ptarray_is_closed_z(pa) : ptarray_is_closed_2d(pa)) )
{
ptarray_free(pa);
lwgeom_free(poly);

View file

@ -428,9 +428,9 @@ int
lwline_is_closed(const LWLINE *line)
{
if (FLAGS_GET_Z(line->flags))
return ptarray_isclosed3d(line->points);
return ptarray_is_closed_3d(line->points);
return ptarray_isclosed2d(line->points);
return ptarray_is_closed_2d(line->points);
}

View file

@ -256,7 +256,7 @@ lwpoly_from_lwlines(const LWLINE *shell,
if ( shell->points->npoints < 4 )
lwerror("lwpoly_from_lwlines: shell must have at least 4 points");
if ( ! ptarray_isclosed2d(shell->points) )
if ( ! ptarray_is_closed_2d(shell->points) )
lwerror("lwpoly_from_lwlines: shell must be closed");
rings[0] = ptarray_clone_deep(shell->points);
@ -269,7 +269,7 @@ lwpoly_from_lwlines(const LWLINE *shell,
if ( hole->points->npoints < 4 )
lwerror("lwpoly_from_lwlines: holes must have at least 4 points");
if ( ! ptarray_isclosed2d(hole->points) )
if ( ! ptarray_is_closed_2d(hole->points) )
lwerror("lwpoly_from_lwlines: holes must be closed");
rings[nrings] = ptarray_clone_deep(hole->points);
@ -486,12 +486,12 @@ lwpoly_is_closed(const LWPOLY *poly)
{
if (FLAGS_GET_Z(poly->flags))
{
if ( ! ptarray_isclosed3d(poly->rings[i]) )
if ( ! ptarray_is_closed_3d(poly->rings[i]) )
return LW_FALSE;
}
else
{
if ( ! ptarray_isclosed2d(poly->rings[i]) )
if ( ! ptarray_is_closed_2d(poly->rings[i]) )
return LW_FALSE;
}
}

View file

@ -133,8 +133,8 @@ lwtriangle_from_lwline(const LWLINE *shell)
if ( shell->points->npoints != 4 )
lwerror("lwtriangle_from_lwline: shell must have exactly 4 points");
if ( (!FLAGS_GET_Z(shell->flags) && !ptarray_isclosed2d(shell->points)) ||
(FLAGS_GET_Z(shell->flags) && !ptarray_isclosed3d(shell->points)) )
if ( (!FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_2d(shell->points)) ||
(FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_3d(shell->points)) )
lwerror("lwtriangle_from_lwline: shell must be closed");
pa = ptarray_clone_deep(shell->points);

View file

@ -662,31 +662,31 @@ ptarray_clone(const POINTARRAY *in)
* pointarray.
*/
int
ptarray_isclosed(const POINTARRAY *in)
ptarray_is_closed(const POINTARRAY *in)
{
return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), ptarray_point_size(in));
}
int
ptarray_isclosed2d(const POINTARRAY *in)
ptarray_is_closed_2d(const POINTARRAY *in)
{
return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT2D));
}
int
ptarray_isclosed3d(const POINTARRAY *in)
ptarray_is_closed_3d(const POINTARRAY *in)
{
return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT3D));
}
int
ptarray_isclosedz(const POINTARRAY *in)
ptarray_is_closed_z(const POINTARRAY *in)
{
if ( FLAGS_GET_Z(in->flags) )
return ptarray_isclosed3d(in);
return ptarray_is_closed_3d(in);
else
return ptarray_isclosed2d(in);
return ptarray_is_closed_2d(in);
}

View file

@ -1107,8 +1107,8 @@ static LWGEOM* parse_gml_linearring(xmlNodePtr xnode, bool *hasz, int *root_srid
ppa[0] = parse_gml_data(xnode->children, hasz, root_srid);
if (ppa[0]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[0]))
|| (*hasz && !ptarray_isclosed3d(ppa[0])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[0]))
|| (*hasz && !ptarray_is_closed_3d(ppa[0])))
gml_lwerror("invalid GML representation", 42);
if (srs.reverse_axis)
@ -1160,8 +1160,8 @@ static LWGEOM* parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid)
ppa[0] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[0]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[0]))
|| (*hasz && !ptarray_isclosed3d(ppa[0])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[0]))
|| (*hasz && !ptarray_is_closed_3d(ppa[0])))
gml_lwerror("invalid GML representation", 43);
if (srs.reverse_axis) ppa[0] = ptarray_flip_coordinates(ppa[0]);
@ -1192,8 +1192,8 @@ static LWGEOM* parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid)
ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[ring]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[ring]))
|| (*hasz && !ptarray_isclosed3d(ppa[ring])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
|| (*hasz && !ptarray_is_closed_3d(ppa[ring])))
gml_lwerror("invalid GML representation", 43);
if (srs.reverse_axis) ppa[ring] = ptarray_flip_coordinates(ppa[ring]);
@ -1262,8 +1262,8 @@ static LWGEOM* parse_gml_triangle(xmlNodePtr xnode, bool *hasz, int *root_srid)
pa = parse_gml_data(xb->children, hasz, root_srid);
if (pa->npoints != 4
|| (!*hasz && !ptarray_isclosed2d(pa))
|| (*hasz && !ptarray_isclosed3d(pa)))
|| (!*hasz && !ptarray_is_closed_2d(pa))
|| (*hasz && !ptarray_is_closed_3d(pa)))
gml_lwerror("invalid GML representation", 46);
if (srs.reverse_axis) pa = ptarray_flip_coordinates(pa);
@ -1326,8 +1326,8 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
ppa[0] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[0]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[0]))
|| (*hasz && !ptarray_isclosed3d(ppa[0])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[0]))
|| (*hasz && !ptarray_is_closed_3d(ppa[0])))
gml_lwerror("invalid GML representation", 48);
if (srs.reverse_axis)
@ -1353,8 +1353,8 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[ring]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[ring]))
|| ( *hasz && !ptarray_isclosed3d(ppa[ring])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
|| ( *hasz && !ptarray_is_closed_3d(ppa[ring])))
gml_lwerror("invalid GML representation", 49);
if (srs.reverse_axis)

View file

@ -397,8 +397,8 @@ static LWGEOM* parse_kml_polygon(xmlNodePtr xnode, bool *hasz)
ppa[0] = parse_kml_coordinates(xb->children, hasz);
if (ppa[0]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[0]))
|| (*hasz && !ptarray_isclosed3d(ppa[0])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[0]))
|| (*hasz && !ptarray_is_closed_3d(ppa[0])))
lwerror("invalid KML representation");
}
}
@ -423,8 +423,8 @@ static LWGEOM* parse_kml_polygon(xmlNodePtr xnode, bool *hasz)
ppa[ring] = parse_kml_coordinates(xb->children, hasz);
if (ppa[ring]->npoints < 4
|| (!*hasz && !ptarray_isclosed2d(ppa[ring]))
|| (*hasz && !ptarray_isclosed3d(ppa[ring])))
|| (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
|| (*hasz && !ptarray_is_closed_3d(ppa[ring])))
lwerror("invalid KML representation");
ring++;