45 mImage =
new QImage( 10, 10, QImage::Format_ARGB32_Premultiplied );
46 mImage->setDotsPerMeterX( 96 / 25.4 * 1000 );
47 mImage->setDotsPerMeterY( 96 / 25.4 * 1000 );
48 mPainter =
new QPainter( mImage );
90 for (
int i = 0; i < 4; ++i )
102 bool prependSymb =
false;
128 symb = symb + wrapchr;
133 symb = wrapchr + symb;
146 txt = txt.replace( wrapchr,
"\\P" );
150 txt.prepend(
"\\L" ).append(
"\\l" );
155 txt.prepend(
"\\O" ).append(
"\\o" );
160 txt.prepend(
"\\K" ).append(
"\\k" );
163 txt.prepend( QString(
"\\f%1|i%2|b%3;\\H%4;\\W0.75;" )
165 .arg( tmpLyr.
textFont.italic() ? 1 : 0 )
166 .arg( tmpLyr.
textFont.bold() ? 1 : 0 )
167 .arg( label->
getHeight() / ( 1 + txt.count(
"\\P" ) ) * 0.75 ) );
FeaturePart * getFeaturePart()
return the feature corresponding to this labelposition
A rectangle specified with double values.
QString leftDirectionSymbol
QgsDxfPalLabeling(QgsDxfExport *dxf, const QgsRectangle &bbox, double scale, QGis::UnitType mapUnits)
void setOutputDpi(int dpi)
Set DPI used for conversion between real world units (e.g. mm) and pixels.
QVector< QgsPoint > QgsPolyline
polyline is represented as a vector of points
void setRendererScale(double scale)
void setExtent(const QgsRectangle &extent)
PalGeometry * getUserGeometry()
bool reverseDirectionSymbol
The QgsMapSettings class contains configuration for rendering of the map.
virtual Q_DECL_DEPRECATED void init(QgsMapRenderer *mr) override
called when we're going to start with rendering
Perform transforms between map coordinates and device coordinates.
void setScaleFactor(double factor)
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
double getY(int i=0) const
get the down-left y coordinate
double getAlpha() const
get alpha
void setMapUnits(QGis::UnitType u)
Set units of map's geographical coordinates - used for scale calculation.
void drawLabel(pal::LabelPosition *label, QgsRenderContext &context, QgsPalLayerSettings &tmpLyr, DrawLabelType drawType, double dpiRatio=1.0) override
drawLabel
void setPainter(QPainter *p)
void writePolyline(const QgsPolyline &line, const QString &layer, const QString &lineStyleName, QColor color, double width=-1, bool unusedPolygonFlag=false)
draw dxf primitives
A class to represent a point.
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QString rightDirectionSymbol
Contains information about the context of a rendering operation.
void setOutputSize(const QSize &size)
Set the size of the resulting map image.
void setExtent(const QgsRectangle &rect)
Set coordinates of the rectangle which should be rendered.
void setMapToPixel(const QgsMapToPixel &mtp)
static double fromUnitToUnitFactor(QGis::UnitType fromUnit, QGis::UnitType toUnit)
Returns the conversion factor between the specified units.
LabelPositon is a candidate feature label position.
UnitType
Map units that qgis supports.
double getX(int i=0) const
get the down-left x coordinate
double width() const
Width of the rectangle.
double xMinimum() const
Get the x minimum value (left side of rectangle)
void writeMText(const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, QColor color)
Write mtext (MTEXT)
double height() const
Height of the rectangle.
void setCrsTransformEnabled(bool enabled)
sets whether to use projections for this layer set
DirectionSymbols placeDirectionSymbol