File indexing completed on 2024-04-28 04:41:45
0001 /* 0002 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef POLYGONSIMPLIFIER_H 0008 #define POLYGONSIMPLIFIER_H 0009 0010 class QPolygonF; 0011 0012 /** Methods to simplify polygon geometry. */ 0013 namespace PolygonSimplifier 0014 { 0015 /** Douglas Peucker algorithm. 0016 * @param distance Threshold in meters. 0017 * @see https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm 0018 */ 0019 QPolygonF douglasPeucker(const QPolygonF &poly, double distance); 0020 0021 /** Offset ("grow") a polygon by @p distance in meters. */ 0022 QPolygonF offset(const QPolygonF &poly, double distance); 0023 } 0024 0025 #endif // POLYGONSIMPLIFIER_H