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 * Last port: noding/MCIndexNoder.java rev. 1.6 (JTS-1.9)
17 **********************************************************************/
19 #ifndef GEOS_NODING_MCINDEXNODER_H
20 #define GEOS_NODING_MCINDEXNODER_H
22 #include <geos/export.h>
24 #include <geos/inline.h>
26 #include <geos/index/chain/MonotoneChainOverlapAction.h> // for inheritance
27 #include <geos/noding/SinglePassNoder.h> // for inheritance
28 #include <geos/index/strtree/STRtree.h> // for composition
29 #include <geos/util.h>
36 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
39 // Forward declarations
46 class SegmentIntersector
;
51 namespace noding
{ // geos.noding
54 * Nodes a set of SegmentString using a index based
55 * on index::chain::MonotoneChain and a index::SpatialIndex.
57 * The {@link SpatialIndex} used should be something that supports
58 * envelope (range) queries efficiently (such as a index::quadtree::Quadtree
59 * or index::strtree::STRtree.
61 * Last port: noding/MCIndexNoder.java rev. 1.4 (JTS-1.7)
63 class GEOS_DLL MCIndexNoder
: public SinglePassNoder
{
66 std::vector
<index::chain::MonotoneChain
*> monoChains
;
67 index::strtree::STRtree index
;
69 std::vector
<SegmentString
*>* nodedSegStrings
;
73 void intersectChains();
75 void add(SegmentString
* segStr
);
79 MCIndexNoder(SegmentIntersector
*nSegInt
=NULL
)
81 SinglePassNoder(nSegInt
),
83 nodedSegStrings(NULL
),
89 /// Return a reference to this instance's std::vector of MonotoneChains
90 std::vector
<index::chain::MonotoneChain
*>& getMonotoneChains() { return monoChains
; }
92 index::SpatialIndex
& getIndex();
94 std::vector
<SegmentString
*>* getNodedSubstrings() const;
96 void computeNodes(std::vector
<SegmentString
*>* inputSegmentStrings
);
98 class SegmentOverlapAction
: public index::chain::MonotoneChainOverlapAction
{
100 SegmentOverlapAction(SegmentIntersector
& newSi
)
102 index::chain::MonotoneChainOverlapAction(),
106 void overlap(index::chain::MonotoneChain
& mc1
, std::size_t start1
,
107 index::chain::MonotoneChain
& mc2
, std::size_t start2
);
109 SegmentIntersector
& si
;
111 // Declare type as noncopyable
112 SegmentOverlapAction(const SegmentOverlapAction
& other
);
113 SegmentOverlapAction
& operator=(const SegmentOverlapAction
& rhs
);
118 } // namespace geos.noding
126 # include <geos/noding/MCIndexNoder.inl>
129 #endif // GEOS_NODING_MCINDEXNODER_H
131 /**********************************************************************
133 * Revision 1.4 2006/03/24 09:52:41 strk
134 * USE_INLINE => GEOS_INLINE
136 * Revision 1.3 2006/03/22 18:12:31 strk
137 * indexChain.h header split.
139 * Revision 1.2 2006/03/14 12:55:56 strk
140 * Headers split: geomgraphindex.h, nodingSnapround.h
142 * Revision 1.1 2006/03/09 16:46:49 strk
143 * geos::geom namespace definition, first pass at headers split
145 **********************************************************************/