QGIS API Documentation
3.10.0-A Coruña (6c816b4204)
|
Representation of a labeling problem. More...
#include <problem.h>
Public Member Functions | |
Problem () | |
Problem (const Problem &other)=delete | |
Problem cannot be copied. More... | |
~Problem () | |
void | addCandidatePosition (LabelPosition *position) |
Adds a candidate label position to the problem. More... | |
void | chain_search () |
Test with very-large scale neighborhood. More... | |
LabelPosition * | getFeatureCandidate (int fi, int ci) |
int | getFeatureCandidateCount (int i) |
int | getNumFeatures () |
QList< LabelPosition * > | getSolution (bool returnInactive, QList< LabelPosition *> *unlabeled=nullptr) |
Solves the labeling problem, selecting the best candidate locations for all labels and returns a list of these calculated label positions. More... | |
PalStat * | getStats () |
void | init_sol_empty () |
Basic initial solution : every feature to -1. More... | |
void | init_sol_falp () |
Problem & | operator= (const Problem &other)=delete |
Problem cannot be copied. More... | |
QList< LabelPosition * > * | positionsWithNoCandidates () |
Returns a reference to the list of label positions which correspond to features with no candidates. More... | |
void | reduce () |
Static Public Member Functions | |
static bool | compareLabelArea (pal::LabelPosition *l1, pal::LabelPosition *l2) |
Friends | |
class | Pal |
Representation of a labeling problem.
Problem::Problem | ( | ) |
Definition at line 58 of file problem.cpp.
Problem::~Problem | ( | ) |
Definition at line 68 of file problem.cpp.
|
inline |
void Problem::chain_search | ( | ) |
Test with very-large scale neighborhood.
Definition at line 725 of file problem.cpp.
|
static |
Definition at line 819 of file problem.cpp.
|
inline |
|
inline |
QList< LabelPosition * > Problem::getSolution | ( | bool | returnInactive, |
QList< LabelPosition *> * | unlabeled = nullptr |
||
) |
Solves the labeling problem, selecting the best candidate locations for all labels and returns a list of these calculated label positions.
If returnInactive is true, then the best positions for ALL labels will be returned, regardless of whether these labels overlap other labels.
If the optional unlabeled list is specified, it will be filled with a list of all feature labels which could not be placed in the returned solution (e.g. due to overlaps or other constraints).
Ownership of the returned labels is not transferred - it resides with the pal object.
Definition at line 824 of file problem.cpp.
PalStat * Problem::getStats | ( | ) |
Definition at line 860 of file problem.cpp.
void Problem::init_sol_empty | ( | ) |
Basic initial solution : every feature to -1.
Definition at line 157 of file problem.cpp.
void Problem::init_sol_falp | ( | ) |
Definition at line 240 of file problem.cpp.
|
inline |
void Problem::reduce | ( | ) |
Definition at line 91 of file problem.cpp.