GEOS: IteratedNoder.h Source File

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

# IteratedNoder.h

    00001 /**********************************************************************
    00002  * $Id: IteratedNoder.h 1820 2006-09-06 16:54:23Z 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_ITERATEDNODER_H
    00017 #define GEOS_NODING_ITERATEDNODER_H
    00018
    00019 #include <vector>
    00020 #include <iostream>
    00021
    00022 #include <geos/inline.h>
    00023
    00024 #include <geos/algorithm/LineIntersector.h>
    00025 #include <geos/noding/SegmentString.h> // due to inlines
    00026 #include <geos/noding/Noder.h> // for inheritance
    00027
    00028 // Forward declarations
    00029 namespace geos {
    00030         namespace geom {
    00031                 class PrecisionModel;
    00032         }
    00033 }
    00034
    00035 namespace geos {
    00036 namespace noding { // geos::noding
    00037
    00050 class IteratedNoder : public Noder { // implements Noder
    00051
    00052 private:
    00053         static const int MAX_ITER = 5;
    00054
    00055
    00056         const geom::PrecisionModel *pm;
    00057         algorithm::LineIntersector li;
    00058         std::vector<SegmentString*>* nodedSegStrings;
    00059         int maxIter;
    00060
    00065         void node(std::vector<SegmentString*>* segStrings,
    00066                         int *numInteriorIntersections);
    00067
    00068 public:
    00069
    00070         IteratedNoder(const geom::PrecisionModel *newPm)
    00071                 :
    00072                 pm(newPm),
    00073                 li(pm),
    00074                 maxIter(MAX_ITER)
    00075         {
    00076         }
    00077
    00078         virtual ~IteratedNoder() {}
    00079
    00089         void setMaximumIterations(int n) { maxIter = n; }
    00090
    00091         std::vector<SegmentString*>* getNodedSubstrings() const {
    00092                 return SegmentString::getNodedSubstrings(*nodedSegStrings);
    00093         }
    00094
    00095
    00105         void computeNodes(std::vector<SegmentString*>* inputSegmentStrings); // throw(GEOSException);
    00106 };
    00107
    00108 } // namespace geos::noding
    00109 } // namespace geos
    00110
    00111
    00112 //#ifdef GEOS_INLINE
    00113 //# include "geos/noding/IteratedNoder.inl"
    00114 //#endif
    00115
    00116 #endif // GEOS_NODING_ITERATEDNODER_H
    00117
    00118 /**********************************************************************
    00119  * $Log$
    00120  * Revision 1.2  2006/03/24 09:52:41  strk
    00121  * USE_INLINE => GEOS_INLINE
    00122  *
    00123  * Revision 1.1  2006/03/09 16:46:49  strk
    00124  * geos::geom namespace definition, first pass at headers split
    00125  *
    00126  **********************************************************************/
    00127