PostGIS  2.5.0dev-r@@SVN_REVISION@@
static LWT_EDGERING* _lwt_BuildEdgeRing ( LWT_TOPOLOGY topo,
LWT_ISO_EDGE_TABLE edges,
LWT_ISO_EDGE edge,
int  side 
)
static

Definition at line 6461 of file lwgeom_topo.c.

References _lwt_getIsoEdgeById(), rtgdalraster::cur, LWT_EDGERING_ELEM_T::edge, LWT_ISO_EDGE::edge_id, LWT_ISO_EDGE::face_left, LWT_ISO_EDGE::face_right, LWT_EDGERING_ELEM_T::left, lwalloc(), LWDEBUGF, lwerror(), LWT_EDGERING_INIT, LWT_EDGERING_PUSH, LWT_HOLES_FACE_PLACEHOLDER, LWT_ISO_EDGE::next_left, LWT_ISO_EDGE::next_right, and LWT_EDGERING_T::size.

Referenced by _lwt_RegisterFaceOnEdgeSide().

6463 {
6464  LWT_EDGERING *ring;
6465  LWT_EDGERING_ELEM *elem;
6466  LWT_ISO_EDGE *cur;
6467  int curside;
6468 
6469  ring = lwalloc(sizeof(LWT_EDGERING));
6470  LWT_EDGERING_INIT(ring);
6471 
6472  cur = edge;
6473  curside = side;
6474 
6475  LWDEBUGF(2, "Building rings for edge %d (side %d)", cur->edge_id, side);
6476 
6477  do {
6478  LWT_ELEMID next;
6479 
6480  elem = lwalloc(sizeof(LWT_EDGERING_ELEM));
6481  elem->edge = cur;
6482  elem->left = ( curside == 1 );
6483 
6484  /* Mark edge as "visited" */
6485  if ( elem->left ) cur->face_left = LWT_HOLES_FACE_PLACEHOLDER;
6487 
6488  LWT_EDGERING_PUSH(ring, elem);
6489  next = elem->left ? cur->next_left : cur->next_right;
6490 
6491  LWDEBUGF(3, " next edge is %d", next);
6492 
6493  if ( next > 0 ) curside = 1;
6494  else { curside = -1; next = -next; }
6495  cur = _lwt_getIsoEdgeById(edges, next);
6496  if ( ! cur )
6497  {
6498  lwerror("Could not find edge with id %d", next);
6499  break;
6500  }
6501  } while (cur != edge || curside != side);
6502 
6503  LWDEBUGF(1, "Ring for edge %d has %d elems", edge->edge_id*side, ring->size);
6504 
6505  return ring;
6506 }
LWT_ELEMID face_left
#define LWT_EDGERING_PUSH(a, r)
Definition: lwgeom_topo.c:6209
#define LWT_HOLES_FACE_PLACEHOLDER
Definition: lwgeom_topo.c:6329
LWT_ELEMID next_left
LWT_ISO_EDGE * edge
Definition: lwgeom_topo.c:6181
LWT_ELEMID face_right
LWT_ELEMID edge_id
static LWT_ISO_EDGE * _lwt_getIsoEdgeById(LWT_ISO_EDGE_TABLE *tab, LWT_ELEMID id)
Definition: lwgeom_topo.c:6168
#define LWT_EDGERING_INIT(a)
Definition: lwgeom_topo.c:6201
LWT_ELEMID next_right
LWT_INT64 LWT_ELEMID
Identifier of topology element.
void * lwalloc(size_t size)
Definition: lwutil.c:229
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190

Here is the call graph for this function:

Here is the caller graph for this function: