/src/geos/include/geos/edgegraph/MarkHalfEdge.h
Line | Count | Source |
1 | | /********************************************************************** |
2 | | * |
3 | | * GEOS - Geometry Engine Open Source |
4 | | * http://geos.osgeo.org |
5 | | * |
6 | | * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca> |
7 | | * |
8 | | * This is free software; you can redistribute and/or modify it under |
9 | | * the terms of the GNU Lesser General Public Licence as published |
10 | | * by the Free Software Foundation. |
11 | | * See the COPYING file for more information. |
12 | | * |
13 | | **********************************************************************/ |
14 | | |
15 | | |
16 | | #pragma once |
17 | | |
18 | | #include <geos/geom/Coordinate.h> |
19 | | #include <geos/edgegraph/HalfEdge.h> |
20 | | |
21 | | #include <geos/export.h> |
22 | | #include <string> |
23 | | #include <cassert> |
24 | | |
25 | | namespace geos { |
26 | | namespace edgegraph { // geos.edgegraph |
27 | | |
28 | | class GEOS_DLL MarkHalfEdge : public HalfEdge { |
29 | | |
30 | | private: |
31 | | |
32 | | bool m_isMarked; |
33 | | |
34 | | public: |
35 | | |
36 | | /** |
37 | | * Creates a new marked edge. |
38 | | * |
39 | | * @param orig the coordinate of the edge origin |
40 | | */ |
41 | | MarkHalfEdge(const geom::CoordinateXYZM& p_orig) : |
42 | 0 | HalfEdge(p_orig), |
43 | 0 | m_isMarked(false) |
44 | 0 | {}; |
45 | | |
46 | | /** |
47 | | * Tests whether the given edge is marked. |
48 | | * |
49 | | * @param e the edge to test |
50 | | * @return true if the edge is marked |
51 | | */ |
52 | | static bool isMarked(HalfEdge* e); |
53 | | |
54 | | /** |
55 | | * Marks the given edge. |
56 | | * |
57 | | * @param e the edge to mark |
58 | | */ |
59 | | static void mark(HalfEdge* e); |
60 | | |
61 | | /** |
62 | | * Sets the mark for the given edge to a boolean value. |
63 | | * |
64 | | * @param e the edge to set |
65 | | * @param isMarked the mark value |
66 | | */ |
67 | | static void setMark(HalfEdge* e, bool isMarked); |
68 | | |
69 | | /** |
70 | | * Sets the mark for the given edge pair to a boolean value. |
71 | | * |
72 | | * @param e an edge of the pair to update |
73 | | * @param isMarked the mark value to set |
74 | | */ |
75 | | static void setMarkBoth(HalfEdge* e, bool isMarked); |
76 | | |
77 | | /** |
78 | | * Marks the edges in a pair. |
79 | | * |
80 | | * @param e an edge of the pair to mark |
81 | | */ |
82 | | static void markBoth(HalfEdge* e); |
83 | | |
84 | | /** |
85 | | * Tests whether this edge is marked. |
86 | | * |
87 | | * @return true if this edge is marked |
88 | | */ |
89 | 0 | bool isMarked() const { return m_isMarked; } |
90 | | |
91 | | /** |
92 | | * Marks this edge. |
93 | | * |
94 | | */ |
95 | 0 | void mark() { m_isMarked = true; } |
96 | | |
97 | | /** |
98 | | * Sets the value of the mark on this edge. |
99 | | * |
100 | | * @param isMarked the mark value to set |
101 | | */ |
102 | 0 | void setMark(bool p_isMarked) { m_isMarked = p_isMarked; } |
103 | | |
104 | | }; |
105 | | |
106 | | |
107 | | } // namespace geos.edgegraph |
108 | | } // namespace geos |
109 | | |
110 | | |
111 | | |