| 
    QGIS API Documentation
    3.26.3-Buenos Aires (65e4edfdad)
    
   | 
 
 
 
 
Go to the documentation of this file.
   15 #ifndef COSTCALCULATOR_H 
   16 #define COSTCALCULATOR_H 
   66       static bool candidateSortGrow( 
const std::unique_ptr<pal::LabelPosition> &c1, 
const std::unique_ptr<pal::LabelPosition> &c2 );
 
  100       double mMinDistance = std::numeric_limits<double>::max();
 
  104 #endif // COSTCALCULATOR_H 
  
CandidatePolygonRingDistanceCalculator(LabelPosition *candidate)
Constructor for PolygonRingDistanceCalculator, for the specified label candidate.
 
LabelPosition is a candidate feature label position.
 
double minimumDistance() const
Returns the minimum distance between the candidate and all added rings.
 
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.
 
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.
 
Calculates label candidate costs considering different factors.
 
static void finalizeCandidatesCosts(Feats *feat, double bbx[4], double bby[4])
Sort candidates by costs, skip the worse ones, evaluate polygon candidates.
 
Main class to handle feature.
 
The underlying raw pal geometry class.
 
static void addObstacleCostPenalty(pal::LabelPosition *lp, pal::FeaturePart *obstacle, Pal *pal)
Increase candidate's cost according to its collision with passed feature.
 
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...
 
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...
 
For usage in problem solving algorithm.
 
Calculates distance from a label candidate to nearest polygon ring.
 
void addRing(const pal::PointSet *ring)
Adds a ring to the calculation, updating the minimumDistance() value if the rings is closer to the ca...