GEOS 3.6.2
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 <vector>
24#include <cstddef>
25
26// Forward declarations
27namespace geos {
28 namespace geom {
30 }
31 namespace index {
32 namespace chain {
33 class MonotoneChain;
34 }
35 }
36}
37
38namespace geos {
39namespace index { // geos::index
40namespace chain { // geos::index::chain
41
48class GEOS_DLL MonotoneChainBuilder {
49
50public:
51
52 MonotoneChainBuilder(){}
53
59 static std::vector<MonotoneChain*>* getChains(
60 const geom::CoordinateSequence *pts,
61 void* context);
62
68 static void getChains(const geom::CoordinateSequence *pts,
69 void* context,
70 std::vector<MonotoneChain*>& mcList);
71
72 static std::vector<MonotoneChain*>* getChains(const geom::CoordinateSequence *pts)
73 {
74 return getChains(pts, NULL);
75 }
76
85 std::vector<std::size_t>& startIndexList);
86
87private:
88
100 static std::size_t findChainEnd(const geom::CoordinateSequence& pts,
101 std::size_t start);
102};
103
104} // namespace geos::index::chain
105} // namespace geos::index
106} // namespace geos
107
108#endif // GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
109
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
static void getChainStartIndices(const geom::CoordinateSequence &pts, std::vector< std::size_t > &startIndexList)
Fill the given vector with start/end indexes of the monotone chains for the given CoordinateSequence....
static std::vector< 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< MonotoneChain * > &mcList)
Fill the provided vector with newly-allocated MonotoneChain objects for the given CoordinateSequence....
Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of...
Definition index/chain/MonotoneChain.h:86
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement Monotone Chains.
Definition MCPointInRing.h:41
Provides classes for various kinds of spatial indexes.
Definition IndexedNestedRingTester.h:31
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25