GEOS  3.9.1dev
LineLimiter.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
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 #pragma once
16 
18 
19 #include <geos/export.h>
20 #include <array>
21 #include <memory>
22 #include <vector>
23 
24 // Forward declarations
25 namespace geos {
26 namespace geom {
27 class Envelope;
28 class Coordinate;
29 class CoordinateSequence;
30 }
31 }
32 
33 using namespace geos::geom;
34 
35 namespace geos { // geos.
36 namespace operation { // geos.operation
37 namespace overlayng { // geos.operation.overlayng
38 
57 
58 private:
59 
60  // Members
62  std::unique_ptr<std::vector<Coordinate>> ptList;
64  std::vector<std::unique_ptr<CoordinateArraySequence>> sections;
65 
66  // Methods
67  void addPoint(const Coordinate* p);
68  void addOutside(const Coordinate* p);
69  bool isLastSegmentIntersecting(const Coordinate* p);
70  bool isSectionOpen();
71  void startSection();
72  void finishSection();
73 
74 
75 public:
76 
77  LineLimiter(const Envelope* env)
78  : limitEnv(env)
79  , ptList(nullptr)
80  , lastOutside(nullptr)
81  {};
82 
83  std::vector<std::unique_ptr<CoordinateArraySequence>>& limit(const CoordinateSequence *pts);
84 
85 };
86 
87 
88 } // namespace geos.operation.overlayng
89 } // namespace geos.operation
90 } // namespace geos
91 
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
std::vector< std::unique_ptr< CoordinateArraySequence > > sections
Definition: LineLimiter.h:64
Basic namespace for all GEOS functionalities.
std::unique_ptr< std::vector< Coordinate > > ptList
Definition: LineLimiter.h:62
The internal representation of a list of coordinates inside a Geometry.