QGIS API Documentation
2.8.2-Wien
|
#include <pal.h>
Public Member Functions | |
Pal () | |
Create an new pal instance. | |
~Pal () | |
delete an instance | |
Layer * | addLayer (const char *lyrName, double min_scale, double max_scale, Arrangement arrangement, Units label_unit, double defaultPriority, bool obstacle, bool active, bool toLabel, bool displayAll=false) |
add a new layer | |
Problem * | extractProblem (double scale, double bbox[4]) |
int | getDpi () |
get map resolution | |
Layer * | getLayer (const char *lyrName) |
Look for a layer. | |
QList< Layer * > * | getLayers () |
get all layers | |
int | getLineP () |
get maximum # candidates to generate for line features | |
Units | getMapUnit () |
get current map unit | |
int | getPointP () |
get # candidates to generate for point features | |
int | getPolyP () |
get maximum # candidates to generate for polygon features | |
SearchMethod | getSearch () |
get the search method in use | |
bool | getShowPartial () |
Get flag show partial label. | |
bool | isCancelled () |
Check whether the job has been cancelled. | |
std::list< LabelPosition * > * | labeller (double scale, double bbox[4], PalStat **stats, bool displayAll) |
the labeling machine Will extract all active layers | |
std::list< LabelPosition * > * | labeller (int nbLayers, char **layersName, double *layersFactor, double scale, double bbox[4], PalStat **stat, bool displayAll) |
the labeling machine Active layers are specifiend through layersName array | |
void | registerCancellationCallback (FnIsCancelled fnCancelled, void *context) |
Register a function that returns whether this job has been cancelled - PAL calls it during the computation. | |
void | removeLayer (Layer *layer) |
remove a layer | |
void | setDpi (int dpi) |
Set map resolution. | |
void | setLineP (int line_p) |
set maximum # candidates to generate for lines features Higher the value is, longer Pal::labeller will spend time | |
void | setMapUnit (Units map_unit) |
set map unit | |
void | setPointP (int point_p) |
set # candidates to generate for points features Higher the value is, longer Pal::labeller will spend time | |
void | setPolyP (int poly_p) |
set maximum # candidates to generate for polygon features Higher the value is, longer Pal::labeller will spend time | |
void | setSearch (SearchMethod method) |
Select the search method to use. | |
void | setShowPartial (bool show) |
Set flag show partial label. | |
std::list< LabelPosition * > * | solveProblem (Problem *prob, bool displayAll) |
Friends | |
class | FeaturePart |
class | Layer |
class | Problem |
Pal main class.
A pal object will contains layers and global information such as which search method will be used, the map resolution (dpi) ....
Layer * pal::Pal::addLayer | ( | const char * | lyrName, |
double | min_scale, | ||
double | max_scale, | ||
Arrangement | arrangement, | ||
Units | label_unit, | ||
double | defaultPriority, | ||
bool | obstacle, | ||
bool | active, | ||
bool | toLabel, | ||
bool | displayAll = false |
||
) |
add a new layer
lyrName | layer's name |
min_scale | bellow this scale: no labelling (-1 to disable) |
max_scale | above this scale: no labelling (-1 to disable) |
arrangement | Howto place candidates |
label_unit | Unit for labels sizes |
defaultPriority | layer's prioriry (0 is the best, 1 the worst) |
obstacle | 'true' will discourage other label to be placed above features of this layer |
active | is the layer is active (currently displayed) |
toLabel | the layer will be labeled only if toLablel is true |
displayAll | if true, all features will be labelled even though overlaps occur |
PalException::LayerExists |
Problem * pal::Pal::extractProblem | ( | double | scale, |
double | bbox[4] | ||
) |
int pal::Pal::getDpi | ( | ) |
Layer * pal::Pal::getLayer | ( | const char * | lyrName | ) |
QList< Layer * > * pal::Pal::getLayers | ( | ) |
int pal::Pal::getLineP | ( | ) |
int pal::Pal::getPointP | ( | ) |
int pal::Pal::getPolyP | ( | ) |
SearchMethod pal::Pal::getSearch | ( | ) |
bool pal::Pal::getShowPartial | ( | ) |
|
inline |
std::list< LabelPosition * > * pal::Pal::labeller | ( | double | scale, |
double | bbox[4], | ||
PalStat ** | stats, | ||
bool | displayAll | ||
) |
std::list< LabelPosition * > * pal::Pal::labeller | ( | int | nbLayers, |
char ** | layersName, | ||
double * | layersFactor, | ||
double | scale, | ||
double | bbox[4], | ||
PalStat ** | stat, | ||
bool | displayAll | ||
) |
the labeling machine Active layers are specifiend through layersName array
nbLayers | # layers |
layersName | names of layers to label |
layersFactor | layers priorities array |
scale | map scale is '1:scale' |
bbox | map extent |
stat | will be filled with labelling process statistics, can be NULL |
displayAll | if true, all feature will be labelled even though overlaps occur |
void pal::Pal::registerCancellationCallback | ( | Pal::FnIsCancelled | fnCancelled, |
void * | context | ||
) |
void pal::Pal::removeLayer | ( | Layer * | layer | ) |
void pal::Pal::setDpi | ( | int | dpi | ) |
void pal::Pal::setLineP | ( | int | line_p | ) |
set maximum # candidates to generate for lines features Higher the value is, longer Pal::labeller will spend time
line_p | maximum # candidates for a line |
void pal::Pal::setPointP | ( | int | point_p | ) |
set # candidates to generate for points features Higher the value is, longer Pal::labeller will spend time
point_p | # candidates for a point |
void pal::Pal::setPolyP | ( | int | poly_p | ) |
set maximum # candidates to generate for polygon features Higher the value is, longer Pal::labeller will spend time
poly_p | maximum # candidate for a polygon |
void pal::Pal::setSearch | ( | SearchMethod | method | ) |
Select the search method to use.
For interactive mapping using CHAIN is a good idea because it is the fastest. Other methods, ordered by speedness, are POPMUSIC_TABU, POPMUSIC_CHAIN and POPMUSIC_TABU_CHAIN, defined in pal::_searchMethod enumeration
method | the method to use |
void pal::Pal::setShowPartial | ( | bool | show | ) |
std::list< LabelPosition * > * pal::Pal::solveProblem | ( | Problem * | prob, |
bool | displayAll | ||
) |
|
friend |