89 , mBuildDDBlocks( buildDDBlocks )
90 , mDDBlocksMaxNumberOfClasses( ddBlocksMaxNumberOfClasses )
114 QString splitLayerAttribute()
const;
145 int mLayerOutputAttributeIndex = -1;
150 bool mBuildDDBlocks = DEFAULT_DXF_DATA_DEFINED_BLOCKS;
155 int mDDBlocksMaxNumberOfClasses = -1;
160 QString mOverriddenName;
181 DeviceNotWritableError,
365 static int closestColorMatch( QRgb color );
373 QString layerName(
const QString &
id,
const QgsFeature &f )
const;
389 void writeGroup(
int code,
int i )
SIP_PYNAME( writeGroupInt );
397 void writeGroup(
int code,
long long i )
SIP_PYNAME( writeGroupLong );
405 void writeGroup(
int code,
double d )
SIP_PYNAME( writeGroupDouble );
412 void writeGroup(
int code,
const QString &s );
430 void writeGroup(
const QColor &color,
int exactMatch = 62,
int rgbCode = 420,
int transparencyCode = 440 );
436 void writeGroupCode(
int code );
442 void writeInt(
int i );
448 void writeDouble(
double d );
454 void writeString(
const QString &s );
462 int writeHandle(
int code = 5,
int handle = 0 );
473 void writePolyline(
const QgsPointSequence &line,
const QString &layer,
const QString &lineStyleName,
const QColor &color,
double width = -1 )
SIP_SKIP;
485 void writePolyline( const
QgsCurve &curve, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 )
SIP_SKIP;
495 void writePolygon( const
QgsRingSequence &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
506 void writePolygon( const
QgsCurvePolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
511 void writeLine( const
QgsPoint &pt1, const
QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 );
517 void writePoint( const QString &layer, const QColor &color, const
QgsPoint &pt )
SIP_PYNAME( writePointV2 );
523 void writeFilledCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius )
SIP_PYNAME( writeFillCircleV2 );
529 void writeCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius, const QString &lineStyleName,
double width )
SIP_PYNAME( writeCircleV2 );
536 const QString &layer,
550 void writeMText( const QString &layer, const QString &text, const
QgsPoint &pt,
double width,
double angle, const QColor &color );
559 static
double mapUnitScaleFactor(
double scale,
Qgis::RenderUnit symbolUnits,
Qgis::DistanceUnit mapUnits,
double mapUnitsPerPixel = 1.0 );
567 void clipValueToMapUnitScale(
double &value, const
QgsMapUnitScale &scale,
double pixelToMMFactor ) const;
570 static QString dxfLayerName( const QString &name );
573 static QString dxfEncoding( const QString &name );
576 static QStringList encodings();
593 Q_DECL_DEPRECATED
void registerDxfLayer( const QString &layerId,
QgsFeatureId fid, const QString &layer );
601 struct DataDefinedBlockInfo
610 QgsRectangle mExtent;
612 double mSymbologyScale = 1.0;
615 bool mLayerTitleAsName =
false;
617 QTextStream mTextStream;
619 int mSymbolLayerCounter = 0;
621 int mBlockCounter = 0;
623 QHash< const QgsSymbolLayer *, QString > mLineStyles;
624 QHash< const QgsSymbolLayer *, QString > mPointSymbolBlocks;
625 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockSizes;
626 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockAngles;
628 QHash< const QgsSymbolLayer *, QHash<uint, DataDefinedBlockInfo> > mDataDefinedBlockInfo;
631 void createDDBlockInfo();
632 void writeHeader(
const QString &codepage );
633 void prepareRenderers();
636 void writeEntities();
637 void writeEntitiesSymbolLevels( DxfLayerJob *job );
638 void stopRenderers();
644 void writePoint(
const QgsPoint &pt,
const QString &layer,
const QColor &color, QgsSymbolRenderContext &ctx,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol,
double angle );
645 void writeDefaultLinetypes();
646 void writeSymbolLayerLinetype(
const QgsSymbolLayer *symbolLayer );
647 void writeLinetype(
const QString &styleName,
const QVector<qreal> &pattern,
Qgis::RenderUnit u );
652 void writeText(
const QString &layer,
const QString &text, pal::LabelPosition *label,
const QgsPalLayerSettings &layerSettings,
const QgsExpressionContext &expressionContext );
663 void addGeometryGeneratorSymbolLayer( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer, QgsSymbolLayer *symbolLayer,
bool allSymbolLayers );
674 void addFeature( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol );
677 static QColor colorFromSymbolLayer(
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx );
678 QString lineStyleFromSymbolLayer(
const QgsSymbolLayer *symbolLayer );
681 static int color_distance( QRgb p1,
int index );
682 static QRgb createRgbEntry( qreal r, qreal g, qreal b );
685 QgsRenderContext renderContext()
const;
687 QList< QPair< QgsSymbolLayer *, QgsSymbol * > > symbolLayers( QgsRenderContext &context );
688 static int nLineTypes(
const QList< QPair< QgsSymbolLayer *, QgsSymbol *> > &symbolLayers );
689 static bool hasBlockBreakingDataDefinedProperties(
const QgsSymbolLayer *sl,
const QgsSymbol *symbol );
690 void writeSymbolTableBlockRef(
const QString &blockName );
691 void writeSymbolLayerBlock(
const QString &blockName,
const QgsMarkerSymbolLayer *ml, QgsSymbolRenderContext &ctx );
692 void writePointBlockReference(
693 const QgsPoint &pt,
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx,
const QString &layer,
double angle,
const QString &blockName,
double blockAngle,
double blockSize
695 static uint dataDefinedSymbolClassHash(
const QgsFeature &fet,
const QgsPropertyCollection &prop );
697 double dashSize()
const;
698 double dotSize()
const;
699 double dashSeparatorSize()
const;
700 double sizeToMapUnits(
double s )
const;
701 static QString lineNameFromPenStyle( Qt::PenStyle style );
702 bool layerIsScaleBasedVisible(
const QgsMapLayer *layer )
const;
704 QHash<QString, int> mBlockHandles;
705 QString mBlockHandle;
708 QMap< QString, QMap<QgsFeatureId, QString> > mDxfLayerNames;
709 QgsCoordinateReferenceSystem mCrs;
710 QgsMapSettings mMapSettings;
711 QList<QgsMapLayer *> mLayerList;
712 QHash<QString, int> mLayerNameAttribute;
713 QHash<QString, int> mLayerDDBlockMaxNumberOfClasses;
714 QHash<QString, QString> mLayerOverriddenName;
715 double mFactor = 1.0;
716 bool mForce2d =
false;
720 void appendCurve(
const QgsCurve &
c, QVector<QgsPoint> &points, QVector<double> &bulges );
721 void appendLineString(
const QgsLineString &ls, QVector<QgsPoint> &points, QVector<double> &bulges );
722 void appendCircularString(
const QgsCircularString &cs, QVector<QgsPoint> &points, QVector<double> &bulges );
723 void appendCompoundCurve(
const QgsCompoundCurve &cc, QVector<QgsPoint> &points, QVector<double> &bulges );
725 QgsRenderContext mRenderContext;
727 QList<DxfLayerJob *> mJobs;
728 std::unique_ptr<QgsLabelingEngine> mLabelingEngine;
730 QString mFeedbackMessage;