91 , mBuildDDBlocks( buildDDBlocks )
92 , mDDBlocksMaxNumberOfClasses( ddBlocksMaxNumberOfClasses )
116 QString splitLayerAttribute()
const;
147 int mLayerOutputAttributeIndex = -1;
152 bool mBuildDDBlocks = DEFAULT_DXF_DATA_DEFINED_BLOCKS;
157 int mDDBlocksMaxNumberOfClasses = -1;
162 QString mOverriddenName;
183 DeviceNotWritableError,
367 static int closestColorMatch( QRgb color );
375 QString layerName(
const QString &
id,
const QgsFeature &f )
const;
391 void writeGroup(
int code,
int i )
SIP_PYNAME( writeGroupInt );
399 void writeGroup(
int code,
long long i )
SIP_PYNAME( writeGroupLong );
407 void writeGroup(
int code,
double d )
SIP_PYNAME( writeGroupDouble );
414 void writeGroup(
int code,
const QString &s );
432 void writeGroup(
const QColor &color,
int exactMatch = 62,
int rgbCode = 420,
int transparencyCode = 440 );
438 void writeGroupCode(
int code );
444 void writeInt(
int i );
450 void writeDouble(
double d );
456 void writeString(
const QString &s );
464 int writeHandle(
int code = 5,
int handle = 0 );
475 void writePolyline(
const QgsPointSequence &line,
const QString &layer,
const QString &lineStyleName,
const QColor &color,
double width = -1 )
SIP_SKIP;
487 void writePolyline( const
QgsCurve &curve, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 )
SIP_SKIP;
497 void writePolygon( const
QgsRingSequence &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
508 void writePolygon( const
QgsCurvePolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color )
SIP_SKIP;
513 void writeLine( const
QgsPoint &pt1, const
QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color,
double width = -1 );
519 void writePoint( const QString &layer, const QColor &color, const
QgsPoint &pt )
SIP_PYNAME( writePointV2 );
525 void writeFilledCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius )
SIP_PYNAME( writeFillCircleV2 );
531 void writeCircle( const QString &layer, const QColor &color, const
QgsPoint &pt,
double radius, const QString &lineStyleName,
double width )
SIP_PYNAME( writeCircleV2 );
538 const QString &layer,
552 void writeMText( const QString &layer, const QString &text, const
QgsPoint &pt,
double width,
double angle, const QColor &color );
562 Q_DECL_DEPRECATED static
double mapUnitScaleFactor(
double scale,
Qgis::RenderUnit symbolUnits,
Qgis::DistanceUnit mapUnits,
double mapUnitsPerPixel = 1.0 )
SIP_DEPRECATED;
569 static
double mapUnitScaleFactor( const
QgsRenderContext &renderContext,
Qgis::RenderUnit symbolUnits );
577 void clipValueToMapUnitScale(
double &value, const
QgsMapUnitScale &scale,
double pixelToMMFactor ) const;
580 static QString dxfLayerName( const QString &name );
583 static QString dxfEncoding( const QString &name );
586 static QStringList encodings();
603 Q_DECL_DEPRECATED
void registerDxfLayer( const QString &layerId,
QgsFeatureId fid, const QString &layer );
611 struct DataDefinedBlockInfo
620 QgsRectangle mExtent;
622 double mSymbologyScale = 1.0;
625 bool mLayerTitleAsName =
false;
627 QTextStream mTextStream;
629 int mSymbolLayerCounter = 0;
631 int mBlockCounter = 0;
633 QHash< const QgsSymbolLayer *, QString > mLineStyles;
634 QHash< const QgsSymbolLayer *, QString > mPointSymbolBlocks;
635 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockSizes;
636 QHash< const QgsSymbolLayer *, double > mPointSymbolBlockAngles;
638 QHash< const QgsSymbolLayer *, QHash<uint, DataDefinedBlockInfo> > mDataDefinedBlockInfo;
641 void createDDBlockInfo();
642 void writeHeader(
const QString &codepage );
643 void prepareRenderers();
646 void writeEntities();
647 void writeEntitiesSymbolLevels( DxfLayerJob *job );
648 void stopRenderers();
654 void writePoint(
const QgsPoint &pt,
const QString &layer,
const QColor &color, QgsSymbolRenderContext &ctx,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol,
double angle );
655 void writeDefaultLinetypes();
656 void writeSymbolLayerLinetype(
const QgsSymbolLayer *symbolLayer );
657 void writeLinetype(
const QString &styleName,
const QVector<qreal> &pattern,
Qgis::RenderUnit u );
662 void writeText(
const QString &layer,
const QString &text, pal::LabelPosition *label,
const QgsPalLayerSettings &layerSettings,
const QgsExpressionContext &expressionContext );
673 void addGeometryGeneratorSymbolLayer( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer, QgsSymbolLayer *symbolLayer,
bool allSymbolLayers );
684 void addFeature( QgsSymbolRenderContext &context,
const QgsCoordinateTransform &ct,
const QString &layer,
const QgsSymbolLayer *symbolLayer,
const QgsSymbol *symbol );
687 static QColor colorFromSymbolLayer(
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx );
688 QString lineStyleFromSymbolLayer(
const QgsSymbolLayer *symbolLayer );
691 static int color_distance( QRgb p1,
int index );
692 static QRgb createRgbEntry( qreal r, qreal g, qreal b );
695 QgsRenderContext renderContext()
const;
697 QList< QPair< QgsSymbolLayer *, QgsSymbol * > > symbolLayers( QgsRenderContext &context );
698 static int nLineTypes(
const QList< QPair< QgsSymbolLayer *, QgsSymbol *> > &symbolLayers );
699 static bool hasBlockBreakingDataDefinedProperties(
const QgsSymbolLayer *sl,
const QgsSymbol *symbol );
701 static bool isSymbolLayerEnabled(
const QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
702 void writeSymbolTableBlockRef(
const QString &blockName );
703 void writeSymbolLayerBlock(
const QString &blockName,
const QgsMarkerSymbolLayer *ml, QgsSymbolRenderContext &ctx );
704 void writePointBlockReference(
705 const QgsPoint &pt,
const QgsSymbolLayer *symbolLayer, QgsSymbolRenderContext &ctx,
const QString &layer,
double angle,
const QString &blockName,
double blockAngle,
double blockSize
707 static uint dataDefinedSymbolClassHash(
const QgsFeature &fet,
const QgsPropertyCollection &prop,
const QgsExpressionContext &context );
709 double dashSize()
const;
710 double dotSize()
const;
711 double dashSeparatorSize()
const;
712 double sizeToMapUnits(
double s )
const;
713 static QString lineNameFromPenStyle( Qt::PenStyle style );
714 bool layerIsScaleBasedVisible(
const QgsMapLayer *layer )
const;
716 QHash<QString, int> mBlockHandles;
717 QString mBlockHandle;
720 QMap< QString, QMap<QgsFeatureId, QString> > mDxfLayerNames;
721 QgsCoordinateReferenceSystem mCrs;
722 QgsMapSettings mMapSettings;
723 QList<QgsMapLayer *> mLayerList;
724 QHash<QString, int> mLayerNameAttribute;
725 QHash<QString, int> mLayerDDBlockMaxNumberOfClasses;
726 QHash<QString, QString> mLayerOverriddenName;
727 double mFactor = 1.0;
728 bool mForce2d =
false;
732 void appendCurve(
const QgsCurve &
c, QVector<QgsPoint> &points, QVector<double> &bulges );
733 void appendLineString(
const QgsLineString &ls, QVector<QgsPoint> &points, QVector<double> &bulges );
734 void appendCircularString(
const QgsCircularString &cs, QVector<QgsPoint> &points, QVector<double> &bulges );
735 void appendCompoundCurve(
const QgsCompoundCurve &cc, QVector<QgsPoint> &points, QVector<double> &bulges );
737 QgsRenderContext mRenderContext;
739 QList<DxfLayerJob *> mJobs;
740 std::unique_ptr<QgsLabelingEngine> mLabelingEngine;
742 QString mFeedbackMessage;