92 , mBuildDDBlocks( buildDDBlocks )
93 , mDDBlocksMaxNumberOfClasses( ddBlocksMaxNumberOfClasses )
117 QString splitLayerAttribute()
const;
148 int mLayerOutputAttributeIndex = -1;
153 bool mBuildDDBlocks = DEFAULT_DXF_DATA_DEFINED_BLOCKS;
158 int mDDBlocksMaxNumberOfClasses = -1;
163 QString mOverriddenName;
184 DeviceNotWritableError,
369 static int closestColorMatch( QRgb color );
377 QString layerName(
const QString &
id,
const QgsFeature &f )
const;
393 void writeGroup(
int code,
int i )
SIP_PYNAME( writeGroupInt );
401 void writeGroup(
int code,
long long i )
SIP_PYNAME( writeGroupLong );
409 void writeGroup(
int code,
double d )
SIP_PYNAME( writeGroupDouble );
416 void writeGroup(
int code,
const QString &s );
434 void writeGroup(
const QColor &color,
int exactMatch = 62,
int rgbCode = 420,
int transparencyCode = 440 );
440 void writeGroupCode(
int code );
446 void writeInt(
int i );
452 void writeDouble(
double d );
458 void writeString(
const QString &s );
466 int writeHandle(
int code = 5,
int handle = 0 );
477 void writePolyline(
const QgsPointSequence &line,
const QString &layer,
const QString &lineStyleName,
const QColor &color,
double width = -1 )
SIP_SKIP;
489 void writePolyline( const
QgsCurve &curve, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 )
SIP_SKIP;
499 void writePolygon( const
QgsRingSequence &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
510 void writePolygon( const
QgsCurvePolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
515 void writeLine( const
QgsPoint &pt1, const
QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 );
521 void writePoint( const QString &layer, const QColor &color, const
QgsPoint &pt )
SIP_PYNAME( writePointV2 );
527 void writeFilledCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius )
SIP_PYNAME( writeFillCircleV2 );
533 void writeCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius, const QString &lineStyleName,
double width )
SIP_PYNAME( writeCircleV2 );
540 const QString &layer,
554 void writeMText( const QString &layer, const QString &text, const
QgsPoint &pt,
double width,
double angle, const QColor &color );
564 Q_DECL_DEPRECATED static
double mapUnitScaleFactor(
double scale,
Qgis::RenderUnit symbolUnits,
Qgis::DistanceUnit mapUnits,
double mapUnitsPerPixel = 1.0 )
SIP_DEPRECATED;
571 static
double mapUnitScaleFactor( const
QgsRenderContext &renderContext,
Qgis::RenderUnit symbolUnits );
579 void clipValueToMapUnitScale(
double &value, const
QgsMapUnitScale &scale,
double pixelToMMFactor ) const;
582 static QString dxfLayerName( const QString &name );
585 static QString dxfEncoding( const QString &name );
588 static QStringList encodings();
605 Q_DECL_DEPRECATED
void registerDxfLayer( const QString &layerId,
QgsFeatureId fid, const QString &layer );
613 struct DataDefinedBlockInfo
622 QgsRectangle mExtent;
624 double mSymbologyScale = 1.0;
627 bool mLayerTitleAsName =
false;
629 QIODevice *mDevice =
nullptr;
630 QTextCodec *mCodec =
nullptr;
632 int mSymbolLayerCounter = 0;
634 int mBlockCounter = 0;
636 QHash< const QgsSymbolLayer *, QString > mLineStyles;
637 QHash< const QgsSymbolLayer *, QString > mPointSymbolBlocks;
638 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockSizes;
639 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockAngles;
641 QHash< const QgsSymbolLayer *, QHash<uint, DataDefinedBlockInfo> > mDataDefinedBlockInfo;
644 void createDDBlockInfo();
645 void writeHeader(
const QString &codepage );
646 void prepareRenderers();
649 void writeEntities();
650 void writeEntitiesSymbolLevels( DxfLayerJob *job );
651 void stopRenderers();
657 void writePoint(
const QgsPoint &pt,
const QString &layer,
const QColor &color, QgsSymbolRenderContext &ctx,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol,
double angle );
658 void writeDefaultLinetypes();
659 void writeSymbolLayerLinetype(
const QgsSymbolLayer *symbolLayer );
660 void writeLinetype(
const QString &styleName,
const QVector<qreal> &pattern,
Qgis::RenderUnit u );
665 void writeText(
const QString &layer,
const QString &text, pal::LabelPosition *label,
const QgsPalLayerSettings &layerSettings,
const QgsExpressionContext &expressionContext );
676 void addGeometryGeneratorSymbolLayer( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer, QgsSymbolLayer *symbolLayer,
bool allSymbolLayers );
687 void addFeature( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol );
690 static QColor colorFromSymbolLayer(
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx );
691 QString lineStyleFromSymbolLayer(
const QgsSymbolLayer *symbolLayer );
694 static int color_distance( QRgb p1,
int index );
695 static QRgb createRgbEntry( qreal r, qreal g, qreal b );
698 QgsRenderContext renderContext()
const;
700 QList< QPair< QgsSymbolLayer *, QgsSymbol * > > symbolLayers( QgsRenderContext &context );
701 static int nLineTypes(
const QList< QPair< QgsSymbolLayer *, QgsSymbol *> > &symbolLayers );
702 static bool hasBlockBreakingDataDefinedProperties(
const QgsSymbolLayer *sl,
const QgsSymbol *symbol );
704 static bool isSymbolLayerEnabled(
const QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
705 void writeSymbolTableBlockRef(
const QString &blockName );
706 void writeSymbolLayerBlock(
const QString &blockName,
const QgsMarkerSymbolLayer *ml, QgsSymbolRenderContext &ctx );
707 void writePointBlockReference(
708 const QgsPoint &pt,
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx,
const QString &layer,
double angle,
const QString &blockName,
double blockAngle,
double blockSize
710 static uint dataDefinedSymbolClassHash(
const QgsFeature &fet,
const QgsPropertyCollection &prop,
const QgsExpressionContext &context );
712 double dashSize()
const;
713 double dotSize()
const;
714 double dashSeparatorSize()
const;
715 double sizeToMapUnits(
double s )
const;
716 static QString lineNameFromPenStyle( Qt::PenStyle style );
717 bool layerIsScaleBasedVisible(
const QgsMapLayer *layer )
const;
719 QHash<QString, int> mBlockHandles;
720 QString mBlockHandle;
723 QMap< QString, QMap<QgsFeatureId, QString> > mDxfLayerNames;
724 QgsCoordinateReferenceSystem mCrs;
725 QgsMapSettings mMapSettings;
726 QList<QgsMapLayer *> mLayerList;
727 QHash<QString, int> mLayerNameAttribute;
728 QHash<QString, int> mLayerDDBlockMaxNumberOfClasses;
729 QHash<QString, QString> mLayerOverriddenName;
730 double mFactor = 1.0;
731 bool mForce2d =
false;
735 void appendCurve(
const QgsCurve &
c, QVector<QgsPoint> &points, QVector<double> &bulges );
736 void appendLineString(
const QgsLineString &ls, QVector<QgsPoint> &points, QVector<double> &bulges );
737 void appendCircularString(
const QgsCircularString &cs, QVector<QgsPoint> &points, QVector<double> &bulges );
738 void appendCompoundCurve(
const QgsCompoundCurve &cc, QVector<QgsPoint> &points, QVector<double> &bulges );
740 QgsRenderContext mRenderContext;
742 QList<DxfLayerJob *> mJobs;
743 std::unique_ptr<QgsLabelingEngine> mLabelingEngine;
745 QString mFeedbackMessage;