GEOS  3.8.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  virtual ~GraphComponent();
56 
57  Label&
58  getLabel()
59  {
60  return label;
61  }
62  const Label&
63  getLabel() const
64  {
65  return label;
66  }
67  void
68  setLabel(const Label& newLabel)
69  {
70  label = newLabel;
71  }
72 
73  virtual void
74  setInResult(bool p_isInResult)
75  {
76  isInResultVar = p_isInResult;
77  }
78  virtual bool
79  isInResult() const
80  {
81  return isInResultVar;
82  }
83  virtual void setCovered(bool isCovered);
84  virtual bool
85  isCovered() const
86  {
87  return isCoveredVar;
88  }
89  virtual bool
90  isCoveredSet() const
91  {
92  return isCoveredSetVar;
93  }
94  virtual bool
95  isVisited() const
96  {
97  return isVisitedVar;
98  }
99  virtual void
100  setVisited(bool p_isVisited)
101  {
102  isVisitedVar = p_isVisited;
103  }
104  virtual bool isIsolated() const = 0;
105  virtual void updateIM(geom::IntersectionMatrix& im);
106 protected:
107  Label label;
108  virtual void computeIM(geom::IntersectionMatrix& im) = 0;
109 private:
110  bool isInResultVar;
111  bool isCoveredVar;
112  bool isCoveredSetVar;
113  bool isVisitedVar;
114 };
115 
116 } // namespace geos.geomgraph
117 } // namespace geos
118 
119 #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:58
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
A GraphComponent is the parent class for the objects' that form a graph.
Definition: geomgraph/GraphComponent.h:47