Skip to content

Commit b3bf4a1

Browse files
committed
dxf export:
* output 3D geometries * more adaptions to labeling changes
1 parent 2bd20de commit b3bf4a1

File tree

10 files changed

+544
-289
lines changed

10 files changed

+544
-289
lines changed

python/core/dxf/qgsdxfexport.sip

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,19 @@ class QgsDxfExport
165165
* @param z z value of the point (defaults to 0.0)
166166
* @param skipz write point in 2d (defaults to false)
167167
* @note available in python bindings as writeGroupPoint
168+
* @deprecated use QgsPointV2 version instead
168169
*/
169170
void writeGroup( int code, const QgsPoint &p, double z = 0.0, bool skipz = false ) /PyName=writeGroupPoint/;
170171

172+
/**
173+
* Write a group code with a point
174+
* @param code group code
175+
* @param p point value
176+
* @note available in python bindings as writeGroupPointV2
177+
* @note added in 2.15
178+
*/
179+
void writeGroup( int code, const QgsPointV2 &p ) /PyName=writeGroupPointV2/;
180+
171181
/**
172182
* Write a group code with color value
173183
* @param color color
@@ -215,19 +225,43 @@ class QgsDxfExport
215225
* @param line polyline
216226
* @param layer layer name to use
217227
* @param lineStyleName line type to use
218-
* @param color coolor to use
228+
* @param color color to use
219229
* @param width line width to use
220230
*/
221231
void writePolyline( const QgsPolyline &line, const QString &layer, const QString &lineStyleName, const QColor& color, double width = -1 );
222232

233+
/**
234+
* Draw dxf primitives (LWPOLYLINE)
235+
* @param line polyline
236+
* @param layer layer name to use
237+
* @param lineStyleName line type to use
238+
* @param color color to use
239+
* @param width line width to use
240+
* @note not available in Python bindings
241+
* @note added in 2.15
242+
*/
243+
// void writePolyline( const QgsPointSequenceV2 &line, const QString &layer, const QString &lineStyleName, const QColor& color, double width = -1 );
244+
223245
/**
224246
* Draw dxf filled polygon (HATCH)
225247
* @param polygon polygon
226248
* @param layer layer name to use
227249
* @param hatchPattern hatchPattern to use
228-
* @param color coolor to use
250+
* @param color color to use
251+
* @deprecated use version with QgsRingSequenceV2
229252
*/
230-
void writePolygon( const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor& color );
253+
void writePolygon( const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor& color ) /Deprecated/;
254+
255+
/**
256+
* Draw dxf filled polygon (HATCH)
257+
* @param polygon polygon
258+
* @param layer layer name to use
259+
* @param hatchPattern hatchPattern to use
260+
* @param color color to use
261+
* @note not available in Python bindings
262+
* @note added in 2.15
263+
*/
264+
// void writePolygon( const QgsRingSequenceV2 &polygon, const QString &layer, const QString &hatchPattern, const QColor& color );
231265

232266
/**
233267
* Draw dxf filled polygon (SOLID)
@@ -244,20 +278,54 @@ class QgsDxfExport
244278
//! Write line (as a polyline)
245279
void writeLine( const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor& color, double width = -1 );
246280

281+
//! Write line (as a polyline)
282+
//! @note added in 2.15
283+
void writeLine( const QgsPointV2 &pt1, const QgsPointV2 &pt2, const QString &layer, const QString &lineStyleName, const QColor& color, double width = -1 );
284+
247285
//! Write point
248-
void writePoint( const QString &layer, const QColor& color, const QgsPoint &pt );
286+
//! @deprecated use QgsPointV2 version
287+
void writePoint( const QString &layer, const QColor& color, const QgsPoint &pt ) /Deprecated/;
288+
289+
//! Write point
290+
//! @note available in Python bindings as writePointV2
291+
//! @note added in 2.15
292+
void writePoint( const QString &layer, const QColor& color, const QgsPointV2 &pt ) /PyName=writePointV2/;
293+
294+
//! Write filled circle (as hatch)
295+
//! @deprecated use QgsPointV2 version
296+
void writeFilledCircle( const QString &layer, const QColor& color, const QgsPoint &pt, double radius ) /Deprecated/;
249297

250298
//! Write filled circle (as hatch)
251-
void writeFilledCircle( const QString &layer, const QColor& color, const QgsPoint &pt, double radius );
299+
//! @note available in Python bindings as writePointV2
300+
//! @note added in 2.15
301+
void writeFilledCircle( const QString &layer, const QColor& color, const QgsPointV2 &pt, double radius ) /PyName=writeFillCircleV2/;
302+
303+
//! Write circle (as polyline)
304+
//! @deprecated use QgsPointV2 version
305+
void writeCircle( const QString &layer, const QColor& color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width ) /Deprecated/;
252306

253307
//! Write circle (as polyline)
254-
void writeCircle( const QString &layer, const QColor& color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width );
308+
//! @note available in Python bindings as writeCircleV2
309+
//! @note added in 2.15
310+
void writeCircle( const QString &layer, const QColor& color, const QgsPointV2 &pt, double radius, const QString &lineStyleName, double width ) /PyName=writeCircleV2/;
255311

256312
//! Write text (TEXT)
257-
void writeText( const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, const QColor& color );
313+
//! @deprecated use QgsPointV2 version
314+
void writeText( const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, const QColor& color ) /Deprecated/;
315+
316+
//! Write text (TEXT)
317+
//! @note available in Python bindings as writeTextV2
318+
//! @note added in 2.15
319+
void writeText( const QString &layer, const QString &text, const QgsPointV2 &pt, double size, double angle, const QColor& color ) /PyName=writeTextV2/;
320+
321+
//! Write mtext (MTEXT)
322+
//! @deprecated use QgsPointV2 version
323+
void writeMText( const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, const QColor& color ) /Deprecated/;
258324

259325
//! Write mtext (MTEXT)
260-
void writeMText( const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, const QColor& color );
326+
//! @note available in Python bindings as writeMTextV2
327+
//! @note added in 2.15
328+
void writeMText( const QString &layer, const QString &text, const QgsPointV2 &pt, double width, double angle, const QColor& color );
261329

262330
static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits );
263331

src/app/qgsdxfexportdialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
438438
connect( mSelectAllButton, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
439439
connect( mUnSelectAllButton, SIGNAL( clicked() ), this, SLOT( unSelectAll() ) );
440440

441+
mFileLineEdit->setFocus();
442+
441443
//last dxf symbology mode
442444
QSettings s;
443445
mSymbologyModeComboBox->setCurrentIndex( QgsProject::instance()->readEntry( "dxf", "/lastDxfSymbologyMode", s.value( "qgis/lastDxfSymbologyMode", "2" ).toString() ).toInt() );

0 commit comments

Comments
 (0)