GEOS  3.13.0dev
VertexRingCounter.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2021 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 
17 #include <map>
18 
19 #include <geos/geom/CoordinateSequenceFilter.h>
20 #include <geos/geom/Coordinate.h>
21 #include <geos/export.h>
22 
23 namespace geos {
24 namespace geom {
25 class CoordinateSequence;
26 class Geometry;
27 }
28 }
29 
34 
35 
36 namespace geos {
37 namespace coverage { // geos::coverage
38 
39 class VertexRingCounter : public CoordinateSequenceFilter
40 {
41 
42 public:
43 
44  VertexRingCounter(std::map<Coordinate, std::size_t>& counts)
45  : vertexCounts(counts)
46  {};
47 
48  bool isGeometryChanged() const override {
49  return false;
50  }
51 
52  bool isDone() const override {
53  return false;
54  }
55 
56  void filter_ro(const CoordinateSequence& seq, std::size_t i) override;
57 
58  static void count(
59  const std::vector<const Geometry*>& geoms,
60  std::map<Coordinate, std::size_t>& counts);
61 
62 private:
63 
64  std::map<Coordinate, std::size_t>& vertexCounts;
65 
66 }; // VertexRingCounter
67 
68 
69 
70 } // geos::coverage
71 } // geos
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition: CoordinateSequenceFilter.h:55
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:216
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25