Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

SingleInteriorIntersectionFinder.h

00001 /**********************************************************************
00002  * $Id: SingleInteriorIntersectionFinder.h 2554 2009-06-06 21:14:51Z strk $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2006      Refractions Research Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************/
00015 
00016 #ifndef GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H
00017 #define GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H
00018 
00019 #include <geos/noding/SegmentIntersector.h> // for inheritance
00020 #include <geos/geom/Coordinate.h> // for composition
00021 
00022 #include <vector>
00023 
00024 // Forward declarations
00025 namespace geos {
00026         namespace algorithm {
00027                 class LineIntersector;
00028         }
00029         namespace noding {
00030                 class SegmentString;
00031         }
00032 }
00033 
00034 namespace geos {
00035 namespace noding { // geos.noding
00036 
00044 class SingleInteriorIntersectionFinder: public SegmentIntersector
00045 {
00046 
00047 private:
00048         algorithm::LineIntersector& li;
00049         geom::Coordinate interiorIntersection;
00050         std::vector<geom::Coordinate> intSegments;
00051 
00052 public:
00053 
00060         SingleInteriorIntersectionFinder(algorithm::LineIntersector& newLi)
00061                 :
00062                 li(newLi),
00063                 interiorIntersection(geom::Coordinate::getNull())
00064         {
00065         }
00066 
00072         bool hasIntersection() const
00073         { 
00074                 return !interiorIntersection.isNull(); 
00075         }
00076   
00083         const geom::Coordinate& getInteriorIntersection() const
00084         {    
00085                 return interiorIntersection;  
00086         }
00087 
00093         const std::vector<geom::Coordinate>& getIntersectionSegments() const
00094         {
00095                 return intSegments;
00096         }
00097   
00107         void processIntersections(
00108                 SegmentString* e0,  int segIndex0,
00109                 SegmentString* e1,  int segIndex1);
00110   
00111         bool isDone() const
00112         { 
00113                 return !interiorIntersection.isNull();
00114         }
00115 };
00116 
00117 } // namespace geos.noding
00118 } // namespace geos
00119 
00120 #endif // GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H
00121 
00122 /**********************************************************************
00123  * $Log$
00124  **********************************************************************/

Generated on Thu Jun 11 06:17:02 2009 for GEOS by  doxygen 1.4.4