GEOS 3.14.0dev
LineSegmentIndex.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: simplify/LineSegmentIndex.java rev. 1.1 (JTS-1.7.1)
16 *
17 **********************************************************************
18 *
19 * NOTES
20 *
21 **********************************************************************/
22
23#pragma once
24
25#include <geos/export.h>
26#include <geos/geom/Envelope.h>
27#include <geos/index/quadtree/Quadtree.h>
28#include <vector>
29#include <memory> // for unique_ptr
30
31#ifdef _MSC_VER
32#pragma warning(push)
33#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
34#endif
35
36// Forward declarations
37namespace geos {
38namespace geom {
39class LineSegment;
40}
41namespace simplify {
42class TaggedLineString;
43}
44}
45
46namespace geos {
47namespace simplify { // geos::simplify
48
49class GEOS_DLL LineSegmentIndex {
50
51public:
52
53 LineSegmentIndex() = default;
54
55 ~LineSegmentIndex() = default;
56
57 void add(const TaggedLineString& line);
58
59 void add(const geom::LineSegment* seg);
60
61 void remove(const geom::LineSegment* seg);
62
63 std::vector<const geom::LineSegment*>
64 query(const geom::LineSegment* seg);
65
66
67private:
68
69 index::quadtree::Quadtree index;
70
71 std::vector<std::unique_ptr<geom::Envelope>> newEnvelopes;
72
77 LineSegmentIndex(const LineSegmentIndex&) = delete;
78 LineSegmentIndex& operator=(const LineSegmentIndex&) = delete;
79};
80
81} // namespace geos::simplify
82} // namespace geos
83
84#ifdef _MSC_VER
85#pragma warning(pop)
86#endif
87
Basic namespace for all GEOS functionalities.
Definition geos.h:39