PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
lwt_edgeend_star.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) 2024 Sandro Santilli <strk@kbt.io>
22 *
23 **********************************************************************/
24
25#ifndef _LWT_EDGEEND_STAR_H
26#define _LWT_EDGEEND_STAR_H 1
27
28#include "liblwgeom_internal.h"
30#include "lwt_edgeend.h"
31
32
33/* Collection of edge ends around a node */
34typedef struct LWT_EDGEEND_STAR_t {
35 uint64_t numEdgeEnds;
37 LWT_EDGEEND **edgeEnds; /* owned by us */
38 LWT_ELEMID nodeID; /* identifier of the node this star belongs to */
39 int sorted; /* 0 when the edge ends are not yet sorted by azimuth */
41
42/*
43 * Initialize an edge end star for a given nodeId
44 *
45 * Release it with lwt_edgeEndStar_release
46 */
48
49/*
50 * Release memory owned by an edge end star
51 */
53
54/* Add an edge to the star
55 *
56 * It may result in one or two EdgeEnds being added, depending on
57 * whether or not both endnodes match the star nodeId.
58 *
59 */
61
63
64/* Get the next clockwise edgeEnd */
65const LWT_EDGEEND *lwt_edgeEndStar_getNextCW( LWT_EDGEEND_STAR *star, LWT_ISO_EDGE *edge, int outgoing );
66
67/* Get the next counterclockwise edgeEnd */
68const LWT_EDGEEND *lwt_edgeEndStar_getNextCCW( LWT_EDGEEND_STAR *star, LWT_ISO_EDGE *edge, int outgoing );
69
70#endif /* !defined _LWT_EDGEEND_STAR_H */
LWT_INT64 LWT_ELEMID
Identifier of topology element.
struct LWT_EDGEEND_STAR_t LWT_EDGEEND_STAR
const LWT_EDGEEND * lwt_edgeEndStar_getNextCW(LWT_EDGEEND_STAR *star, LWT_ISO_EDGE *edge, int outgoing)
LWT_EDGEEND_STAR * lwt_edgeEndStar_init(LWT_ELEMID nodeID)
const LWT_EDGEEND * lwt_edgeEndStar_getNextCCW(LWT_EDGEEND_STAR *star, LWT_ISO_EDGE *edge, int outgoing)
void lwt_edgeEndStar_release(LWT_EDGEEND_STAR *star)
void lwt_EdgeEndStar_debugPrint(const LWT_EDGEEND_STAR *star)
void lwt_edgeEndStar_addEdge(LWT_EDGEEND_STAR *star, const LWT_ISO_EDGE *edge)
LWT_EDGEEND ** edgeEnds