GEOS  3.8.0dev
MonotoneChainBuilder.h
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/MonotoneChainBuilder.java r388 (JTS-1.12)
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
20 #define GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
21 
22 #include <geos/export.h>
23 #include <memory>
24 #include <vector>
25 #include <cstddef>
26 
27 // Forward declarations
28 namespace geos {
29 namespace geom {
30 class CoordinateSequence;
31 }
32 namespace index {
33 namespace chain {
34 class MonotoneChain;
35 }
36 }
37 }
38 
39 namespace geos {
40 namespace index { // geos::index
41 namespace chain { // geos::index::chain
42 
49 class GEOS_DLL MonotoneChainBuilder {
50 
51 public:
52 
54 
60  static std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>> getChains(
61  const geom::CoordinateSequence* pts,
62  void* context);
63 
69  static void getChains(const geom::CoordinateSequence* pts,
70  void* context,
71  std::vector<std::unique_ptr<MonotoneChain>>& mcList);
72 
73  static std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>>
74  getChains(const geom::CoordinateSequence* pts)
75  {
76  return getChains(pts, nullptr);
77  }
78 
86  static void getChainStartIndices(const geom::CoordinateSequence& pts,
87  std::vector<std::size_t>& startIndexList);
88 
94  MonotoneChainBuilder& operator=(const MonotoneChainBuilder&) = delete;
95 
96 
97 private:
98 
110  static std::size_t findChainEnd(const geom::CoordinateSequence& pts,
111  std::size_t start);
112 };
113 
114 } // namespace geos::index::chain
115 } // namespace geos::index
116 } // namespace geos
117 
118 #endif // GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
119 
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Constructs MonotoneChains for sequences of Coordinates.
Definition: MonotoneChainBuilder.h:49
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58