QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
Calculates label candidate costs considering different factors. More...
#include <costcalculator.h>
Static Public Member Functions | |
static void | addObstacleCostPenalty (pal::LabelPosition *lp, pal::FeaturePart *obstacle, Pal *pal) |
Increase candidate's cost according to its collision with passed feature. More... | |
static void | calculateCandidatePolygonCentroidDistanceCosts (pal::FeaturePart *feature, std::vector< std::unique_ptr< pal::LabelPosition > > &lPos) |
Updates the costs for polygon label candidates by considering the distance between the candidates and the polygon centroid (i.e. More... | |
static void | calculateCandidatePolygonRingDistanceCosts (std::vector< std::unique_ptr< pal::LabelPosition > > &lPos, double bbx[4], double bby[4]) |
Updates the costs for polygon label candidates by considering the distance between the candidates and the nearest polygon ring (i.e. More... | |
static double | calculatePolygonRingDistance (LabelPosition *candidate, double bbx[4], double bby[4]) |
Calculates the distance between a label candidate and the closest ring for a polygon feature. More... | |
static bool | candidateSortGrow (const std::unique_ptr< pal::LabelPosition > &c1, const std::unique_ptr< pal::LabelPosition > &c2) |
Sorts label candidates in ascending order of cost. More... | |
static void | finalizeCandidatesCosts (Feats *feat, double bbx[4], double bby[4]) |
Sort candidates by costs, skip the worse ones, evaluate polygon candidates. More... | |
Calculates label candidate costs considering different factors.
Definition at line 38 of file costcalculator.h.
|
static |
Increase candidate's cost according to its collision with passed feature.
Definition at line 33 of file costcalculator.cpp.
|
static |
Updates the costs for polygon label candidates by considering the distance between the candidates and the polygon centroid (i.e.
given labels at similar distances from polygon rings, prefer labels closer to the centroid).
Definition at line 143 of file costcalculator.cpp.
|
static |
Updates the costs for polygon label candidates by considering the distance between the candidates and the nearest polygon ring (i.e.
prefer labels closer to the pole of inaccessibility).
Definition at line 110 of file costcalculator.cpp.
|
static |
Calculates the distance between a label candidate and the closest ring for a polygon feature.
Definition at line 183 of file costcalculator.cpp.
|
static |
Sorts label candidates in ascending order of cost.
Definition at line 28 of file costcalculator.cpp.
|
static |
Sort candidates by costs, skip the worse ones, evaluate polygon candidates.
Definition at line 210 of file costcalculator.cpp.