90 , mBuildDDBlocks( buildDDBlocks )
91 , mDDBlocksMaxNumberOfClasses( ddBlocksMaxNumberOfClasses )
115 QString splitLayerAttribute()
const;
146 int mLayerOutputAttributeIndex = -1;
151 bool mBuildDDBlocks = DEFAULT_DXF_DATA_DEFINED_BLOCKS;
156 int mDDBlocksMaxNumberOfClasses = -1;
161 QString mOverriddenName;
182 DeviceNotWritableError,
366 static int closestColorMatch( QRgb color );
374 QString layerName(
const QString &
id,
const QgsFeature &f )
const;
390 void writeGroup(
int code,
int i )
SIP_PYNAME( writeGroupInt );
398 void writeGroup(
int code,
long long i )
SIP_PYNAME( writeGroupLong );
406 void writeGroup(
int code,
double d )
SIP_PYNAME( writeGroupDouble );
413 void writeGroup(
int code,
const QString &s );
431 void writeGroup(
const QColor &color,
int exactMatch = 62,
int rgbCode = 420,
int transparencyCode = 440 );
437 void writeGroupCode(
int code );
443 void writeInt(
int i );
449 void writeDouble(
double d );
455 void writeString(
const QString &s );
463 int writeHandle(
int code = 5,
int handle = 0 );
474 void writePolyline(
const QgsPointSequence &line,
const QString &layer,
const QString &lineStyleName,
const QColor &color,
double width = -1 )
SIP_SKIP;
486 void writePolyline( const
QgsCurve &curve, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 )
SIP_SKIP;
496 void writePolygon( const
QgsRingSequence &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
507 void writePolygon( const
QgsCurvePolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
512 void writeLine( const
QgsPoint &pt1, const
QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 );
518 void writePoint( const QString &layer, const QColor &color, const
QgsPoint &pt )
SIP_PYNAME( writePointV2 );
524 void writeFilledCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius )
SIP_PYNAME( writeFillCircleV2 );
530 void writeCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius, const QString &lineStyleName,
double width )
SIP_PYNAME( writeCircleV2 );
542 void writeMText( const QString &layer, const QString &text, const
QgsPoint &pt,
double width,
double angle, const QColor &color );
551 static
double mapUnitScaleFactor(
double scale,
Qgis::RenderUnit symbolUnits,
Qgis::DistanceUnit mapUnits,
double mapUnitsPerPixel = 1.0 );
559 void clipValueToMapUnitScale(
double &value, const
QgsMapUnitScale &scale,
double pixelToMMFactor ) const;
562 static QString dxfLayerName( const QString &name );
565 static QString dxfEncoding( const QString &name );
568 static QStringList encodings();
585 Q_DECL_DEPRECATED
void registerDxfLayer( const QString &layerId,
QgsFeatureId fid, const QString &layer );
594 struct DataDefinedBlockInfo
603 QgsRectangle mExtent;
605 double mSymbologyScale = 1.0;
608 bool mLayerTitleAsName =
false;
610 QTextStream mTextStream;
612 int mSymbolLayerCounter = 0;
614 int mBlockCounter = 0;
616 QHash< const QgsSymbolLayer *, QString > mLineStyles;
617 QHash< const QgsSymbolLayer *, QString > mPointSymbolBlocks;
618 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockSizes;
619 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockAngles;
621 QHash< const QgsSymbolLayer *, QHash <uint, DataDefinedBlockInfo> > mDataDefinedBlockInfo;
624 void createDDBlockInfo();
625 void writeHeader(
const QString &codepage );
626 void prepareRenderers();
629 void writeEntities();
630 void writeEntitiesSymbolLevels( DxfLayerJob *job );
631 void stopRenderers();
637 void writePoint(
const QgsPoint &pt,
const QString &layer,
const QColor &color, QgsSymbolRenderContext &ctx,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol,
double angle );
638 void writeDefaultLinetypes();
639 void writeSymbolLayerLinetype(
const QgsSymbolLayer *symbolLayer );
640 void writeLinetype(
const QString &styleName,
const QVector<qreal> &pattern,
Qgis::RenderUnit u );
645 void writeText(
const QString &layer,
const QString &text, pal::LabelPosition *label,
const QgsPalLayerSettings &layerSettings,
const QgsExpressionContext &expressionContext );
656 void addGeometryGeneratorSymbolLayer( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer, QgsSymbolLayer *symbolLayer,
bool allSymbolLayers );
667 void addFeature( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol );
670 static QColor colorFromSymbolLayer(
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx );
671 QString lineStyleFromSymbolLayer(
const QgsSymbolLayer *symbolLayer );
674 static int color_distance( QRgb p1,
int index );
675 static QRgb createRgbEntry( qreal r, qreal g, qreal b );
678 QgsRenderContext renderContext()
const;
680 QList< QPair< QgsSymbolLayer *, QgsSymbol * > > symbolLayers( QgsRenderContext &context );
681 static int nLineTypes(
const QList< QPair< QgsSymbolLayer *, QgsSymbol *> > &symbolLayers );
682 static bool hasBlockBreakingDataDefinedProperties(
const QgsSymbolLayer *sl,
const QgsSymbol *symbol );
683 void writeSymbolTableBlockRef(
const QString &blockName );
684 void writeSymbolLayerBlock(
const QString &blockName,
const QgsMarkerSymbolLayer *ml, QgsSymbolRenderContext &ctx );
685 void writePointBlockReference(
const QgsPoint &pt,
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx,
const QString &layer,
double angle,
const QString &blockName,
double blockAngle,
double blockSize );
686 static uint dataDefinedSymbolClassHash(
const QgsFeature &fet,
const QgsPropertyCollection &prop );
688 double dashSize()
const;
689 double dotSize()
const;
690 double dashSeparatorSize()
const;
691 double sizeToMapUnits(
double s )
const;
692 static QString lineNameFromPenStyle( Qt::PenStyle style );
693 bool layerIsScaleBasedVisible(
const QgsMapLayer *layer )
const;
695 QHash<QString, int> mBlockHandles;
696 QString mBlockHandle;
699 QMap< QString, QMap<QgsFeatureId, QString> > mDxfLayerNames;
700 QgsCoordinateReferenceSystem mCrs;
701 QgsMapSettings mMapSettings;
702 QList<QgsMapLayer *> mLayerList;
703 QHash<QString, int> mLayerNameAttribute;
704 QHash<QString, int> mLayerDDBlockMaxNumberOfClasses;
705 QHash<QString, QString> mLayerOverriddenName;
706 double mFactor = 1.0;
707 bool mForce2d =
false;
711 void appendCurve(
const QgsCurve &
c, QVector<QgsPoint> &points, QVector<double> &bulges );
712 void appendLineString(
const QgsLineString &ls, QVector<QgsPoint> &points, QVector<double> &bulges );
713 void appendCircularString(
const QgsCircularString &cs, QVector<QgsPoint> &points, QVector<double> &bulges );
714 void appendCompoundCurve(
const QgsCompoundCurve &cc, QVector<QgsPoint> &points, QVector<double> &bulges );
716 QgsRenderContext mRenderContext;
718 QList<DxfLayerJob *> mJobs;
719 std::unique_ptr<QgsLabelingEngine> mLabelingEngine;
721 QString mFeedbackMessage;