Coverage Report

Created: 2025-10-12 06:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/geos/include/geos/operation/polygonize/PolygonizeDirectedEdge.h
Line
Count
Source
1
/**********************************************************************
2
 *
3
 * GEOS - Geometry Engine Open Source
4
 * http://geos.osgeo.org
5
 *
6
 * Copyright (C) 2006 Refractions Research Inc.
7
 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8
 *
9
 * This is free software; you can redistribute and/or modify it under
10
 * the terms of the GNU Lesser General Public Licence as published
11
 * by the Free Software Foundation.
12
 * See the COPYING file for more information.
13
 *
14
 **********************************************************************
15
 *
16
 * Last port: operation/polygonize/PolygonizeDirectedEdge.java rev. 1.4 (JTS-1.10)
17
 *
18
 **********************************************************************/
19
20
#pragma once
21
22
#include <geos/export.h>
23
24
#include <geos/planargraph/DirectedEdge.h> // for inheritance
25
26
// Forward declarations
27
namespace geos {
28
namespace geom {
29
//class LineString;
30
}
31
namespace planargraph {
32
class Node;
33
}
34
namespace operation {
35
namespace polygonize {
36
class EdgeRing;
37
}
38
}
39
}
40
41
namespace geos {
42
namespace operation { // geos::operation
43
namespace polygonize { // geos::operation::polygonize
44
45
/** \brief
46
 * A DirectedEdge of a PolygonizeGraph, which represents
47
 * an edge of a polygon formed by the graph.
48
 *
49
 * May be logically deleted from the graph by setting the
50
 * <code>marked</code> flag.
51
 */
52
class GEOS_DLL PolygonizeDirectedEdge: public planargraph::DirectedEdge {
53
54
private:
55
56
    EdgeRing* edgeRing;
57
58
    PolygonizeDirectedEdge* next;
59
60
    long label;
61
62
public:
63
64
    /*
65
     * \brief
66
     * Constructs a directed edge connecting the <code>from</code> node
67
     * to the <code>to</code> node.
68
     *
69
     * @param directionPt
70
     *    specifies this DirectedEdge's direction (given by an imaginary
71
     *    line from the <code>from</code> node to <code>directionPt</code>)
72
     *
73
     * @param edgeDirection
74
     *    whether this DirectedEdge's direction is the same as or
75
     *    opposite to that of the parent Edge (if any)
76
     */
77
    PolygonizeDirectedEdge(planargraph::Node* newFrom,
78
                           planargraph::Node* newTo,
79
                           const geom::Coordinate& newDirectionPt,
80
                           bool nEdgeDirection);
81
82
    /*
83
     * Returns the identifier attached to this directed edge.
84
     */
85
    long getLabel() const;
86
87
    /*
88
     * Attaches an identifier to this directed edge.
89
     */
90
    void setLabel(long newLabel);
91
92
    /*
93
     * Returns the next directed edge in the EdgeRing that this
94
     * directed edge is a member of.
95
     */
96
    PolygonizeDirectedEdge* getNext() const;
97
98
    /*
99
     * Gets the EdgeRing this edge is a member of.
100
     */
101
0
    EdgeRing* getRing() const {
102
0
        return edgeRing;
103
0
    }
104
105
    /*
106
     * Sets the next directed edge in the EdgeRing that this
107
     * directed edge is a member of.
108
     */
109
    void setNext(PolygonizeDirectedEdge* newNext);
110
111
    /*
112
     * Returns the ring of directed edges that this directed edge is
113
     * a member of, or null if the ring has not been set.
114
     * @see #setRing(EdgeRing)
115
     */
116
    bool isInRing() const;
117
118
    /*
119
     * Sets the ring of directed edges that this directed edge is
120
     * a member of.
121
     */
122
    void setRing(EdgeRing* newEdgeRing);
123
};
124
} // namespace geos::operation::polygonize
125
} // namespace geos::operation
126
} // namespace geos
127