GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

geomgraph/GraphComponent.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
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:
49 GraphComponent();
50
51 /*
52 * GraphComponent copies the given Label.
53 */
54 GraphComponent(const Label& newLabel);
55 virtual ~GraphComponent();
56
57 Label& getLabel() { return label; }
58 const Label& getLabel() const { return label; }
59 void setLabel(const Label& newLabel) { label = newLabel; }
60
61 virtual void setInResult(bool isInResult) { isInResultVar=isInResult; }
62 virtual bool isInResult() const { return isInResultVar; }
63 virtual void setCovered(bool isCovered);
64 virtual bool isCovered() const { return isCoveredVar; }
65 virtual bool isCoveredSet() const { return isCoveredSetVar; }
66 virtual bool isVisited() const { return isVisitedVar; }
67 virtual void setVisited(bool isVisited) { isVisitedVar = isVisited; }
68 virtual bool isIsolated() const=0;
69 virtual void updateIM(geom::IntersectionMatrix& im);
70 protected:
71 Label label;
72 virtual void computeIM(geom::IntersectionMatrix& im)=0;
73 private:
74 bool isInResultVar;
75 bool isCoveredVar;
76 bool isCoveredSetVar;
77 bool isVisitedVar;
78 };
79
80 } // namespace geos.geomgraph
81 } // namespace geos
82
83 #endif // ifndef GEOS_GEOMGRAPH_GRAPHCOMPONENT_H