# NodingValidator.h

    00001 /**********************************************************************
    00002  * $Id: NodingValidator.h 1931 2006-12-05 09:59:04Z 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_NODINGVALIDATOR_H
    00017 #define GEOS_NODING_NODINGVALIDATOR_H
    00018
    00019 #include <vector>
    00020 #include <iostream>
    00021
    00022 #include <geos/inline.h>
    00023
    00024 #include <geos/algorithm/LineIntersector.h>
    00025 //#include <geos/geom/Coordinate.h>
    00026
    00027 // Forward declarations
    00028 namespace geos {
    00029         namespace geom {
    00030                 class Coordinate;
    00031         }
    00032         namespace noding {
    00033                 class SegmentString;
    00034         }
    00035 }
    00036
    00037 namespace geos {
    00038 namespace noding { // geos.noding
    00039
    00047 class NodingValidator {
    00048 private:
    00049         algorithm::LineIntersector li;
    00050         const std::vector<SegmentString*>& segStrings;
    00051
    00056         void checkCollapses() const;
    00057
    00058         void checkCollapses(const SegmentString& ss) const;
    00059
    00060         void checkCollapse(const geom::Coordinate& p0, const geom::Coordinate& p1,
    00061                         const geom::Coordinate& p2) const;
    00062
    00067         void checkInteriorIntersections();
    00068
    00069         void checkInteriorIntersections(const SegmentString& ss0,
    00070                         const SegmentString& ss1);
    00071
    00072         void checkInteriorIntersections(
    00073                         const SegmentString& e0, unsigned int segIndex0,
    00074                         const SegmentString& e1, unsigned int segIndex1);
    00075
    00080         void checkEndPtVertexIntersections() const;
    00081
    00082         void checkEndPtVertexIntersections(const geom::Coordinate& testPt,
    00083                         const std::vector<SegmentString*>& segStrings) const;
    00084
    00089         bool hasInteriorIntersection(const algorithm::LineIntersector& aLi,
    00090                         const geom::Coordinate& p0, const geom::Coordinate& p1) const;
    00091
    00092 public:
    00093
    00094         NodingValidator(const std::vector<SegmentString*>& newSegStrings):
    00095                 segStrings(newSegStrings)
    00096         {}
    00097
    00098         ~NodingValidator() {}
    00099
    00100         void checkValid();
    00101
    00102 };
    00103
    00104
    00105 } // namespace geos.noding
    00106 } // namespace geos
    00107
    00108 //#ifdef GEOS_INLINE
    00109 //# include "geos/noding/NodingValidator.inl"
    00110 //#endif
    00111
    00112 #endif // GEOS_NODING_NODINGVALIDATOR_H
    00113
    00114 /**********************************************************************
    00115  * $Log$
    00116  * Revision 1.2  2006/03/24 09:52:41  strk
    00117  * USE_INLINE => GEOS_INLINE
    00118  *
    00119  * Revision 1.1  2006/03/09 16:46:49  strk
    00120  * geos::geom namespace definition, first pass at headers split
    00121  *
    00122  **********************************************************************/
    00123