/
qgsgeometryfixes.h
105 lines (90 loc) · 3.09 KB
/
qgsgeometryfixes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/***************************************************************************
qgsgeometryfixes.h
-------------------
begin : Aug 23, 2018
copyright : (C) 2018 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSGEOMETRYFIXES_H
#define QGSGEOMETRYFIXES_H
#include "qgsgeometry.h"
/**
* \ingroup core
*
* The QgsGeometryFixes class contains options to automatically adjust geometries to
* constraints on a layer.
*
* \since QGIS 3.4
*/
class CORE_EXPORT QgsGeometryFixes
{
public:
/**
* Create a new QgsGeometryFixes object.
*/
QgsGeometryFixes() = default;
/**
* Automatically remove duplicate nodes on all geometries which are edited on this layer.
*
* \since QGIS 3.4
*/
bool removeDuplicateNodes() const;
/**
* Automatically remove duplicate nodes on all geometries which are edited on this layer.
*
* \since QGIS 3.4
*/
void setRemoveDuplicateNodes( bool value );
/**
* The precision in which geometries on this layer should be saved.
* Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid).
* Set to 0.0 to disable.
*
* \since QGIS 3.4
*/
double geometryPrecision() const;
/**
* The precision in which geometries on this layer should be saved.
* Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid).
* Set to 0.0 to disable.
*
* \since QGIS 3.4
*/
void setGeometryPrecision( double value );
/**
* Determines if at least one fix is enabled.
*
* \since QGIS 3.4
*/
bool isActive() const;
/**
* Apply any fixes configured on this class to \a geometry.
*
* \since QGIS 3.4
*/
void apply( QgsGeometry &geometry ) const;
private:
/**
* Automatically remove duplicate nodes on all geometries which are edited on this layer.
*
* \since QGIS 3.4
*/
bool mRemoveDuplicateNodes = false;
/**
* The precision in which geometries on this layer should be saved.
* Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid).
* Set to 0.0 to disable.
*
* \since QGIS 3.4
*/
double mGeometryPrecision = 0.0;
};
#endif // QGSGEOMETRYFIXES_H