GraphComponent.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
00007  * Copyright (C) 2005-2006 Refractions Research Inc.
00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation. 
00013  * See the COPYING file for more information.
00014  *
00015  **********************************************************************
00016  *
00017  * Last port: geomgraph/GraphComponent.java r428 (JTS-1.12+)
00018  *
00019  **********************************************************************/
00020 
00021 
00022 #ifndef GEOS_GEOMGRAPH_GRAPHCOMPONENT_H
00023 #define GEOS_GEOMGRAPH_GRAPHCOMPONENT_H
00024 
00025 #include <geos/export.h>
00026 #include <geos/inline.h>
00027 
00028 #include <geos/geomgraph/Label.h>
00029 
00030 // Forward declarations
00031 namespace geos {
00032         namespace geom {
00033                 class IntersectionMatrix;
00034         }
00035 }
00036 
00037 namespace geos {
00038 namespace geomgraph { // geos.geomgraph
00039 
00040 
00047 class GEOS_DLL GraphComponent {
00048 public:
00049         GraphComponent();
00050 
00051         /*
00052          * GraphComponent copies the given Label.
00053          */
00054         GraphComponent(const Label& newLabel); 
00055         virtual ~GraphComponent();
00056 
00057         Label& getLabel() { return label; }
00058         const Label& getLabel() const { return label; }
00059         void setLabel(const Label& newLabel) { label = newLabel; }
00060 
00061         virtual void setInResult(bool isInResult) { isInResultVar=isInResult; }
00062         virtual bool isInResult() const { return isInResultVar; }
00063         virtual void setCovered(bool isCovered);
00064         virtual bool isCovered() const { return isCoveredVar; }
00065         virtual bool isCoveredSet() const { return isCoveredSetVar; }
00066         virtual bool isVisited() const { return isVisitedVar; }
00067         virtual void setVisited(bool isVisited) { isVisitedVar = isVisited; }
00068         virtual bool isIsolated() const=0;
00069         virtual void updateIM(geom::IntersectionMatrix& im);
00070 protected:
00071         Label label;
00072         virtual void computeIM(geom::IntersectionMatrix& im)=0;
00073 private:
00074         bool isInResultVar;
00075         bool isCoveredVar;
00076         bool isCoveredSetVar;
00077         bool isVisitedVar;
00078 };
00079 
00080 } // namespace geos.geomgraph
00081 } // namespace geos
00082 
00083 #endif // ifndef GEOS_GEOMGRAPH_GRAPHCOMPONENT_H

Generated on 10 Sep 2013 for GEOS by  doxygen 1.4.7