GEOS 3.9.1
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
28namespace geos {
29namespace geom {
30class CoordinateSequence;
31}
32namespace index {
33namespace chain {
34class MonotoneChain;
35}
36}
37}
38
39namespace geos {
40namespace index { // geos::index
41namespace chain { // geos::index::chain
42
49class GEOS_DLL MonotoneChainBuilder {
50
51public:
52
54
59 static std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>> getChains(
60 const geom::CoordinateSequence* pts,
61 void* context);
62
71 static void getChains(const geom::CoordinateSequence* pts,
72 void* context,
73 std::vector<std::unique_ptr<MonotoneChain>>& mcList);
74
75 static std::unique_ptr<std::vector<std::unique_ptr<MonotoneChain>>>
76 getChains(const geom::CoordinateSequence* pts)
77 {
78 return getChains(pts, nullptr);
79 }
80
86 MonotoneChainBuilder& operator=(const MonotoneChainBuilder&) = delete;
87
88
89private:
90
105 static std::size_t findChainEnd(const geom::CoordinateSequence& pts,
106 std::size_t start);
107};
108
109} // namespace geos::index::chain
110} // namespace geos::index
111} // namespace geos
112
113#endif // GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
114
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
Constructs MonotoneChains for sequences of Coordinates.
Definition: MonotoneChainBuilder.h:49
static std::unique_ptr< std::vector< std::unique_ptr< MonotoneChain > > > getChains(const geom::CoordinateSequence *pts, void *context)
Return a newly-allocated vector of newly-allocated MonotoneChain objects for the given CoordinateSequ...
static void getChains(const geom::CoordinateSequence *pts, void *context, std::vector< std::unique_ptr< MonotoneChain > > &mcList)
Computes a list of the MonotoneChains for a list of coordinates, attaching a context data object to e...
MonotoneChainBuilder(const MonotoneChainBuilder &)=delete
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26