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