GEOS 3.14.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
23namespace geos {
24namespace geom {
25class CoordinateSequence;
26class Geometry;
27}
28}
29
30namespace geos {
31namespace coverage { // geos::coverage
32
33class VertexRingCounter : public geos::geom::CoordinateSequenceFilter
34{
35 using Coordinate = geos::geom::Coordinate;
36 using CoordinateSequence = geos::geom::CoordinateSequence;
37 using Geometry = geos::geom::Geometry;
38
39public:
40
41 VertexRingCounter(std::map<Coordinate, std::size_t>& counts)
42 : vertexCounts(counts)
43 {};
44
45 bool isGeometryChanged() const override {
46 return false;
47 }
48
49 bool isDone() const override {
50 return false;
51 }
52
53 void filter_ro(const CoordinateSequence& seq, std::size_t i) override;
54
55 static void count(
56 const std::vector<const Geometry*>& geoms,
57 std::map<Coordinate, std::size_t>& counts);
58
59private:
60
61 std::map<Coordinate, std::size_t>& vertexCounts;
62
63}; // VertexRingCounter
64
65
66
67} // geos::coverage
68} // geos
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition CoordinateSequenceFilter.h:56
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:217
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Basic namespace for all GEOS functionalities.
Definition geos.h:39