-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move labeling engine config to a new class + QgsPalLabeling cleanup
Another bit to make core library independent from QgsProject::instance(). Until now labeling engine configuration was taken from project singleton. Removed legacy methods from QgsPalLabeling - the class now does not have any more member variables/methods, it is just a bunch of helper functions. (PR #4384)
- Loading branch information
Showing
40 changed files
with
476 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgslabelingenginesettings.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsLabelingEngineSettings | ||
{ | ||
%Docstring | ||
Stores global configuration for labeling engine | ||
.. versionadded:: 3.0 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslabelingenginesettings.h" | ||
%End | ||
public: | ||
enum Flag | ||
{ | ||
UseAllLabels, | ||
UsePartialCandidates, | ||
RenderOutlineLabels, | ||
DrawLabelRectOnly, | ||
DrawCandidates, | ||
}; | ||
typedef QFlags<QgsLabelingEngineSettings::Flag> Flags; | ||
|
||
|
||
enum Search | ||
{ | ||
Chain, | ||
Popmusic_Tabu, | ||
Popmusic_Chain, | ||
Popmusic_Tabu_Chain, | ||
Falp | ||
}; | ||
|
||
QgsLabelingEngineSettings(); | ||
|
||
void clear(); | ||
%Docstring | ||
Return the configuration to the defaults | ||
%End | ||
|
||
void setFlags( Flags flags ); | ||
%Docstring | ||
Set flags of the labeling engine | ||
%End | ||
Flags flags() const; | ||
%Docstring | ||
Get flags of the labeling engine | ||
:rtype: Flags | ||
%End | ||
bool testFlag( Flag f ) const; | ||
%Docstring | ||
Test whether a particular flag is enabled | ||
:rtype: bool | ||
%End | ||
void setFlag( Flag f, bool enabled = true ); | ||
%Docstring | ||
Set whether a particual flag is enabled | ||
%End | ||
|
||
void numCandidatePositions( int &candPoint, int &candLine, int &candPolygon ) const; | ||
%Docstring | ||
Get number of candidate positions that will be generated for each label feature (default to 8) | ||
%End | ||
void setNumCandidatePositions( int candPoint, int candLine, int candPolygon ); | ||
%Docstring | ||
Set number of candidate positions that will be generated for each label feature | ||
%End | ||
|
||
void setSearchMethod( Search s ); | ||
%Docstring | ||
Set which search method to use for removal collisions between labels | ||
%End | ||
Search searchMethod() const; | ||
%Docstring | ||
Which search method to use for removal collisions between labels | ||
:rtype: Search | ||
%End | ||
|
||
void readSettingsFromProject( QgsProject *project ); | ||
%Docstring | ||
Read configuration of the labeling engine from a project | ||
%End | ||
void writeSettingsToProject( QgsProject *project ); | ||
%Docstring | ||
Write configuration of the labeling engine to a project | ||
%End | ||
|
||
}; | ||
|
||
QFlags<QgsLabelingEngineSettings::Flag> operator|(QgsLabelingEngineSettings::Flag f1, QFlags<QgsLabelingEngineSettings::Flag> f2); | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgslabelingenginesettings.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.