QGIS API Documentation  3.9.0-Master (224899f119)
Public Member Functions | Static Public Member Functions | Friends | List of all members
pal::Problem Class Reference

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...
 
LabelPositiongetFeatureCandidate (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...
 
PalStatgetStats ()
 
void init_sol_empty ()
 Basic initial solution : every feature to -1. More...
 
void init_sol_falp ()
 
Problemoperator= (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
 

Detailed Description

Representation of a labeling problem.

Note
not available in Python bindings

Definition at line 73 of file problem.h.

Constructor & Destructor Documentation

◆ Problem() [1/2]

Problem::Problem ( )

Definition at line 58 of file problem.cpp.

◆ ~Problem()

Problem::~Problem ( )

Definition at line 68 of file problem.cpp.

◆ Problem() [2/2]

pal::Problem::Problem ( const Problem other)
delete

Problem cannot be copied.

Member Function Documentation

◆ addCandidatePosition()

void pal::Problem::addCandidatePosition ( LabelPosition position)
inline

Adds a candidate label position to the problem.

Parameters
positionlabel candidate position. Ownership is transferred to Problem.
Since
QGIS 2.12

Definition at line 95 of file problem.h.

◆ chain_search()

void Problem::chain_search ( )

Test with very-large scale neighborhood.

Definition at line 725 of file problem.cpp.

◆ compareLabelArea()

bool Problem::compareLabelArea ( pal::LabelPosition l1,
pal::LabelPosition l2 
)
static

Definition at line 819 of file problem.cpp.

◆ getFeatureCandidate()

LabelPosition* pal::Problem::getFeatureCandidate ( int  fi,
int  ci 
)
inline

Definition at line 103 of file problem.h.

◆ getFeatureCandidateCount()

int pal::Problem::getFeatureCandidateCount ( int  i)
inline

Definition at line 101 of file problem.h.

◆ getNumFeatures()

int pal::Problem::getNumFeatures ( )
inline

Definition at line 99 of file problem.h.

◆ getSolution()

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.

◆ getStats()

PalStat * Problem::getStats ( )

Definition at line 860 of file problem.cpp.

◆ init_sol_empty()

void Problem::init_sol_empty ( )

Basic initial solution : every feature to -1.

Definition at line 157 of file problem.cpp.

◆ init_sol_falp()

void Problem::init_sol_falp ( )

Definition at line 240 of file problem.cpp.

◆ operator=()

Problem& pal::Problem::operator= ( const Problem other)
delete

Problem cannot be copied.

◆ positionsWithNoCandidates()

QList<LabelPosition *>* pal::Problem::positionsWithNoCandidates ( )
inline

Returns a reference to the list of label positions which correspond to features with no candidates.

Ownership of positions added to this list is transferred to the problem.

Definition at line 147 of file problem.h.

◆ reduce()

void Problem::reduce ( )

Definition at line 91 of file problem.cpp.

Friends And Related Function Documentation

◆ Pal

friend class Pal
friend

Definition at line 76 of file problem.h.


The documentation for this class was generated from the following files: