/src/geos/include/geos/index/chain/MonotoneChainOverlapAction.h
Line | Count | Source |
1 | | /********************************************************************** |
2 | | * |
3 | | * GEOS - Geometry Engine Open Source |
4 | | * http://geos.osgeo.org |
5 | | * |
6 | | * Copyright (C) 2001-2002 Vivid Solutions Inc. |
7 | | * |
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. |
12 | | * |
13 | | ********************************************************************** |
14 | | * |
15 | | * Last port: index/chain/MonotoneChainOverlapAction.java rev. 1.6 (JTS-1.10) |
16 | | * |
17 | | **********************************************************************/ |
18 | | |
19 | | #pragma once |
20 | | |
21 | | #include <geos/export.h> |
22 | | #include <geos/geom/LineSegment.h> |
23 | | |
24 | | |
25 | | // Forward declarations |
26 | | namespace geos { |
27 | | namespace index { |
28 | | namespace chain { |
29 | | class MonotoneChain; |
30 | | } |
31 | | } |
32 | | } |
33 | | |
34 | | namespace geos { |
35 | | namespace index { // geos::index |
36 | | namespace chain { // geos::index::chain |
37 | | |
38 | | /** \brief |
39 | | * The action for the internal iterator for performing |
40 | | * overlap queries on a MonotoneChain. |
41 | | */ |
42 | | class GEOS_DLL MonotoneChainOverlapAction { |
43 | | |
44 | | protected: |
45 | | |
46 | | geom::LineSegment overlapSeg1; |
47 | | |
48 | | geom::LineSegment overlapSeg2; |
49 | | |
50 | | public: |
51 | | |
52 | 418k | MonotoneChainOverlapAction() {} |
53 | | |
54 | | virtual |
55 | 418k | ~MonotoneChainOverlapAction() {} |
56 | | |
57 | | /** \brief |
58 | | * This function can be overridden if the original chains are needed. |
59 | | * |
60 | | * @param mc1 a MonotoneChain |
61 | | * @param mc2 a MonotoneChain |
62 | | * @param start1 the index of the start of the overlapping segment |
63 | | * from mc1 |
64 | | * @param start2 the index of the start of the overlapping segment |
65 | | * from mc2 |
66 | | */ |
67 | | virtual void overlap(const MonotoneChain& mc1, std::size_t start1, |
68 | | const MonotoneChain& mc2, std::size_t start2); |
69 | | |
70 | | /** \brief |
71 | | * This is a convenience function which can be overridden to |
72 | | * obtain the actual line segments which overlap. |
73 | | * |
74 | | * **param** `seg1` |
75 | | * **param** `seg2` |
76 | | */ |
77 | | virtual void |
78 | | overlap(const geom::LineSegment& /*seg1*/, |
79 | 0 | const geom::LineSegment& /*seg2*/) {} |
80 | | |
81 | | }; |
82 | | |
83 | | } // namespace geos::index::chain |
84 | | } // namespace geos::index |
85 | | } // namespace geos |
86 | | |