GEOS  3.3.3
SimpleMCSweepLineIntersector.h
1 /**********************************************************************
2  * $Id: SimpleMCSweepLineIntersector.h 3255 2011-03-01 17:56:10Z mloskot $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************/
16 
17 #ifndef GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
18 #define GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
19 
20 #include <geos/export.h>
21 #include <vector>
22 
23 #include <geos/geomgraph/index/EdgeSetIntersector.h> // for inheritance
24 
25 #ifdef _MSC_VER
26 #pragma warning(push)
27 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
28 #endif
29 
30 // Forward declarations
31 namespace geos {
32  namespace geomgraph {
33  class Edge;
34  namespace index {
35  class SegmentIntersector;
36  class SweepLineEvent;
37  }
38  }
39 }
40 
41 namespace geos {
42 namespace geomgraph { // geos::geomgraph
43 namespace index { // geos::geomgraph::index
44 
54 class GEOS_DLL SimpleMCSweepLineIntersector: public EdgeSetIntersector {
55 
56 public:
57 
59 
61 
62  void computeIntersections(std::vector<Edge*> *edges,
63  SegmentIntersector *si, bool testAllSegments);
64 
65  void computeIntersections(std::vector<Edge*> *edges0,
66  std::vector<Edge*> *edges1,
67  SegmentIntersector *si);
68 
69 protected:
70 
71  std::vector<SweepLineEvent*> events;
72 
73  // statistics information
74  int nOverlaps;
75 
76 private:
77  void add(std::vector<Edge*> *edges);
78 
79  void add(std::vector<Edge*> *edges,void* edgeSet);
80 
81  void add(Edge *edge,void* edgeSet);
82 
83  void prepareEvents();
84 
85  void computeIntersections(SegmentIntersector *si);
86 
87  void processOverlaps(int start, int end,
88  SweepLineEvent *ev0,
89  SegmentIntersector *si);
90 };
91 
92 } // namespace geos.geomgraph.index
93 } // namespace geos.geomgraph
94 } // namespace geos
95 
96 #ifdef _MSC_VER
97 #pragma warning(pop)
98 #endif
99 
100 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
101 
102 /**********************************************************************
103  * $Log$
104  * Revision 1.1 2006/03/14 12:55:55 strk
105  * Headers split: geomgraphindex.h, nodingSnapround.h
106  *
107  **********************************************************************/
108