GEOS  3.3.3
IteratedNoder.h
1 /**********************************************************************
2  * $Id: IteratedNoder.h 2556 2009-06-06 22:22:28Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2006 Refractions Research Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: noding/IteratedNoder.java rev. 1.6 (JTS-1.9)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_NODING_ITERATEDNODER_H
21 #define GEOS_NODING_ITERATEDNODER_H
22 
23 #include <geos/export.h>
24 
25 #include <vector>
26 #include <iostream>
27 
28 #include <geos/inline.h>
29 
30 #include <geos/algorithm/LineIntersector.h>
31 #include <geos/noding/SegmentString.h> // due to inlines
32 #include <geos/noding/Noder.h> // for inheritance
33 
34 // Forward declarations
35 namespace geos {
36  namespace geom {
37  class PrecisionModel;
38  }
39 }
40 
41 namespace geos {
42 namespace noding { // geos::noding
43 
55 class GEOS_DLL IteratedNoder : public Noder { // implements Noder
56 
57 private:
58  static const int MAX_ITER = 5;
59 
60 
61  const geom::PrecisionModel *pm;
63  std::vector<SegmentString*>* nodedSegStrings;
64  int maxIter;
65 
70  void node(std::vector<SegmentString*>* segStrings,
71  int *numInteriorIntersections);
72 
73 public:
74 
76  :
77  pm(newPm),
78  li(pm),
79  maxIter(MAX_ITER)
80  {
81  }
82 
83  virtual ~IteratedNoder() {}
84 
94  void setMaximumIterations(int n) { maxIter = n; }
95 
96  std::vector<SegmentString*>* getNodedSubstrings() const {
97  return nodedSegStrings;
98  }
99 
100 
110  void computeNodes(std::vector<SegmentString*>* inputSegmentStrings); // throw(GEOSException);
111 };
112 
113 } // namespace geos::noding
114 } // namespace geos
115 
116 
117 //#ifdef GEOS_INLINE
118 //# include "geos/noding/IteratedNoder.inl"
119 //#endif
120 
121 #endif // GEOS_NODING_ITERATEDNODER_H
122 
123 /**********************************************************************
124  * $Log$
125  * Revision 1.2 2006/03/24 09:52:41 strk
126  * USE_INLINE => GEOS_INLINE
127  *
128  * Revision 1.1 2006/03/09 16:46:49 strk
129  * geos::geom namespace definition, first pass at headers split
130  *
131  **********************************************************************/
132