|
QGIS API Documentation
2.14.11-Essen
|
#include <qgsdxfexport.h>
Public Types | |
| enum | SymbologyExport { NoSymbology = 0, FeatureSymbology, SymbolLayerSymbology } |
Public Member Functions | |
| QgsDxfExport () | |
| QgsDxfExport (const QgsDxfExport &dxfExport) | |
| ~QgsDxfExport () | |
| void | addLayers (const QList< QPair< QgsVectorLayer *, int > > &layers) |
| Add layers to export. More... | |
| void | drawLabel (QString layerId, QgsRenderContext &context, pal::LabelPosition *label, const QgsPalLayerSettings &settings) |
| Output the label. More... | |
| QgsRectangle | extent () const |
| Get extent of area to export. More... | |
| QString | layerName (const QString &id, const QgsFeature &f) const |
| Get layer name for feature. More... | |
| QString | layerName (QgsVectorLayer *vl) const |
| Get name for layer respecting the use layer title as layer name mode. More... | |
| bool | layerTitleAsName () |
| Retrieve wether layer title (where set) instead of name shall be use. More... | |
| QGis::UnitType | mapUnits () const |
| Retrieve map units. More... | |
| QgsDxfExport & | operator= (const QgsDxfExport &dxfExport) |
| void | registerDxfLayer (QString layerId, QgsFeatureId fid, QString layer) |
| Register name of layer for feature. More... | |
| void | setExtent (const QgsRectangle &r) |
| Set extent of area to export. More... | |
| void | setLayerTitleAsName (bool layerTitleAsName) |
| Enable use of title (where set) instead of layer name, when attribute index of corresponding layer index is -1. More... | |
| void | setMapUnits (QGis::UnitType u) |
| Set map units. More... | |
| void | setSymbologyExport (SymbologyExport e) |
| Set symbology export mode. More... | |
| void | setSymbologyScaleDenominator (double d) |
| Set reference scale for output. More... | |
| SymbologyExport | symbologyExport () const |
| Get symbology export mode. More... | |
| double | symbologyScaleDenominator () const |
| Retrieve reference scale for output. More... | |
| void | writeCircle (const QString &layer, const QColor &color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width) |
| Write circle (as polyline) More... | |
| void | writeDouble (double d) |
| Write a floating point value. More... | |
| void | writeFilledCircle (const QString &layer, const QColor &color, const QgsPoint &pt, double radius) |
| Write filled circle (as hatch) More... | |
| void | writeGroup (int code, int i) |
| Write a tuple of group code and integer value. More... | |
| void | writeGroup (int code, double d) |
| Write a group code with a floating point value. More... | |
| void | writeGroup (int code, const QString &s) |
| Write a group code with a string value. More... | |
| void | writeGroup (int code, const QgsPoint &p, double z=0.0, bool skipz=false) |
| Write a group code with a point. More... | |
| void | writeGroup (const QColor &color, int exactMatch=62, int rgbCode=420, int transparencyCode=440) |
| Write a group code with color value. More... | |
| void | writeGroupCode (int code) |
| Write a group code. More... | |
| int | writeHandle (int code=5, int handle=0) |
| Write a tuple of group code and a handle. More... | |
| void | writeInt (int i) |
| Write an integer value. More... | |
| void | writeLine (const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1) |
| Write line (as a polyline) More... | |
| void | writeMText (const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, const QColor &color) |
| Write mtext (MTEXT) More... | |
| void | writePoint (const QString &layer, const QColor &color, const QgsPoint &pt) |
| Write point. More... | |
| void | writePolygon (const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color) |
| Draw dxf filled polygon (HATCH) More... | |
| void | writePolyline (const QgsPolyline &line, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1) |
| Draw dxf primitives (LWPOLYLINE) More... | |
| Q_DECL_DEPRECATED void | writeSolid (const QString &layer, const QColor &color, const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, const QgsPoint &pt4) |
| Draw dxf filled polygon (SOLID) More... | |
| void | writeString (const QString &s) |
| Write a string value. More... | |
| void | writeText (const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, const QColor &color) |
| Write text (TEXT) More... | |
| int | writeToFile (QIODevice *d, const QString &codec) |
| Export to a dxf file in the given encoding. More... | |
Static Public Member Functions | |
| static int | closestColorMatch (QRgb color) |
| Get DXF palette index of nearest entry for given color. More... | |
| static QString | dxfEncoding (const QString &name) |
| return DXF encoding for Qt encoding More... | |
| static QString | dxfLayerName (const QString &name) |
| Return cleaned layer name for use in DXF. More... | |
| static QStringList | encodings () |
| return list of available DXF encodings More... | |
| static double | mapUnitScaleFactor (double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits) |
Definition at line 39 of file qgsdxfexport.h.
| Enumerator | |
|---|---|
| NoSymbology | |
| FeatureSymbology | |
| SymbolLayerSymbology | |
Definition at line 42 of file qgsdxfexport.h.
| QgsDxfExport::QgsDxfExport | ( | ) |
Definition at line 361 of file qgsdxfexport.cpp.
| QgsDxfExport::QgsDxfExport | ( | const QgsDxfExport & | dxfExport | ) |
Definition at line 372 of file qgsdxfexport.cpp.
| QgsDxfExport::~QgsDxfExport | ( | ) |
Definition at line 390 of file qgsdxfexport.cpp.
| void QgsDxfExport::addLayers | ( | const QList< QPair< QgsVectorLayer *, int > > & | layers | ) |
Add layers to export.
| layers | list of layers and corresponding attribute indexes that determine the layer name (-1 for original layer name or title) |
Definition at line 394 of file qgsdxfexport.cpp.
|
static |
Get DXF palette index of nearest entry for given color.
| color |
Definition at line 3833 of file qgsdxfexport.cpp.
| void QgsDxfExport::drawLabel | ( | QString | layerId, |
| QgsRenderContext & | context, | ||
| pal::LabelPosition * | label, | ||
| const QgsPalLayerSettings & | settings | ||
| ) |
Output the label.
| layerId | id of the layer |
| context | render context |
| label | position of label |
| settings | label settings |
Definition at line 4210 of file qgsdxfexport.cpp.
return DXF encoding for Qt encoding
Definition at line 4169 of file qgsdxfexport.cpp.
Return cleaned layer name for use in DXF.
Definition at line 4111 of file qgsdxfexport.cpp.
|
static |
return list of available DXF encodings
Definition at line 4189 of file qgsdxfexport.cpp.
|
inline |
Get extent of area to export.
Definition at line 119 of file qgsdxfexport.h.
| QString QgsDxfExport::layerName | ( | const QString & | id, |
| const QgsFeature & | f | ||
| ) | const |
Get layer name for feature.
| id | layer id of layer |
| f | feature of layer |
Definition at line 4155 of file qgsdxfexport.cpp.
| QString QgsDxfExport::layerName | ( | QgsVectorLayer * | vl | ) | const |
Get name for layer respecting the use layer title as layer name mode.
| vl | the vector layer |
Definition at line 4204 of file qgsdxfexport.cpp.
|
inline |
Retrieve wether layer title (where set) instead of name shall be use.
Definition at line 134 of file qgsdxfexport.h.
|
inline |
|
static |
Definition at line 3885 of file qgsdxfexport.cpp.
| QgsDxfExport & QgsDxfExport::operator= | ( | const QgsDxfExport & | dxfExport | ) |
Definition at line 377 of file qgsdxfexport.cpp.
| void QgsDxfExport::registerDxfLayer | ( | QString | layerId, |
| QgsFeatureId | fid, | ||
| QString | layer | ||
| ) |
Register name of layer for feature.
| layerId | id of layer |
| fid | id of feature |
| layer | dxf layer of feature |
Definition at line 4346 of file qgsdxfexport.cpp.
|
inline |
Set extent of area to export.
| r | area to export |
Definition at line 112 of file qgsdxfexport.h.
|
inline |
Enable use of title (where set) instead of layer name, when attribute index of corresponding layer index is -1.
| layerTitleAsName | flag |
Definition at line 127 of file qgsdxfexport.h.
|
inline |
|
inline |
|
inline |
Set reference scale for output.
| d | scale denominator |
Definition at line 73 of file qgsdxfexport.h.
|
inline |
Get symbology export mode.
Definition at line 106 of file qgsdxfexport.h.
|
inline |
Retrieve reference scale for output.
Definition at line 80 of file qgsdxfexport.h.
| void QgsDxfExport::writeCircle | ( | const QString & | layer, |
| const QColor & | color, | ||
| const QgsPoint & | pt, | ||
| double | radius, | ||
| const QString & | lineStyleName, | ||
| double | width | ||
| ) |
Write circle (as polyline)
Definition at line 3513 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeDouble | ( | double | d | ) |
Write a floating point value.
| d | floating point value |
Definition at line 463 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeFilledCircle | ( | const QString & | layer, |
| const QColor & | color, | ||
| const QgsPoint & | pt, | ||
| double | radius | ||
| ) |
Write filled circle (as hatch)
Definition at line 3473 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeGroup | ( | int | code, |
| int | i | ||
| ) |
Write a tuple of group code and integer value.
| code | group code |
| i | integer value |
Definition at line 399 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeGroup | ( | int | code, |
| double | d | ||
| ) |
Write a group code with a floating point value.
| code | group code |
| d | floating point value |
Definition at line 405 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeGroup | ( | int | code, |
| const QString & | s | ||
| ) |
Write a group code with a string value.
| code | group code |
| s | string value |
Definition at line 411 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeGroup | ( | int | code, |
| const QgsPoint & | p, | ||
| double | z = 0.0, |
||
| bool | skipz = false |
||
| ) |
Write a group code with a point.
| code | group code |
| p | point value |
| z | z value of the point (defaults to 0.0) |
| skipz | write point in 2d (defaults to false) |
Definition at line 417 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeGroup | ( | const QColor & | color, |
| int | exactMatch = 62, |
||
| int | rgbCode = 420, |
||
| int | transparencyCode = 440 |
||
| ) |
Write a group code with color value.
| color | color |
| exactMatch | group code to use if the color has an exact match in the dxf palette |
| rgbCode | group code to use if the color doesn't have an exact match or has a transparency component |
| transparencyCode | group code to use for transparency component |
Definition at line 425 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeGroupCode | ( | int | code | ) |
Write a group code.
| code | group code value |
Definition at line 453 of file qgsdxfexport.cpp.
| int QgsDxfExport::writeHandle | ( | int | code = 5, |
| int | handle = 0 |
||
| ) |
Write a tuple of group code and a handle.
| code | group code to use |
| handle | handle to use (0 generates a new handle) |
Definition at line 548 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeInt | ( | int | i | ) |
| void QgsDxfExport::writeLine | ( | const QgsPoint & | pt1, |
| const QgsPoint & | pt2, | ||
| const QString & | layer, | ||
| const QString & | lineStyleName, | ||
| const QColor & | color, | ||
| double | width = -1 |
||
| ) |
Write line (as a polyline)
Definition at line 3454 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeMText | ( | const QString & | layer, |
| const QString & | text, | ||
| const QgsPoint & | pt, | ||
| double | width, | ||
| double | angle, | ||
| const QColor & | color | ||
| ) |
Write mtext (MTEXT)
Definition at line 3550 of file qgsdxfexport.cpp.
Write point.
Definition at line 3462 of file qgsdxfexport.cpp.
| void QgsDxfExport::writePolygon | ( | const QgsPolygon & | polygon, |
| const QString & | layer, | ||
| const QString & | hatchPattern, | ||
| const QColor & | color | ||
| ) |
Draw dxf filled polygon (HATCH)
| polygon | polygon |
| layer | layer name to use |
| hatchPattern | hatchPattern to use |
| color | color to use |
Definition at line 3415 of file qgsdxfexport.cpp.
| void QgsDxfExport::writePolyline | ( | const QgsPolyline & | line, |
| const QString & | layer, | ||
| const QString & | lineStyleName, | ||
| const QColor & | color, | ||
| double | width = -1 |
||
| ) |
Draw dxf primitives (LWPOLYLINE)
| line | polyline |
| layer | layer name to use |
| lineStyleName | line type to use |
| color | color to use |
| width | line width to use |
Definition at line 3381 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeSolid | ( | const QString & | layer, |
| const QColor & | color, | ||
| const QgsPoint & | pt1, | ||
| const QgsPoint & | pt2, | ||
| const QgsPoint & | pt3, | ||
| const QgsPoint & | pt4 | ||
| ) |
Draw dxf filled polygon (SOLID)
| layer | layer name to use |
| color | color to use |
| pt1 | 1. point of solid |
| pt2 | 2. point of solid |
| pt3 | 3. point of solid |
| pt4 | 4. point of solid |
Definition at line 3587 of file qgsdxfexport.cpp.
| void QgsDxfExport::writeString | ( | const QString & | s | ) |
| void QgsDxfExport::writeText | ( | const QString & | layer, |
| const QString & | text, | ||
| const QgsPoint & | pt, | ||
| double | size, | ||
| double | angle, | ||
| const QColor & | color | ||
| ) |
Write text (TEXT)
Definition at line 3535 of file qgsdxfexport.cpp.
Export to a dxf file in the given encoding.
| d | device |
| codec | encoding |
Definition at line 476 of file qgsdxfexport.cpp.
1.8.13