PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ _lwt_FirstDistinctVertex2D()

static int _lwt_FirstDistinctVertex2D ( const POINTARRAY pa,
const POINT2D ref,
int  from,
int  dir,
POINT2D op 
)
static

Definition at line 1545 of file lwgeom_topo.c.

1546{
1547 int i, toofar, inc;
1548 POINT2D fp;
1549
1550 if ( dir > 0 )
1551 {
1552 toofar = pa->npoints;
1553 inc = 1;
1554 }
1555 else
1556 {
1557 toofar = -1;
1558 inc = -1;
1559 }
1560
1561 LWDEBUGF(2, "first point is index %d", from);
1562 fp = *ref; /* getPoint2d_p(pa, from, &fp); */
1563 for ( i = from+inc; i != toofar; i += inc )
1564 {
1565 LWDEBUGF(2, "testing point %d", i);
1566 getPoint2d_p(pa, i, op); /* pick next point */
1567 if ( P2D_SAME_STRICT(op,&fp) ) continue; /* equal to startpoint */
1568 /* this is a good one, neither same of start nor of end point */
1569 return 1; /* found */
1570 }
1571
1572 /* no distinct vertices found */
1573 return 0;
1574}
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition lwgeom_api.c:342
#define P2D_SAME_STRICT(a, b)
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106
uint32_t npoints
Definition liblwgeom.h:427

References getPoint2d_p(), LWDEBUGF, POINTARRAY::npoints, and P2D_SAME_STRICT.

Referenced by _lwt_AddEdge(), _lwt_FindAdjacentEdges(), _lwt_InitEdgeEndByLine(), and _lwt_SnapEdgeToExistingNode().

Here is the call graph for this function:
Here is the caller graph for this function: