1 #ifndef QGSPALGEOMETRY_H
2 #define QGSPALGEOMETRY_H
14 qreal ltrSpacing = 0.0, qreal wordSpacing = 0.0,
bool curvedLabeling =
false )
21 , mFontMetrics( NULL )
22 , mLetterSpacing( ltrSpacing )
23 , mWordSpacing( wordSpacing )
24 , mCurvedLabeling( curvedLabeling )
27 mDefinedFont = QFont();
40 const GEOSGeometry* getGeosGeometry()
44 void releaseGeosGeometry(
const GEOSGeometry* )
49 const char*
strId() {
return mStrId.data(); }
50 QString
text() {
return mText; }
57 mFontMetrics =
new QFontMetricsF( *fm );
60 if ( maxinangle < 20.0 )
62 if ( 60.0 < maxinangle )
64 if ( maxoutangle > -20.0 )
66 if ( -95.0 > maxoutangle )
77 mInfo =
new pal::LabelInfo( mText.count(), ptSize.
y() - ptZero.
y(), maxinangle, maxoutangle );
78 for (
int i = 0; i < mText.count(); i++ )
84 charWidth = fm->width( mText[i] );
85 if ( mCurvedLabeling )
87 wordSpaceFix = qreal( 0.0 );
88 if ( mText[i] == QString(
" " )[0] )
92 wordSpaceFix = ( nxt < mText.count() && mText[nxt] != QString(
" " )[0] ) ? mWordSpacing : qreal( 0.0 );
94 if ( fm->width( QString( mText[i] ) ) - fm->width( mText[i] ) - mLetterSpacing != qreal( 0.0 ) )
97 wordSpaceFix -= mWordSpacing;
99 charWidth = fm->width( QString( mText[i] ) ) + wordSpaceFix;
103 mInfo->char_info[i].width = ptSize.
x() - ptZero.
x();
108 const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant >&
dataDefinedValues()
const {
return mDataDefinedValues; }
157 #endif //QGSPALGEOMETRY_H