PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWLINE* lwline_clone_deep ( const LWLINE g)

Definition at line 105 of file lwline.c.

References LWLINE::bbox, LWLINE::flags, FLAGS_SET_READONLY, gbox_copy(), lwalloc(), LWDEBUGF, LWLINE::points, and ptarray_clone_deep().

Referenced by lwgeom_clone_deep(), and lwline_split_by_point().

106 {
107  LWLINE *ret = lwalloc(sizeof(LWLINE));
108 
109  LWDEBUGF(2, "lwline_clone_deep called with %p", g);
110  memcpy(ret, g, sizeof(LWLINE));
111 
112  if ( g->bbox ) ret->bbox = gbox_copy(g->bbox);
113  if ( g->points ) ret->points = ptarray_clone_deep(g->points);
114  FLAGS_SET_READONLY(ret->flags,0);
115 
116  return ret;
117 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:362
GBOX * bbox
Definition: liblwgeom.h:376
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
Definition: ptarray.c:619
void * lwalloc(size_t size)
Definition: lwutil.c:175
uint8_t flags
Definition: liblwgeom.h:375
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
#define FLAGS_SET_READONLY(flags, value)
Definition: liblwgeom.h:116
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: