GEOS: IteratedNoder.h Source File

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

- File List

# IteratedNoder.h

    00001 /**********************************************************************
    00002  * $Id: IteratedNoder.h 2556 2009-06-06 22:22:28Z 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  * Last port: noding/IteratedNoder.java rev. 1.6 (JTS-1.9)
    00017  *
    00018  **********************************************************************/
    00019
    00020 #ifndef GEOS_NODING_ITERATEDNODER_H
    00021 #define GEOS_NODING_ITERATEDNODER_H
    00022
    00023 #include <geos/export.h>
    00024
    00025 #include <vector>
    00026 #include <iostream>
    00027
    00028 #include <geos/inline.h>
    00029
    00030 #include <geos/algorithm/LineIntersector.h>
    00031 #include <geos/noding/SegmentString.h> // due to inlines
    00032 #include <geos/noding/Noder.h> // for inheritance
    00033
    00034 // Forward declarations
    00035 namespace geos {
    00036         namespace geom {
    00037                 class PrecisionModel;
    00038         }
    00039 }
    00040
    00041 namespace geos {
    00042 namespace noding { // geos::noding
    00043
    00055 class GEOS_DLL IteratedNoder : public Noder { // implements Noder
    00056
    00057 private:
    00058         static const int MAX_ITER = 5;
    00059
    00060
    00061         const geom::PrecisionModel *pm;
    00062         algorithm::LineIntersector li;
    00063         std::vector<SegmentString*>* nodedSegStrings;
    00064         int maxIter;
    00065
    00070         void node(std::vector<SegmentString*>* segStrings,
    00071                         int *numInteriorIntersections);
    00072
    00073 public:
    00074
    00075         IteratedNoder(const geom::PrecisionModel *newPm)
    00076                 :
    00077                 pm(newPm),
    00078                 li(pm),
    00079                 maxIter(MAX_ITER)
    00080         {
    00081         }
    00082
    00083         virtual ~IteratedNoder() {}
    00084
    00094         void setMaximumIterations(int n) { maxIter = n; }
    00095
    00096         std::vector<SegmentString*>* getNodedSubstrings() const {
    00097                 return nodedSegStrings;
    00098         }
    00099
    00100
    00110         void computeNodes(std::vector<SegmentString*>* inputSegmentStrings); // throw(GEOSException);
    00111 };
    00112
    00113 } // namespace geos::noding
    00114 } // namespace geos
    00115
    00116
    00117 //#ifdef GEOS_INLINE
    00118 //# include "geos/noding/IteratedNoder.inl"
    00119 //#endif
    00120
    00121 #endif // GEOS_NODING_ITERATEDNODER_H
    00122
    00123 /**********************************************************************
    00124  * $Log$
    00125  * Revision 1.2  2006/03/24 09:52:41  strk
    00126  * USE_INLINE => GEOS_INLINE
    00127  *
    00128  * Revision 1.1  2006/03/09 16:46:49  strk
    00129  * geos::geom namespace definition, first pass at headers split
    00130  *
    00131  **********************************************************************/
    00132