QGIS/python/core/auto_generated/labeling/qgslabelingenginesettings.sip.in
Nyall Dawson 1899f90a04 [needs-docs] Rework label engine "maximum line candidates" and "maximum polygon candidates"
settings and logic

The previous approach of a single fixed value which applied to ALL line and ALL polygon
features was... not ideal. It meant that all line features would be assigned the same
number of candidates, regardless of length. So a road of length 1 cm on the rendered
map would have an identical number of candidates as a 30cm road covering the length of the
whole map!! This resulted in both a lot of wasted calculations (generating a ridiculous
number of candidates for small lines at barely discernable distances from each other)
AND an insufficient number of candidates for lengthy features (resulting in worse label
placement for these features).

(The situation was similar, but even worse for polygons)

Now, the setting is reworked to "Number of line candidates per cm" and "number of
polygon candidates per cm2". This means that small features get much less candidates,
and large features get much more features! Both a win for map rendering speed in many
circumstances AND good cartography... now that's a nice Christmas gift for QGIS :)
2019-12-26 13:18:10 +10:00

222 lines
5.7 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/labeling/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,
// TODO QGIS 4.0: remove
RenderOutlineLabels,
DrawLabelRectOnly,
DrawCandidates,
DrawUnplacedLabels,
};
typedef QFlags<QgsLabelingEngineSettings::Flag> Flags;
enum Search
{
Chain,
Popmusic_Tabu,
Popmusic_Chain,
Popmusic_Tabu_Chain,
Falp
};
enum PlacementEngineVersion
{
PlacementEngineVersion1,
PlacementEngineVersion2,
};
QgsLabelingEngineSettings();
void clear();
%Docstring
Returns the configuration to the defaults
%End
void setFlags( Flags flags );
%Docstring
Sets flags of the labeling engine
%End
Flags flags() const;
%Docstring
Gets flags of the labeling engine
%End
bool testFlag( Flag f ) const;
%Docstring
Test whether a particular flag is enabled
%End
void setFlag( Flag f, bool enabled = true );
%Docstring
Sets whether a particual flag is enabled
%End
double maximumLineCandidatesPerCm() const;
%Docstring
Returns the maximum number of line label candidate positions per centimeter.
.. seealso:: :py:func:`setMaximumLineCandidatesPerCm`
.. versionadded:: 3.12
%End
void setMaximumLineCandidatesPerCm( double candidates );
%Docstring
Sets the maximum number of line label ``candidates`` per centimeter.
.. seealso:: :py:func:`maximumLineCandidatesPerCm`
.. versionadded:: 3.12
%End
double maximumPolygonCandidatesPerCmSquared() const;
%Docstring
Returns the maximum number of polygon label candidate positions per centimeter squared.
.. seealso:: :py:func:`setMaximumPolygonCandidatesPerCmSquared`
.. versionadded:: 3.12
%End
void setMaximumPolygonCandidatesPerCmSquared( double candidates );
%Docstring
Sets the maximum number of polygon label ``candidates`` per centimeter squared.
.. seealso:: :py:func:`maximumPolygonCandidatesPerCmSquared`
.. versionadded:: 3.12
%End
void numCandidatePositions( int &candPoint, int &candLine, int &candPolygon ) const /Deprecated/;
%Docstring
Gets number of candidate positions that will be generated for each label feature.
.. deprecated:: QGIS 3.12
use maximumPolygonCandidatesPerCmSquared() and
maximumLineCandidatesPerCm() instead.
%End
void setNumCandidatePositions( int candPoint, int candLine, int candPolygon ) /Deprecated/;
%Docstring
Sets the number of candidate positions that will be generated for each label feature.
.. deprecated:: QGIS 3.12
use setMaximumPolygonCandidatesPerCmSquared() and
setMaximumLineCandidatesPerCm() instead.
%End
void setSearchMethod( Search s ) /Deprecated/;
%Docstring
Used to set which search method to use for removal collisions between labels
.. deprecated:: QGIS 3.10
- Chain is always used.
%End
Search searchMethod() const /Deprecated/;
%Docstring
Which search method to use for removal collisions between labels
.. deprecated:: QGIS 3.10
- Chain is always used.
%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
QgsRenderContext::TextRenderFormat defaultTextRenderFormat() const;
%Docstring
Returns the default text rendering format for the labels.
.. seealso:: :py:func:`setDefaultTextRenderFormat`
.. versionadded:: 3.4.3
%End
void setDefaultTextRenderFormat( QgsRenderContext::TextRenderFormat format );
%Docstring
Sets the default text rendering ``format`` for the labels.
.. seealso:: :py:func:`defaultTextRenderFormat`
.. versionadded:: 3.4.3
%End
QColor unplacedLabelColor() const;
%Docstring
Returns the color to use when rendering unplaced labels.
.. seealso:: :py:func:`setUnplacedLabelColor`
.. versionadded:: 3.10
%End
void setUnplacedLabelColor( const QColor &color );
%Docstring
Sets the ``color`` to use when rendering unplaced labels.
.. seealso:: :py:func:`unplacedLabelColor`
.. versionadded:: 3.10
%End
PlacementEngineVersion placementVersion() const;
%Docstring
Returns the placement engine version, which dictates how the label placement problem is solved.
.. seealso:: :py:func:`setPlacementVersion`
.. versionadded:: 3.10.2
%End
void setPlacementVersion( PlacementEngineVersion version );
%Docstring
Sets the placement engine ``version``, which dictates how the label placement problem is solved.
.. seealso:: :py:func:`placementVersion`
.. versionadded:: 3.10.2
%End
};
QFlags<QgsLabelingEngineSettings::Flag> operator|(QgsLabelingEngineSettings::Flag f1, QFlags<QgsLabelingEngineSettings::Flag> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/labeling/qgslabelingenginesettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/