Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out...
[geos.git] / include / geos / noding / SinglePassNoder.h
blob2ccf3eeeb4aee0fa3244feee452e56147581c875
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2006 Refractions Research Inc.
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
13 **********************************************************************/
15 #ifndef GEOS_NODING_SINGLEPASSNODER_H
16 #define GEOS_NODING_SINGLEPASSNODER_H
18 #include <geos/export.h>
20 #include <vector>
22 #include <geos/inline.h>
24 #include <geos/noding/Noder.h>
26 // Forward declarations
27 namespace geos {
28 namespace noding {
29 class SegmentString;
30 class SegmentIntersector;
34 namespace geos {
35 namespace noding { // geos.noding
38 /**
39 * Base class for {@link Noder}s which make a single
40 * pass to find intersections.
41 * This allows using a custom {@link SegmentIntersector}
42 * (which for instance may simply identify intersections, rather than
43 * insert them).
45 * Last port: noding/SinglePassNoder.java rev. 1.3 (JTS-1.7)
47 * TODO: Noder inheritance (that's just an interface!)
50 class GEOS_DLL SinglePassNoder : public Noder { // implements Noder
52 protected:
54 /// Externally owned
55 SegmentIntersector* segInt;
57 public:
59 SinglePassNoder(SegmentIntersector* nSegInt=NULL): segInt(nSegInt) {}
61 virtual ~SinglePassNoder() {}
63 /**
64 * Sets the SegmentIntersector to use with this noder.
65 * A SegmentIntersector will normally add intersection nodes
66 * to the input segment strings, but it may not - it may
67 * simply record the presence of intersections.
68 * However, some Noders may require that intersections be added.
70 * @param newSegInt
72 virtual void setSegmentIntersector(SegmentIntersector* newSegInt) {
73 segInt = newSegInt;
76 /**
77 * Computes the noding for a collection of {@link SegmentString}s.
79 * @param segStrings a collection of {@link SegmentString}s to node
81 virtual void computeNodes(std::vector<SegmentString*>* segStrings)=0;
83 /**
84 * Returns a {@link Collection} of fully noded {@link SegmentStrings}.
85 * The SegmentStrings have the same context as their parent.
87 * @return a Collection of SegmentStrings
89 virtual std::vector<SegmentString*>* getNodedSubstrings() const=0;
93 } // namespace geos.noding
94 } // namespace geos
96 //#ifdef GEOS_INLINE
97 //# include "geos/noding/SinglePassNoder.inl"
98 //#endif
100 #endif // GEOS_NODING_SINGLEPASSNODER_H
102 /**********************************************************************
103 * $Log$
104 * Revision 1.2 2006/03/24 09:52:41 strk
105 * USE_INLINE => GEOS_INLINE
107 * Revision 1.1 2006/03/09 16:46:49 strk
108 * geos::geom namespace definition, first pass at headers split
110 **********************************************************************/