36 #include "qgis_core.h" 40 #include <QLinkedList> 50 template<
class DATATYPE,
class ELEMTYPE,
int NUMDIMS,
class ELEMTYPEREAL,
int TMAXNODES,
int TMINNODES>
class RTree;
97 const int size = mHashtable.size();
99 return std::min(
pal->point_p, 4 );
100 else if ( size > 500 )
101 return std::min(
pal->point_p, 6 );
102 else if ( size > 200 )
103 return std::min(
pal->point_p, 8 );
104 else if ( size > 100 )
105 return std::min(
pal->point_p, 12 );
118 const int size = mHashtable.size();
120 return std::min(
pal->line_p, 5 );
121 else if ( size > 500 )
122 return std::min(
pal->line_p, 10 );
123 else if ( size > 200 )
124 return std::min(
pal->line_p, 20 );
125 else if ( size > 100 )
126 return std::min(
pal->line_p, 40 );
139 const int size = mHashtable.size();
141 return std::min(
pal->poly_p, 5 );
142 else if ( size > 500 )
143 return std::min(
pal->poly_p, 15 );
144 else if ( size > 200 )
145 return std::min(
pal->poly_p, 20 );
146 else if ( size > 100 )
147 return std::min(
pal->poly_p, 25 );
158 QString
name()
const {
return mName; }
232 void setPriority(
double priority );
239 double priority()
const {
return mDefaultPriority; }
295 void joinConnectedFeatures();
305 void chopFeaturesAtRepeatDistance();
363 void addFeaturePart(
FeaturePart *fpart,
const QString &labelText = QString() );
bool labelLayer() const
Returns whether the layer will be labeled or not.
QgsAbstractLabelProvider * provider() const
Returns pointer to the associated provider.
bool centroidInside() const
Returns whether labels placed at the centroid of features within the layer are forced to be placed in...
QList< FeaturePart * > mObstacleParts
List of obstacle parts.
QHash< QgsFeatureId, int > mConnectedFeaturesIds
bool mergeConnectedLines() const
Returns whether connected lines will be merged before labeling.
QHash< QgsFeatureId, QgsLabelFeature * > mHashtable
Lookup table of label features (owned by the label feature provider that created them) ...
Arranges candidates following the curvature of a line feature. Applies to line layers only...
A set of features which influence the labeling process.
void setUpsidedownLabels(UpsideDownLabels ud)
Sets how upside down labels will be handled within the layer.
int maximumPointLabelCandidates() const
Returns the maximum number of point label candidates to generate for features in this layer...
UpsideDownLabels upsidedownLabels() const
Returns how upside down labels are handled within the layer.
void setObstacleType(QgsPalLayerSettings::ObstacleType obstacleType)
Sets the obstacle type, which controls how features within the layer act as obstacles for labels...
void setCentroidInside(bool forceInside)
Sets whether labels placed at the centroid of features within the layer are forced to be placed insid...
QgsPalLayerSettings::ObstacleType obstacleType() const
Returns the obstacle type, which controls how features within the layer act as obstacles for labels...
QHash< QString, QVector< FeaturePart * > > mConnectedHashtable
double priority() const
Returns the layer's priority, between 0 and 1.
RTree< FeaturePart *, double, 2, double, 8, 4 > * mFeatureIndex
void setArrangement(QgsPalLayerSettings::Placement arrangement)
Sets the layer's arrangement policy.
QgsPalLayerSettings::Placement arrangement() const
Returns the layer's arrangement policy.
int featureCount()
Returns the number of features in layer.
QgsPalLayerSettings::ObstacleType mObstacleType
Main class to handle feature.
The QgsAbstractLabelProvider class is an interface class.
Placement
Placement modes which determine how label candidates are generated for a feature. ...
void setActive(bool active)
Sets whether the layer is currently active.
void setLabelLayer(bool toLabel)
Sets whether the layer will be labeled.
QgsAbstractLabelProvider * mProvider
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
int maximumPolygonLabelCandidates() const
Returns the maximum number of polygon label candidates to generate for features in this layer...
int maximumLineLabelCandidates() const
Returns the maximum number of line label candidates to generate for features in this layer...
QLinkedList< FeaturePart * > mFeatureParts
List of feature parts.
RTree< FeaturePart *, double, 2, double, 8, 4 > * mObstacleIndex
QString name() const
Returns the layer's name.
bool active() const
Returns whether the layer is currently active.
LabelPosition is a candidate feature label position.
Representation of a labeling problem.
QgsPalLayerSettings::Placement mArrangement
Optional flags used for some placement methods.
Arranges candidates following the curvature of a polygon's boundary. Applies to polygon layers only...
bool isCurved() const
Returns true if the layer has curved labels.
UpsideDownLabels mUpsidedownLabels
void setMergeConnectedLines(bool merge)
Sets whether connected lines should be merged before labeling.
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels...