GEOS: SingleInteriorIntersectionFinder.h Source File

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

- File List

# SingleInteriorIntersectionFinder.h

    00001 /**********************************************************************
    00002  * $Id: SingleInteriorIntersectionFinder.h 2778 2009-12-03 19:44:00Z mloskot $
    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 public:
    00048
    00055         SingleInteriorIntersectionFinder(algorithm::LineIntersector& newLi)
    00056                 :
    00057                 li(newLi),
    00058                 interiorIntersection(geom::Coordinate::getNull())
    00059         {
    00060         }
    00061
    00067         bool hasIntersection() const
    00068         {
    00069                 return !interiorIntersection.isNull();
    00070         }
    00071
    00078         const geom::Coordinate& getInteriorIntersection() const
    00079         {
    00080                 return interiorIntersection;
    00081         }
    00082
    00088         const std::vector<geom::Coordinate>& getIntersectionSegments() const
    00089         {
    00090                 return intSegments;
    00091         }
    00092
    00102         void processIntersections(
    00103                 SegmentString* e0,  int segIndex0,
    00104                 SegmentString* e1,  int segIndex1);
    00105
    00106         bool isDone() const
    00107         {
    00108                 return !interiorIntersection.isNull();
    00109         }
    00110
    00111 private:
    00112         algorithm::LineIntersector& li;
    00113         geom::Coordinate interiorIntersection;
    00114         std::vector<geom::Coordinate> intSegments;
    00115
    00116     // Declare type as noncopyable
    00117     SingleInteriorIntersectionFinder(const SingleInteriorIntersectionFinder& other);
    00118     SingleInteriorIntersectionFinder& operator=(const SingleInteriorIntersectionFinder& rhs);
    00119 };
    00120
    00121 } // namespace geos.noding
    00122 } // namespace geos
    00123
    00124 #endif // GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H
    00125
    00126 /**********************************************************************
    00127  * $Log$
    00128  **********************************************************************/