Remove an isolated edge.
3648{
3654 uint64_t n = 1;
3655 uint64_t i;
3656
3661 if ( ! edge )
3662 {
3664 return -1;
3665 }
3666 if ( ! n )
3667 {
3668 lwerror(
"SQL/MM Spatial exception - non-existent edge");
3669 return -1;
3670 }
3671 if ( n > 1 )
3672 {
3674 lwerror(
"Corrupted topology: more than a single edge have id %"
3676 return -1;
3677 }
3678
3679 if ( edge[0].face_left != edge[0].face_right )
3680 {
3682 lwerror(
"SQL/MM Spatial exception - not isolated edge");
3683 return -1;
3684 }
3686
3690
3691 n = 2;
3693 if ((n == UINT64_MAX) || (edge == NULL))
3694 {
3696 return -1;
3697 }
3698 for (i = 0; i < n; ++i)
3699 {
3700 if (edge[i].edge_id != id)
3701 {
3703 lwerror(
"SQL/MM Spatial exception - not isolated edge");
3704 return -1;
3705 }
3706 }
3708
3711 if (n == UINT64_MAX)
3712 {
3714 return -1;
3715 }
3716 if ( n != 1 )
3717 {
3718 lwerror(
"Unexpected error: %d edges deleted when expecting 1", n);
3719 return -1;
3720 }
3721
3724 n = 1;
3725 if ( nid[1] != nid[0] ) {
3728 ++n;
3729 }
3732 if (n == UINT64_MAX)
3733 {
3735 return -1;
3736 }
3737
3738
3739
3740
3741
3742 return 0;
3743}
#define LWT_COL_EDGE_FACE_RIGHT
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_START_NODE
#define LWT_COL_EDGE_FACE_LEFT
#define LWT_COL_NODE_CONTAINING_FACE
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_END_NODE
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
static int lwt_be_updateNodesById(LWT_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, int numnodes, int upd_fields)
int lwt_be_deleteEdges(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
LWT_ELEMID containing_face
const LWT_BE_IFACE * be_iface