QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgscadutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscadutils.h
3  -------------------
4  begin : September 2017
5  copyright : (C) 2017 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSCADUTILS_H
18 #define QGSCADUTILS_H
19 
20 #include "qgis_core.h"
21 
22 #include "qgspointlocator.h"
23 
24 class QgsSnappingUtils;
25 
32 class CORE_EXPORT QgsCadUtils
33 {
34  public:
35 
38  {
39  AlignMapPointConstraint( bool locked = false, bool relative = false, double value = 0 )
40  : locked( locked )
41  , relative( relative )
42  , value( value )
43  {}
44 
46  bool locked;
48  bool relative;
50  double value;
51  };
52 
55  {
57  QgsSnappingUtils *snappingUtils = nullptr;
60 
71 
77  QList<QgsPointXY> cadPointList;
78 
83  SIP_SKIP void dump() const;
84  };
85 
88  {
90  bool valid;
91 
94 
100 
106 
109  };
110 
116  static QgsCadUtils::AlignMapPointOutput alignMapPoint( const QgsPointXY &originalMapPoint, const QgsCadUtils::AlignMapPointContext &ctx );
117 
118 };
119 
120 #endif // QGSCADUTILS_H
QgsCadUtils::AlignMapPointContext::xConstraint
QgsCadUtils::AlignMapPointConstraint xConstraint
Constraint for X coordinate.
Definition: qgscadutils.h:62
QgsCadUtils::AlignMapPointConstraint
Structure with details of one constraint.
Definition: qgscadutils.h:37
QgsCadUtils
Definition: qgscadutils.h:32
QgsCadUtils::AlignMapPointContext
Structure defining all constraints for alignMapPoint() method.
Definition: qgscadutils.h:54
QgsCadUtils::AlignMapPointContext::distanceConstraint
QgsCadUtils::AlignMapPointConstraint distanceConstraint
Constraint for distance.
Definition: qgscadutils.h:66
QgsCadUtils::AlignMapPointConstraint::locked
bool locked
Whether the constraint is active, i.e. should be considered.
Definition: qgscadutils.h:46
QgsCadUtils::AlignMapPointOutput::edgeMatch
QgsPointLocator::Match edgeMatch
Snapped segment - only valid if actually used for something.
Definition: qgscadutils.h:105
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsCadUtils::AlignMapPointOutput::finalMapPoint
QgsPointXY finalMapPoint
map point aligned according to the constraints
Definition: qgscadutils.h:93
QgsCadUtils::AlignMapPointContext::commonAngleConstraint
QgsCadUtils::AlignMapPointConstraint commonAngleConstraint
Constraint for soft lock to a common angle.
Definition: qgscadutils.h:70
QgsCadUtils::AlignMapPointContext::cadPointList
QList< QgsPointXY > cadPointList
List of recent CAD points in map coordinates.
Definition: qgscadutils.h:77
QgsCadUtils::AlignMapPointContext::mapUnitsPerPixel
double mapUnitsPerPixel
Map units/pixel ratio from map canvas. Needed for.
Definition: qgscadutils.h:59
QgsCadUtils::AlignMapPointConstraint::value
double value
Numeric value of the constraint (coordinate/distance in map units or angle in degrees)
Definition: qgscadutils.h:50
QgsSnappingUtils
Definition: qgssnappingutils.h:49
QgsCadUtils::AlignMapPointOutput::softLockCommonAngle
double softLockCommonAngle
Angle (in degrees) to which we have soft-locked ourselves (if not set it is -1)
Definition: qgscadutils.h:108
QgsCadUtils::AlignMapPointOutput
Structure returned from alignMapPoint() method.
Definition: qgscadutils.h:87
QgsPointLocator::Match
Definition: qgspointlocator.h:184
QgsPointXY
Definition: qgspointxy.h:43
QgsCadUtils::AlignMapPointOutput::valid
bool valid
Whether the combination of constraints is actually valid.
Definition: qgscadutils.h:90
QgsCadUtils::AlignMapPointContext::angleConstraint
QgsCadUtils::AlignMapPointConstraint angleConstraint
Constraint for angle.
Definition: qgscadutils.h:68
qgspointlocator.h
QgsCadUtils::AlignMapPointConstraint::AlignMapPointConstraint
AlignMapPointConstraint(bool locked=false, bool relative=false, double value=0)
Definition: qgscadutils.h:39
QgsCadUtils::AlignMapPointConstraint::relative
bool relative
Whether the value is relative to previous value.
Definition: qgscadutils.h:48
QgsCadUtils::AlignMapPointContext::yConstraint
QgsCadUtils::AlignMapPointConstraint yConstraint
Constraint for Y coordinate.
Definition: qgscadutils.h:64
QgsCadUtils::AlignMapPointOutput::snapMatch
QgsPointLocator::Match snapMatch
Snapped point - only valid if actually used for something.
Definition: qgscadutils.h:99