QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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 <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

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)
 
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)
 
double squareness (QgsLineString *ring, double lowerThreshold, double upperThreshold)
 

Enumeration Type Documentation

◆ Direction

enum Direction
strong
Enumerator
Up 
Right 
Down 
Left 
None 

Definition at line 50 of file qgsinternalgeometryengine.cpp.

Function Documentation

◆ calcMotion()

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

Definition at line 501 of file qgsinternalgeometryengine.cpp.

◆ convertGeometryToCurves()

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

Definition at line 1519 of file qgsinternalgeometryengine.cpp.

◆ densifyGeometry()

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

Definition at line 763 of file qgsinternalgeometryengine.cpp.

◆ doDensify()

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

Definition at line 672 of file qgsinternalgeometryengine.cpp.

◆ doOrthogonalize()

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

Definition at line 532 of file qgsinternalgeometryengine.cpp.

◆ dotProductWithinAngleTolerance()

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

Definition at line 439 of file qgsinternalgeometryengine.cpp.

◆ generateSegmentCurve()

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

Definition at line 1013 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 64 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 91 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 143 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 153 of file qgsinternalgeometryengine.cpp.

◆ lineToCurve()

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

Definition at line 1334 of file qgsinternalgeometryengine.cpp.

◆ matchesOrientation()

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

Definition at line 129 of file qgsinternalgeometryengine.cpp.

◆ normalizedDotProduct()

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

Definition at line 444 of file qgsinternalgeometryengine.cpp.

◆ orthogonalizeGeom()

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

Definition at line 604 of file qgsinternalgeometryengine.cpp.

◆ squareness()

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

Definition at line 457 of file qgsinternalgeometryengine.cpp.