QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Enumerations | Functions
qgsinternalgeometryengine.cpp File Reference
#include "qgsinternalgeometryengine.h"
#include "qgslinestring.h"
#include "qgsmultipolygon.h"
#include "qgspolygon.h"
#include "qgsmulticurve.h"
#include "qgscircularstring.h"
#include "qgsgeometry.h"
#include "qgsgeometryutils.h"
#include "qgslinesegment.h"
#include "qgscircle.h"
#include "qgslogger.h"
#include "qgstessellator.h"
#include "qgsfeedback.h"
#include "qgsgeometryengine.h"
#include "qgsmultilinestring.h"
#include <QTransform>
#include <functional>
#include <memory>
#include <queue>
#include <random>
Include dependency graph for qgsinternalgeometryengine.cpp:

Go to the source code of this file.

Enumerations

enum class  Direction {
  Up , Right , Down , Left ,
  None
}
 

Functions

std::unique_ptr< QgsAbstractGeometryapplyDashPatternPrivate (const QgsAbstractGeometry *geom, const QVector< double > &pattern, Qgis::DashPatternLineEndingRule startRule, Qgis::DashPatternLineEndingRule endRule, Qgis::DashPatternSizeAdjustment adjustment, double patternOffset)
 
QgsVector calcMotion (const QgsPoint &a, const QgsPoint &b, const QgsPoint &c, double lowerThreshold, double upperThreshold)
 
std::unique_ptr< QgsAbstractGeometryconvertGeometryToCurves (const QgsAbstractGeometry *geom, double distanceTolerance, double angleTolerance)
 
std::unique_ptr< QgsMultiLineStringdashPatternAlongLine (const QgsLineString *line, const QVector< double > &pattern, Qgis::DashPatternLineEndingRule startRule, Qgis::DashPatternLineEndingRule endRule, Qgis::DashPatternSizeAdjustment adjustment, double patternOffset)
 
QgsAbstractGeometrydensifyGeometry (const QgsAbstractGeometry *geom, int extraNodesPerSegment=1, double distance=1)
 
QgsLineStringdoDensify (const QgsLineString *ring, int extraNodesPerSegment=-1, double distance=1)
 
QgsLineStringdoOrthogonalize (QgsLineString *ring, int iterations, double tolerance, double lowerThreshold, double upperThreshold)
 
bool dotProductWithinAngleTolerance (double dotProduct, double lowerThreshold, double upperThreshold)
 
QVector< QgsPointXYgenerateSegmentCurve (const QgsPoint &center1, const double radius1, const QgsPoint &center2, const double radius2)
 
Direction getEdgeDirection (const QgsPoint &p1, const QgsPoint &p2, double maxDev)
 Determines the direction of an edge from p1 to p2. More...
 
std::pair< bool, std::array< Direction, 4 > > getEdgeDirections (const QgsPolygon *g, double maxDev)
 Checks whether the polygon consists of four nearly axis-parallel sides. More...
 
bool isClockwise (std::array< Direction, 4 > dirs)
 Checks whether the 4 directions in dirs make up a clockwise rectangle. More...
 
bool isCounterClockwise (std::array< Direction, 4 > dirs)
 Checks whether the 4 directions in dirs make up a counter-clockwise rectangle. More...
 
std::unique_ptr< QgsCompoundCurvelineToCurve (const QgsLineString *lineString, double distanceTolerance, double pointSpacingAngleTolerance)
 
bool matchesOrientation (std::array< Direction, 4 > dirs, std::array< Direction, 4 > oriented)
 
double normalizedDotProduct (const QgsPoint &a, const QgsPoint &b, const QgsPoint &c)
 
QgsAbstractGeometryorthogonalizeGeom (const QgsAbstractGeometry *geom, int maxIterations, double tolerance, double lowerThreshold, double upperThreshold)
 
std::unique_ptr< QgsLineStringroundWavesAlongLine (const QgsLineString *line, double wavelength, const double amplitude, const bool strictWavelength)
 
std::unique_ptr< QgsAbstractGeometryroundWavesPrivate (const QgsAbstractGeometry *geom, double wavelength, double amplitude, bool strictWavelength)
 
std::unique_ptr< QgsLineStringroundWavesRandomizedAlongLine (const QgsLineString *line, const double minimumWavelength, const double maximumWavelength, const double minimumAmplitude, const double maximumAmplitude, std::uniform_real_distribution<> &uniformDist, std::mt19937 &mt)
 
std::unique_ptr< QgsAbstractGeometryroundWavesRandomizedPrivate (const QgsAbstractGeometry *geom, double minimumWavelength, double maximumWavelength, double minimumAmplitude, double maximumAmplitude, std::uniform_real_distribution<> &uniformDist, std::mt19937 &mt)
 
double squareness (QgsLineString *ring, double lowerThreshold, double upperThreshold)
 
std::unique_ptr< QgsLineStringsquareWavesAlongLine (const QgsLineString *line, double wavelength, const double amplitude, const bool strictWavelength)
 
std::unique_ptr< QgsAbstractGeometrysquareWavesPrivate (const QgsAbstractGeometry *geom, double wavelength, double amplitude, bool strictWavelength)
 
std::unique_ptr< QgsLineStringsquareWavesRandomizedAlongLine (const QgsLineString *line, const double minimumWavelength, const double maximumWavelength, const double minimumAmplitude, const double maximumAmplitude, std::uniform_real_distribution<> &uniformDist, std::mt19937 &mt)
 
std::unique_ptr< QgsAbstractGeometrysquareWavesRandomizedPrivate (const QgsAbstractGeometry *geom, double minimumWavelength, double maximumWavelength, double minimumAmplitude, double maximumAmplitude, std::uniform_real_distribution<> &uniformDist, std::mt19937 &mt)
 
std::unique_ptr< QgsLineStringtriangularWavesAlongLine (const QgsLineString *line, double wavelength, const double amplitude, const bool strictWavelength)
 
std::unique_ptr< QgsAbstractGeometrytriangularWavesPrivate (const QgsAbstractGeometry *geom, double wavelength, double amplitude, bool strictWavelength)
 
std::unique_ptr< QgsLineStringtriangularWavesRandomizedAlongLine (const QgsLineString *line, const double minimumWavelength, const double maximumWavelength, const double minimumAmplitude, const double maximumAmplitude, std::uniform_real_distribution<> &uniformDist, std::mt19937 &mt)
 
std::unique_ptr< QgsAbstractGeometrytriangularWavesRandomizedPrivate (const QgsAbstractGeometry *geom, double minimumWavelength, double maximumWavelength, double minimumAmplitude, double maximumAmplitude, std::uniform_real_distribution<> &uniformDist, std::mt19937 &mt)
 

Enumeration Type Documentation

◆ Direction

enum Direction
strong
Enumerator
Up 
Right 
Down 
Left 
None 

Definition at line 51 of file qgsinternalgeometryengine.cpp.

Function Documentation

◆ applyDashPatternPrivate()

std::unique_ptr< QgsAbstractGeometry > applyDashPatternPrivate ( const QgsAbstractGeometry geom,
const QVector< double > &  pattern,
Qgis::DashPatternLineEndingRule  startRule,
Qgis::DashPatternLineEndingRule  endRule,
Qgis::DashPatternSizeAdjustment  adjustment,
double  patternOffset 
)

Definition at line 2873 of file qgsinternalgeometryengine.cpp.

◆ calcMotion()

QgsVector calcMotion ( const QgsPoint a,
const QgsPoint b,
const QgsPoint c,
double  lowerThreshold,
double  upperThreshold 
)

Definition at line 502 of file qgsinternalgeometryengine.cpp.

◆ convertGeometryToCurves()

std::unique_ptr< QgsAbstractGeometry > convertGeometryToCurves ( const QgsAbstractGeometry geom,
double  distanceTolerance,
double  angleTolerance 
)

Definition at line 1520 of file qgsinternalgeometryengine.cpp.

◆ dashPatternAlongLine()

std::unique_ptr< QgsMultiLineString > dashPatternAlongLine ( const QgsLineString line,
const QVector< double > &  pattern,
Qgis::DashPatternLineEndingRule  startRule,
Qgis::DashPatternLineEndingRule  endRule,
Qgis::DashPatternSizeAdjustment  adjustment,
double  patternOffset 
)

Definition at line 2639 of file qgsinternalgeometryengine.cpp.

◆ densifyGeometry()

QgsAbstractGeometry* densifyGeometry ( const QgsAbstractGeometry geom,
int  extraNodesPerSegment = 1,
double  distance = 1 
)

Definition at line 764 of file qgsinternalgeometryengine.cpp.

◆ doDensify()

QgsLineString* doDensify ( const QgsLineString ring,
int  extraNodesPerSegment = -1,
double  distance = 1 
)

Definition at line 673 of file qgsinternalgeometryengine.cpp.

◆ doOrthogonalize()

QgsLineString* doOrthogonalize ( QgsLineString ring,
int  iterations,
double  tolerance,
double  lowerThreshold,
double  upperThreshold 
)

Definition at line 533 of file qgsinternalgeometryengine.cpp.

◆ dotProductWithinAngleTolerance()

bool dotProductWithinAngleTolerance ( double  dotProduct,
double  lowerThreshold,
double  upperThreshold 
)

Definition at line 440 of file qgsinternalgeometryengine.cpp.

◆ generateSegmentCurve()

QVector<QgsPointXY> generateSegmentCurve ( const QgsPoint center1,
const double  radius1,
const QgsPoint center2,
const double  radius2 
)

Definition at line 1014 of file qgsinternalgeometryengine.cpp.

◆ getEdgeDirection()

Direction getEdgeDirection ( const QgsPoint p1,
const QgsPoint p2,
double  maxDev 
)

Determines the direction of an edge from p1 to p2.

maxDev is the tangent of the maximum allowed edge deviation angle. If the edge deviates more than the allowed angle, Direction::None will be returned.

Definition at line 65 of file qgsinternalgeometryengine.cpp.

◆ getEdgeDirections()

std::pair<bool, std::array<Direction, 4> > getEdgeDirections ( const QgsPolygon g,
double  maxDev 
)

Checks whether the polygon consists of four nearly axis-parallel sides.

All consecutive edges having the same direction are considered to belong to the same side.

Definition at line 92 of file qgsinternalgeometryengine.cpp.

◆ isClockwise()

bool isClockwise ( std::array< Direction, 4 >  dirs)

Checks whether the 4 directions in dirs make up a clockwise rectangle.

Definition at line 144 of file qgsinternalgeometryengine.cpp.

◆ isCounterClockwise()

bool isCounterClockwise ( std::array< Direction, 4 >  dirs)

Checks whether the 4 directions in dirs make up a counter-clockwise rectangle.

Definition at line 154 of file qgsinternalgeometryengine.cpp.

◆ lineToCurve()

std::unique_ptr< QgsCompoundCurve > lineToCurve ( const QgsLineString lineString,
double  distanceTolerance,
double  pointSpacingAngleTolerance 
)

Definition at line 1335 of file qgsinternalgeometryengine.cpp.

◆ matchesOrientation()

bool matchesOrientation ( std::array< Direction, 4 >  dirs,
std::array< Direction, 4 >  oriented 
)

Definition at line 130 of file qgsinternalgeometryengine.cpp.

◆ normalizedDotProduct()

double normalizedDotProduct ( const QgsPoint a,
const QgsPoint b,
const QgsPoint c 
)

Definition at line 445 of file qgsinternalgeometryengine.cpp.

◆ orthogonalizeGeom()

QgsAbstractGeometry* orthogonalizeGeom ( const QgsAbstractGeometry geom,
int  maxIterations,
double  tolerance,
double  lowerThreshold,
double  upperThreshold 
)

Definition at line 605 of file qgsinternalgeometryengine.cpp.

◆ roundWavesAlongLine()

std::unique_ptr< QgsLineString > roundWavesAlongLine ( const QgsLineString line,
double  wavelength,
const double  amplitude,
const bool  strictWavelength 
)

Definition at line 2223 of file qgsinternalgeometryengine.cpp.

◆ roundWavesPrivate()

std::unique_ptr< QgsAbstractGeometry > roundWavesPrivate ( const QgsAbstractGeometry geom,
double  wavelength,
double  amplitude,
bool  strictWavelength 
)

Definition at line 2495 of file qgsinternalgeometryengine.cpp.

◆ roundWavesRandomizedAlongLine()

std::unique_ptr< QgsLineString > roundWavesRandomizedAlongLine ( const QgsLineString line,
const double  minimumWavelength,
const double  maximumWavelength,
const double  minimumAmplitude,
const double  maximumAmplitude,
std::uniform_real_distribution<> &  uniformDist,
std::mt19937 &  mt 
)

Definition at line 2349 of file qgsinternalgeometryengine.cpp.

◆ roundWavesRandomizedPrivate()

std::unique_ptr< QgsAbstractGeometry > roundWavesRandomizedPrivate ( const QgsAbstractGeometry geom,
double  minimumWavelength,
double  maximumWavelength,
double  minimumAmplitude,
double  maximumAmplitude,
std::uniform_real_distribution<> &  uniformDist,
std::mt19937 &  mt 
)

Definition at line 2526 of file qgsinternalgeometryengine.cpp.

◆ squareness()

double squareness ( QgsLineString ring,
double  lowerThreshold,
double  upperThreshold 
)

Definition at line 458 of file qgsinternalgeometryengine.cpp.

◆ squareWavesAlongLine()

std::unique_ptr< QgsLineString > squareWavesAlongLine ( const QgsLineString line,
double  wavelength,
const double  amplitude,
const bool  strictWavelength 
)

Definition at line 1927 of file qgsinternalgeometryengine.cpp.

◆ squareWavesPrivate()

std::unique_ptr< QgsAbstractGeometry > squareWavesPrivate ( const QgsAbstractGeometry geom,
double  wavelength,
double  amplitude,
bool  strictWavelength 
)

Definition at line 2079 of file qgsinternalgeometryengine.cpp.

◆ squareWavesRandomizedAlongLine()

std::unique_ptr< QgsLineString > squareWavesRandomizedAlongLine ( const QgsLineString line,
const double  minimumWavelength,
const double  maximumWavelength,
const double  minimumAmplitude,
const double  maximumAmplitude,
std::uniform_real_distribution<> &  uniformDist,
std::mt19937 &  mt 
)

Definition at line 2000 of file qgsinternalgeometryengine.cpp.

◆ squareWavesRandomizedPrivate()

std::unique_ptr< QgsAbstractGeometry > squareWavesRandomizedPrivate ( const QgsAbstractGeometry geom,
double  minimumWavelength,
double  maximumWavelength,
double  minimumAmplitude,
double  maximumAmplitude,
std::uniform_real_distribution<> &  uniformDist,
std::mt19937 &  mt 
)

Definition at line 2110 of file qgsinternalgeometryengine.cpp.

◆ triangularWavesAlongLine()

std::unique_ptr< QgsLineString > triangularWavesAlongLine ( const QgsLineString line,
double  wavelength,
const double  amplitude,
const bool  strictWavelength 
)

Definition at line 1649 of file qgsinternalgeometryengine.cpp.

◆ triangularWavesPrivate()

std::unique_ptr< QgsAbstractGeometry > triangularWavesPrivate ( const QgsAbstractGeometry geom,
double  wavelength,
double  amplitude,
bool  strictWavelength 
)

Definition at line 1783 of file qgsinternalgeometryengine.cpp.

◆ triangularWavesRandomizedAlongLine()

std::unique_ptr< QgsLineString > triangularWavesRandomizedAlongLine ( const QgsLineString line,
const double  minimumWavelength,
const double  maximumWavelength,
const double  minimumAmplitude,
const double  maximumAmplitude,
std::uniform_real_distribution<> &  uniformDist,
std::mt19937 &  mt 
)

Definition at line 1713 of file qgsinternalgeometryengine.cpp.

◆ triangularWavesRandomizedPrivate()

std::unique_ptr< QgsAbstractGeometry > triangularWavesRandomizedPrivate ( const QgsAbstractGeometry geom,
double  minimumWavelength,
double  maximumWavelength,
double  minimumAmplitude,
double  maximumAmplitude,
std::uniform_real_distribution<> &  uniformDist,
std::mt19937 &  mt 
)

Definition at line 1814 of file qgsinternalgeometryengine.cpp.