18 #ifndef QGSDXFEXPORT_H 19 #define QGSDXFEXPORT_H 25 #include <QTextStream> 47 void addLayers(
const QList< QPair<QgsVectorLayer *, int > > &layers );
48 int writeToFile( QIODevice *d, QString codec );
63 static int closestColorMatch( QRgb pixel );
65 QString layerName(
const QString &
id,
const QgsFeature &f )
const;
68 void writeGroup(
int code,
int i );
70 void writeGroup(
int code,
double d );
71 void writeGroup(
int code,
const QString &s );
72 void writeGroupCode(
int code );
73 void writeInt(
int i );
74 void writeDouble(
double d );
75 void writeString(
const QString &s );
76 void writeGroup(
int code,
const QgsPoint &p,
double z = 0.0,
bool skipz =
false );
77 void writeGroup( QColor color,
int exactMatch = 62,
int rgbCode = 420,
int transparencyCode = 440 );
80 int writeHandle(
int code = 5,
int handle = 0 );
83 void writePolyline(
const QgsPolyline &line,
const QString &layer,
const QString &lineStyleName, QColor color,
84 double width = -1,
bool unusedPolygonFlag =
false );
87 void writePolygon(
const QgsPolygon &polygon,
const QString &layer,
const QString &hatchPattern, QColor color );
93 void writeLine(
const QgsPoint &pt1,
const QgsPoint &pt2,
const QString &layer,
const QString &lineStyleName, QColor color,
double width = -1 );
96 void writePoint(
const QString &layer, QColor color,
const QgsPoint &pt );
99 void writeFilledCircle(
const QString &layer, QColor color,
const QgsPoint &pt,
double radius );
102 void writeCircle(
const QString &layer, QColor color,
const QgsPoint &pt,
double radius,
const QString &lineStyleName,
double width );
105 void writeText(
const QString &layer,
const QString &text,
const QgsPoint &pt,
double size,
double angle, QColor color );
108 void writeMText(
const QString &layer,
const QString &text,
const QgsPoint &pt,
double width,
double angle, QColor color );
113 static QString dxfLayerName(
const QString &name );
116 static QString dxfEncoding(
const QString &name );
119 static QStringList encodings();
122 QList< QPair<QgsVectorLayer*, int> > mLayers;
127 double mSymbologyScaleDenominator;
131 QTextStream mTextStream;
133 static int mDxfColors[][3];
134 static const char *mDxfEncodings[][2];
136 int mSymbolLayerCounter;
140 QHash< const QgsSymbolLayerV2*, QString > mLineStyles;
141 QHash< const QgsSymbolLayerV2*, QString > mPointSymbolBlocks;
144 void writeHeader( QString codepage );
147 void writeEntities();
155 void writeVertex(
const QgsPoint &pt,
const QString &layer );
156 void writeDefaultLinetypes();
169 static int color_distance( QRgb p1,
int index );
170 static QRgb createRgbEntry( qreal r, qreal g, qreal b );
175 QList< QPair< QgsSymbolLayerV2 *, QgsSymbolV2 * > > symbolLayers();
176 static int nLineTypes(
const QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2*> > &symbolLayers );
178 double dashSize()
const;
179 double dotSize()
const;
180 double dashSeparatorSize()
const;
181 double sizeToMapUnits(
double s )
const;
182 static QString lineNameFromPenStyle( Qt::PenStyle style );
183 bool layerIsScaleBasedVisible(
const QgsMapLayer *layer )
const;
185 QHash<QString, int> mBlockHandles;
186 QString mBlockHandle;
189 #endif // QGSDXFEXPORT_H
A rectangle specified with double values.
Base class for all map layer types.
void setSymbologyScaleDenominator(double d)
SymbologyExport symbologyExport() const
QVector< QgsPoint > QgsPolyline
polyline is represented as a vector of points
QGis::UnitType mapUnits() const
void setSymbologyExport(SymbologyExport e)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsRectangle extent() const
QVector< QgsPolyline > QgsPolygon
polygon: first item of the list is outer ring, inner rings (if any) start from second item ...
A class to represent a point.
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
double symbologyScaleDenominator() const
Contains information about the context of a rendering operation.
void setExtent(const QgsRectangle &r)
void setMapUnits(QGis::UnitType u)
UnitType
Map units that qgis supports.
Represents a vector layer which manages a vector based data sets.