GEOS 3.11.1
geomgraph/GraphComponent.h
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
29namespace geos {
30namespace geom {
31class IntersectionMatrix;
32}
33}
34
35namespace geos {
36namespace geomgraph { // geos.geomgraph
37
38
45class GEOS_DLL GraphComponent {
46public:
48
49 /*
50 * GraphComponent copies the given Label.
51 */
52 GraphComponent(const Label& newLabel);
53
54 virtual ~GraphComponent() = default;
55
56 Label&
57 getLabel()
58 {
59 return label;
60 }
61 const Label&
62 getLabel() const
63 {
64 return label;
65 }
66 void
67 setLabel(const Label& newLabel)
68 {
69 label = newLabel;
70 }
71
72 virtual void
73 setInResult(bool p_isInResult)
74 {
75 isInResultVar = p_isInResult;
76 }
77 virtual bool
78 isInResult() const
79 {
80 return isInResultVar;
81 }
82 virtual void setCovered(bool isCovered);
83 virtual bool
84 isCovered() const
85 {
86 return isCoveredVar;
87 }
88 virtual bool
89 isCoveredSet() const
90 {
91 return isCoveredSetVar;
92 }
93 virtual bool
94 isVisited() const
95 {
96 return isVisitedVar;
97 }
98 virtual void
99 setVisited(bool p_isVisited)
100 {
101 isVisitedVar = p_isVisited;
102 }
103 virtual bool isIsolated() const = 0;
104 virtual void updateIM(geom::IntersectionMatrix& im);
105protected:
106 Label label;
107 virtual void computeIM(geom::IntersectionMatrix& im) = 0;
108private:
109 bool isInResultVar;
110 bool isCoveredVar;
111 bool isCoveredSetVar;
112 bool isVisitedVar;
113};
114
115} // namespace geos.geomgraph
116} // namespace geos
117
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition: IntersectionMatrix.h:51
A GraphComponent is the parent class for the objects' that form a graph.
Definition: geomgraph/GraphComponent.h:45
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:57
Basic namespace for all GEOS functionalities.
Definition: geos.h:39