Coverage Report

Created: 2026-03-20 06:27

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/geos/include/geos/geomgraph/GraphComponent.h
Line
Count
Source
1
/**********************************************************************
2
 *
3
 * GEOS - Geometry Engine Open Source
4
 * http://geos.osgeo.org
5
 *
6
 * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7
 * Copyright (C) 2005-2006 Refractions Research Inc.
8
 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9
 *
10
 * This is free software; you can redistribute and/or modify it under
11
 * the terms of the GNU Lesser General Public Licence as published
12
 * by the Free Software Foundation.
13
 * See the COPYING file for more information.
14
 *
15
 **********************************************************************
16
 *
17
 * Last port: geomgraph/GraphComponent.java r428 (JTS-1.12+)
18
 *
19
 **********************************************************************/
20
21
22
#pragma once
23
24
#include <geos/export.h>
25
26
#include <geos/geomgraph/Label.h>
27
28
// Forward declarations
29
namespace geos {
30
namespace geom {
31
class IntersectionMatrix;
32
}
33
}
34
35
namespace geos {
36
namespace geomgraph { // geos.geomgraph
37
38
39
/** \brief
40
 * A GraphComponent is the parent class for the objects'
41
 * that form a graph.
42
 *
43
 * Each GraphComponent can carry a Label.
44
 */
45
class GEOS_DLL GraphComponent /* non-final */ {
46
public:
47
    GraphComponent();
48
49
    /*
50
     * GraphComponent copies the given Label.
51
     */
52
    GraphComponent(const Label& newLabel);
53
54
0
    virtual ~GraphComponent() = default;
55
56
    Label&
57
    getLabel()
58
0
    {
59
0
        return label;
60
0
    }
61
    const Label&
62
    getLabel() const
63
0
    {
64
0
        return label;
65
0
    }
66
    void
67
    setLabel(const Label& newLabel)
68
0
    {
69
0
        label = newLabel;
70
0
    }
71
72
    void
73
    setInResult(bool p_isInResult)
74
0
    {
75
0
        isInResultVar = p_isInResult;
76
0
    }
77
    bool
78
    isInResult() const
79
0
    {
80
0
        return isInResultVar;
81
0
    }
82
    void setCovered(bool isCovered);
83
    bool
84
    isCovered() const
85
0
    {
86
0
        return isCoveredVar;
87
0
    }
88
    bool
89
    isCoveredSet() const
90
0
    {
91
0
        return isCoveredSetVar;
92
0
    }
93
    bool
94
    isVisited() const
95
0
    {
96
0
        return isVisitedVar;
97
0
    }
98
    void
99
    setVisited(bool p_isVisited)
100
0
    {
101
0
        isVisitedVar = p_isVisited;
102
0
    }
103
    virtual bool isIsolated() const = 0;
104
    void updateIM(geom::IntersectionMatrix& im);
105
protected:
106
    Label label;
107
    virtual void computeIM(geom::IntersectionMatrix& im) = 0;
108
private:
109
    bool isInResultVar;
110
    bool isCoveredVar;
111
    bool isCoveredSetVar;
112
    bool isVisitedVar;
113
};
114
115
} // namespace geos.geomgraph
116
} // namespace geos
117