PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
liblwgeom_topo.h
Go to the documentation of this file.
1/**********************************************************************
2 *
3 * PostGIS - Spatial Types for PostgreSQL
4 * http://postgis.net
5 *
6 * PostGIS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PostGIS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18 *
19 **********************************************************************
20 *
21 * Copyright (C) 2015-2021 Sandro Santilli <strk@kbt.io>
22 *
23 **********************************************************************/
24
25
26#ifndef LIBLWGEOM_TOPO_H
27#define LIBLWGEOM_TOPO_H 1
28
29#include "liblwgeom.h"
30
31/* INT64 */
32typedef int64_t LWT_INT64;
33
36
37/*
38 * ISO primitive elements
39 */
40
42typedef struct
43{
45 LWT_ELEMID containing_face; /* -1 if not isolated */
47}
49
51
53#define LWT_COL_NODE_NODE_ID 1<<0
54#define LWT_COL_NODE_CONTAINING_FACE 1<<1
55#define LWT_COL_NODE_GEOM 1<<2
56#define LWT_COL_NODE_ALL (1<<3)-1
57
71
73#define LWT_COL_EDGE_EDGE_ID 1<<0
74#define LWT_COL_EDGE_START_NODE 1<<1
75#define LWT_COL_EDGE_END_NODE 1<<2
76#define LWT_COL_EDGE_FACE_LEFT 1<<3
77#define LWT_COL_EDGE_FACE_RIGHT 1<<4
78#define LWT_COL_EDGE_NEXT_LEFT 1<<5
79#define LWT_COL_EDGE_NEXT_RIGHT 1<<6
80#define LWT_COL_EDGE_GEOM 1<<7
81#define LWT_COL_EDGE_ALL (1<<8)-1
82
84typedef struct
85{
88}
90
92#define LWT_COL_FACE_FACE_ID 1<<0
93#define LWT_COL_FACE_MBR 1<<1
94#define LWT_COL_FACE_ALL (1<<2)-1
95
102
103/*
104 * Backend handling functions
105 */
106
107/* opaque pointers referencing native backend objects */
108
115typedef struct LWT_BE_DATA_T LWT_BE_DATA;
116
125
133typedef struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY;
134
140typedef struct LWT_BE_CALLBACKS_T {
141
147 const char* (*lastErrorMessage) (const LWT_BE_DATA* be);
148
159 LWT_BE_TOPOLOGY *(*createTopology)(const LWT_BE_DATA *be, const char *name, int32_t srid, double precision, int hasZ);
160
168 LWT_BE_TOPOLOGY* (*loadTopologyByName) (
169 const LWT_BE_DATA* be,
170 const char* name
171 );
172
180
198 LWT_ISO_NODE *(*getNodeById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
199
220 LWT_ISO_NODE *(*getNodeWithinDistance2D)(const LWT_BE_TOPOLOGY *topo,
221 const LWPOINT *pt,
222 double dist,
223 uint64_t *numelems,
224 int fields,
225 int64_t limit);
226
240 int (*insertNodes)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_NODE *nodes, uint64_t numelems);
241
258 LWT_ISO_EDGE *(*getEdgeById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
259
280 LWT_ISO_EDGE *(*getEdgeWithinDistance2D)(const LWT_BE_TOPOLOGY *topo,
281 const LWPOINT *pt,
282 double dist,
283 uint64_t *numelems,
284 int fields,
285 int64_t limit);
286
298 const LWT_BE_TOPOLOGY* topo
299 );
300
314 int (*insertEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_EDGE *edges, uint64_t numelems);
315
334 int (*updateEdges) (
335 const LWT_BE_TOPOLOGY* topo,
336 const LWT_ISO_EDGE* sel_edge, int sel_fields,
337 const LWT_ISO_EDGE* upd_edge, int upd_fields,
338 const LWT_ISO_EDGE* exc_edge, int exc_fields
339 );
340
357 LWT_ISO_FACE *(*getFaceById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
358
378 const LWT_BE_TOPOLOGY* topo,
379 LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2
380 );
381
393 int (*deleteEdges) (
394 const LWT_BE_TOPOLOGY* topo,
395 const LWT_ISO_EDGE* sel_edge, int sel_fields
396 );
397
418 *getNodeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit);
419
440 *getEdgeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit);
441
460 LWT_ISO_EDGE *(*getEdgeByNode)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
461
480 int (*updateNodes) (
481 const LWT_BE_TOPOLOGY* topo,
482 const LWT_ISO_NODE* sel_node, int sel_fields,
483 const LWT_ISO_NODE* upd_node, int upd_fields,
484 const LWT_ISO_NODE* exc_node, int exc_fields
485 );
486
502 const LWT_BE_TOPOLOGY* topo,
503 LWT_ELEMID split_face, LWT_ELEMID new_face1, LWT_ELEMID new_face2
504 );
505
519 int (*insertFaces)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, uint64_t numelems);
520
532 uint64_t (*updateFacesById) (
533 const LWT_BE_TOPOLOGY* topo,
534 const LWT_ISO_FACE* faces, uint64_t numfaces
535 );
536
537 /*
538 * Get the ordered list edge visited by a side walk
539 *
540 * The walk starts from the side of an edge and stops when
541 * either the max number of visited edges OR the starting
542 * position is reached. The output list never includes a
543 * duplicated signed edge identifier.
544 *
545 * It is expected that the walk uses the "next_left" and "next_right"
546 * attributes of ISO edges to perform the walk (rather than recomputing
547 * the turns at each node).
548 *
549 * @param topo the topology to operate on
550 * @param edge walk start position and direction:
551 * abs value identifies the edge, sign expresses
552 * side (left if positive, right if negative)
553 * and direction (forward if positive, backward if negative).
554 * @param numedges output parameter, gets the number of edges visited
555 *
556 * @param limit max edges to return (to avoid an infinite loop in case
557 * of a corrupted topology). 0 is for unlimited.
558 * The function is expected to error out if the limit is hit.
559 *
560 * @return an array of signed edge identifiers (positive edges being
561 * walked in their direction, negative ones in opposite) or
562 * NULL on error (@see lastErrorMessage)
563 */
564 LWT_ELEMID *(*getRingEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge, uint64_t *numedges, int limit);
565
579 int (*updateEdgesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, uint64_t numedges, int upd_fields);
580
601 LWT_ISO_EDGE *(*getEdgeByFace)(const LWT_BE_TOPOLOGY *topo,
602 const LWT_ELEMID *ids,
603 uint64_t *numelems,
604 int fields,
605 const GBOX *box);
606
625 LWT_ISO_NODE *(*getNodeByFace)(const LWT_BE_TOPOLOGY *topo,
626 const LWT_ELEMID *faces,
627 uint64_t *numelems,
628 int fields,
629 const GBOX *box);
630
644 int (*updateNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, uint64_t numnodes, int upd_fields);
645
656 int (*deleteFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems);
657
662 int (*topoGetSRID) (
663 const LWT_BE_TOPOLOGY* topo
664 );
665
670 const LWT_BE_TOPOLOGY* topo
671 );
672
677 int (*topoHasZ) (
678 const LWT_BE_TOPOLOGY* topo
679 );
680
691 int (*deleteNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems);
692
706 const LWT_BE_TOPOLOGY* topo,
707 LWT_ELEMID rem_edge,
708 LWT_ELEMID face_left,
709 LWT_ELEMID face_right
710 );
711
727 const LWT_BE_TOPOLOGY* topo,
728 LWT_ELEMID face1, LWT_ELEMID face2, LWT_ELEMID newface
729 );
730
752 const LWT_BE_TOPOLOGY* topo,
753 LWT_ELEMID rem_node,
754 LWT_ELEMID e1,
755 LWT_ELEMID e2
756 );
757
774 const LWT_BE_TOPOLOGY* topo,
775 LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge
776 );
777
797 LWT_ISO_FACE *(*getFaceWithinBox2D)(const LWT_BE_TOPOLOGY *topo,
798 const GBOX *box,
799 uint64_t *numelems,
800 int fields,
801 int limit);
802
817 const LWT_BE_TOPOLOGY* topo,
818 LWT_ELEMID rem_node
819 );
820
831 const LWT_BE_TOPOLOGY* topo,
832 LWT_ELEMID rem_edge
833 );
834
835
851 LWT_ISO_EDGE *(*getClosestEdge)(const LWT_BE_TOPOLOGY *topo,
852 const LWPOINT *pt,
853 uint64_t *numelems,
854 int fields);
855
865 GBOX *(*computeFaceMBR)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID face);
866
868
869
878
886
889
890/********************************************************************
891 *
892 * End of BE interface
893 *
894 *******************************************************************/
895
911
921
922/*
923 * Topology functions
924 */
925
931
932
933/*******************************************************************
934 *
935 * Non-ISO signatures here
936 *
937 *******************************************************************/
938
951LWT_TOPOLOGY *lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int32_t srid, double prec, int hasz);
952
962LWT_TOPOLOGY *lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name);
963
970
976
987LWT_ELEMID lwt_GetNodeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
988
1000LWT_ELEMID lwt_GetEdgeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
1001
1014LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt, double tol);
1015
1027
1028
1029
1030/*******************************************************************
1031 *
1032 * Topology population (non-ISO)
1033 *
1034 *******************************************************************/
1035
1049LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol);
1050
1072LWT_ELEMID* lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol,
1073 int* nedges, int max_edges);
1074
1096LWT_ELEMID* lwt_AddLineNoFace(LWT_TOPOLOGY* topo, LWLINE* line, double tol,
1097 int* nedges);
1098
1099/*
1100 * Determine and register all topology faces:
1101 *
1102 * - Determines which faces are generated by existing
1103 * edges.
1104 * - Creates face records with correct mbr
1105 * - Update edge left/right face attributes
1106 *
1107 * Precondition:
1108 * - the topology edges are correctly linked
1109 * - there are no faces registered in the topology
1110 *
1111 * Postconditions:
1112 * - all left/right face attributes of edges
1113 * reference faces with correct mbr.
1114 *
1115 * Notes:
1116 * - does not attempt to assign isolated nodes to their
1117 * containing faces
1118 * - does not remove existing face records
1119 * - loads in memory all the topology edges
1120 *
1121 * @param topo the topology to operate on
1122 *
1123 * @return 0 on success, -1 on error
1124 * (librtgeom error handler will be invoked with error
1125 * message)
1126 */
1127int lwt_Polygonize(LWT_TOPOLOGY* topo);
1128
1147LWT_ELEMID* lwt_AddPolygon(LWT_TOPOLOGY* topo, LWPOLY* poly, double tol,
1148 int* nfaces);
1149
1161void lwt_LoadGeometry(LWT_TOPOLOGY* topo, LWGEOM* geom, double tol);
1162
1163/*******************************************************************
1164 *
1165 * ISO signatures here
1166 *
1167 *******************************************************************/
1168
1179
1197 LWPOINT* pt, int skipChecks);
1198
1212 LWT_ELEMID node, LWPOINT* pt);
1213
1226
1238int lwt_RemIsoEdge(LWT_TOPOLOGY* topo, LWT_ELEMID edge);
1239
1254 LWT_ELEMID startNode, LWT_ELEMID endNode,
1255 const LWLINE *geom);
1256
1279 LWT_ELEMID start_node, LWT_ELEMID end_node,
1280 LWLINE *geom, int skipChecks);
1281
1300 LWT_ELEMID start_node, LWT_ELEMID end_node,
1301 LWLINE *geom, int skipChecks);
1302
1315
1332
1344int lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWLINE* curve);
1345
1360LWT_ELEMID lwt_ModEdgeSplit(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipChecks);
1361
1375LWT_ELEMID lwt_NewEdgesSplit(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipChecks);
1376
1390
1404
1418int lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face, LWT_ELEMID **edges);
1419
1432
1433#endif /* LIBLWGEOM_TOPO_H */
static uint8_t precision
Definition cu_in_twkb.c:25
This library is the generic geometry handling section of PostGIS.
LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY *topo, LWPOINT *point, double tol)
Adds a point to the topology.
struct LWT_BE_CALLBACKS_T LWT_BE_CALLBACKS
Structure containing base backend callbacks.
LWT_ELEMID * lwt_AddLine(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges, int max_edges)
Adds a linestring to the topology.
int lwt_RemoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node)
Remove an isolated node.
LWT_INT64 LWT_ELEMID
Identifier of topology element.
struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
Topology handler.
void lwt_BackendIfaceRegisterCallbacks(LWT_BE_IFACE *iface, const LWT_BE_CALLBACKS *cb)
Register backend callbacks into the opaque iface handler.
LWT_ELEMID lwt_GetFaceContainingPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt)
Find the face-id of the face properly containing a given point.
LWT_ELEMID lwt_AddIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWPOINT *pt, int skipChecks)
Add an isolated node.
enum LWT_TOPOERR_TYPE_T LWT_TOPOERR_TYPE
Topology errors type.
void lwt_LoadGeometry(LWT_TOPOLOGY *topo, LWGEOM *geom, double tol)
Load a geometry into the topology.
void lwt_FreeBackendIface(LWT_BE_IFACE *iface)
Release memory associated with an LWT_BE_IFACE.
LWT_ELEMID lwt_ModEdgeSplit(LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWPOINT *pt, int skipChecks)
Split an edge by a node, modifying the original edge and adding a new one.
LWT_ELEMID lwt_GetEdgeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Find the edge-id of an edge that intersects a given point.
LWT_ELEMID lwt_AddEdgeModFace(LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, LWLINE *geom, int skipChecks)
Add a new edge possibly splitting a face (modifying it)
LWT_ELEMID lwt_RemEdgeModFace(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an edge, possibly merging two faces (replacing one with the other)
LWT_ELEMID * lwt_AddPolygon(LWT_TOPOLOGY *topo, LWPOLY *poly, double tol, int *nfaces)
Adds a polygon to the topology.
LWT_ELEMID * lwt_AddLineNoFace(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
Adds a linestring to the topology without determining generated faces.
int lwt_RemIsoEdge(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an isolated edge.
LWT_ELEMID lwt_NewEdgesSplit(LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWPOINT *pt, int skipChecks)
Split an edge by a node, replacing it with two new edges.
LWT_TOPOERR_TYPE_T
Topology errors type.
@ LWT_TOPOERR_EDGE_STARTNODE_MISMATCH
@ LWT_TOPOERR_FACE_OVERLAPS_FACE
@ LWT_TOPOERR_EDGE_CROSSES_NODE
@ LWT_TOPOERR_EDGE_ENDNODE_MISMATCH
@ LWT_TOPOERR_EDGE_INVALID
@ LWT_TOPOERR_FACE_WITHIN_FACE
@ LWT_TOPOERR_EDGE_CROSSES_EDGE
@ LWT_TOPOERR_EDGE_NOT_SIMPLE
@ LWT_TOPOERR_FACE_HAS_NO_RINGS
@ LWT_TOPOERR_FACE_WITHOUT_EDGES
LWT_ELEMID lwt_AddIsoEdge(LWT_TOPOLOGY *topo, LWT_ELEMID startNode, LWT_ELEMID endNode, const LWLINE *geom)
Add an isolated edge connecting two existing isolated nodes.
LWT_SPATIALTYPE_T
@ LWT_PUNTAL
@ LWT_COLLECTION
@ LWT_LINEAL
@ LWT_AREAL
int64_t LWT_INT64
LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt, double tol)
Find the face-id of a face containing a given point.
void lwt_iso_node_release(LWT_ISO_NODE *node)
LWT_ELEMID lwt_RemEdgeNewFace(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an edge, possibly merging two faces (replacing both with a new one)
int lwt_MoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node, LWPOINT *pt)
Move an isolated node.
LWT_TOPOLOGY * lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name)
Loads an existing topology by name from the database.
int lwt_Polygonize(LWT_TOPOLOGY *topo)
LWT_ELEMID lwt_AddEdgeNewFaces(LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, LWLINE *geom, int skipChecks)
Add a new edge possibly splitting a face (replacing with two new faces)
LWT_BE_IFACE * lwt_CreateBackendIface(const LWT_BE_DATA *data)
Create a new backend interface.
LWT_TOPOLOGY * lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int32_t srid, double prec, int hasz)
Initializes a new topology.
struct LWT_TOPOERR_T LWT_TOPOERR
Topology error.
LWT_ELEMID lwt_ModEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
Merge two edges, modifying the first and deleting the second.
void lwt_CreateTopoGeo(LWT_TOPOLOGY *topo, LWGEOM *geom)
Populate an empty topology with data from a simple geometry.
enum LWT_SPATIALTYPE_T LWT_SPATIALTYPE
void lwt_FreeTopology(LWT_TOPOLOGY *topo)
Release memory associated with an LWT_TOPOLOGY.
LWT_ELEMID lwt_NewEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
Merge two edges, replacing both with a new one.
struct LWT_BE_DATA_T LWT_BE_DATA
Backend private data pointer.
void lwt_DropTopology(LWT_TOPOLOGY *topo)
Drop a topology and all its associated objects from the database.
LWT_ELEMID lwt_GetNodeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Retrieve the id of a node at a point location.
int lwt_GetFaceEdges(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWT_ELEMID **edges)
Return the list of directed edges bounding a face.
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID face)
Return the geometry of a face.
int lwt_ChangeEdgeGeom(LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWLINE *curve)
Changes the shape of an edge without affecting the topology structure.
int(* updateTopoGeomFaceHeal)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID face1, LWT_ELEMID face2, LWT_ELEMID newface)
Update TopoGeometry objects after healing two faces.
int(* updateTopoGeomFaceSplit)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID split_face, LWT_ELEMID new_face1, LWT_ELEMID new_face2)
Update TopoGeometry objects after a face split event.
int(* deleteFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
Delete faces by id.
int(* checkTopoGeomRemEdge)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_edge, LWT_ELEMID face_left, LWT_ELEMID face_right)
Check TopoGeometry objects before an edge removal event.
int(* checkTopoGeomRemNode)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_node, LWT_ELEMID e1, LWT_ELEMID e2)
Check TopoGeometry objects before a node removal event.
uint64_t(* updateFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_FACE *faces, uint64_t numfaces)
Update faces by id.
int(* topoGetSRID)(const LWT_BE_TOPOLOGY *topo)
Get topology SRID.
int(* checkTopoGeomRemIsoNode)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_node)
Check TopoGeometry objects before an isolated node removal event.
int(* deleteNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
Delete nodes by id.
int(* updateNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, uint64_t numnodes, int upd_fields)
Update nodes by id.
int(* insertNodes)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_NODE *nodes, uint64_t numelems)
Insert nodes.
double(* topoGetPrecision)(const LWT_BE_TOPOLOGY *topo)
Get topology precision.
LWT_ELEMID(* getNextEdgeId)(const LWT_BE_TOPOLOGY *topo)
Get next available edge identifier.
int(* updateNodes)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *sel_node, int sel_fields, const LWT_ISO_NODE *upd_node, int upd_fields, const LWT_ISO_NODE *exc_node, int exc_fields)
Update nodes selected by fields match/mismatch.
int(* updateEdges)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields, const LWT_ISO_EDGE *upd_edge, int upd_fields, const LWT_ISO_EDGE *exc_edge, int exc_fields)
Update edges selected by fields match/mismatch.
int(* freeTopology)(LWT_BE_TOPOLOGY *topo)
Release memory associated to a backend topology.
LWT_ISO_EDGE *(* getEdgeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit)
Get edges whose bounding box overlaps a given 2D bounding box.
int(* insertEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_EDGE *edges, uint64_t numelems)
Insert edges.
int(* checkTopoGeomRemIsoEdge)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_edge)
Check TopoGeometry objects before an isolated edge removal event.
int(* updateTopoGeomEdgeHeal)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge)
Update TopoGeometry objects after healing two edges.
LWT_ISO_NODE *(* getNodeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit)
Get edges whose bounding box overlaps a given 2D bounding box.
int(* updateTopoGeomEdgeSplit)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2)
Update TopoGeometry objects after an edge split event.
int(* insertFaces)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, uint64_t numelems)
Insert faces.
int(* topoHasZ)(const LWT_BE_TOPOLOGY *topo)
Get topology Z flag.
int(* updateEdgesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, uint64_t numedges, int upd_fields)
Update edges by id.
int(* deleteEdges)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
Delete edges.
Structure containing base backend callbacks.
LWT_ELEMID face_right
LWT_ELEMID next_right
LWT_ELEMID end_node
LWT_ELEMID face_left
LWT_ELEMID next_left
LWT_ELEMID edge_id
LWT_ELEMID start_node
LWT_ELEMID face_id
LWT_ELEMID node_id
LWT_ELEMID containing_face
LWPOINT * geom
LWT_ELEMID elem1
Identifier of first affected element.
LWT_TOPOERR_TYPE err
Type of error.
LWT_ELEMID elem2
Identifier of second affected element (0 if inapplicable)
Topology error.