Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEATURE]: Start implementation of native dxf export
- Loading branch information
Showing
5 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*************************************************************************** | ||
qgsdxfexport.sip | ||
---------------- | ||
begin : September 2013 | ||
copyright : (C) 2013 by Marco Hugentobler | ||
email : marco at sourcepole dot ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
class QgsDxfExport | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsdxfexport.h> | ||
%End | ||
public: | ||
QgsDxfExport(); | ||
~QgsDxfExport(); | ||
|
||
void addLayers( QList< QgsMapLayer* >& layers ); | ||
int writeToFile( QIODevice* d ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/*************************************************************************** | ||
qgsdxfexport.cpp | ||
---------------- | ||
begin : September 2013 | ||
copyright : (C) 2013 by Marco Hugentobler | ||
email : marco at sourcepole dot ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsdxfexport.h" | ||
#include <QIODevice> | ||
#include <QTextStream> | ||
|
||
QgsDxfExport::QgsDxfExport() | ||
{ | ||
} | ||
|
||
QgsDxfExport::~QgsDxfExport() | ||
{ | ||
|
||
} | ||
|
||
int QgsDxfExport::writeToFile( QIODevice* d ) | ||
{ | ||
if ( !d ) | ||
{ | ||
return 1; | ||
} | ||
|
||
if ( !d->open( QIODevice::WriteOnly ) ) | ||
{ | ||
return 2; | ||
} | ||
|
||
QTextStream outStream( d ); | ||
writeHeader( outStream ); | ||
return 0; | ||
} | ||
|
||
int QgsDxfExport::writeHeader( QTextStream& stream ) | ||
{ | ||
stream << "Hello, dxf!"; | ||
return 0; //soon... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgsdxfexport.h | ||
-------------- | ||
begin : September 2013 | ||
copyright : (C) 2013 by Marco Hugentobler | ||
email : marco at sourcepole dot ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSDXFEXPORT_H | ||
#define QGSDXFEXPORT_H | ||
|
||
#include <QList> | ||
|
||
class QgsMapLayer; | ||
class QIODevice; | ||
class QTextStream; | ||
|
||
class QgsDxfExport | ||
{ | ||
public: | ||
QgsDxfExport(); | ||
~QgsDxfExport(); | ||
|
||
void addLayers( QList< QgsMapLayer* >& layers ) { mLayers = layers; } | ||
int writeToFile( QIODevice* d ); //maybe add progress dialog? //other parameters (e.g. scale, dpi)? | ||
|
||
private: | ||
|
||
QList< QgsMapLayer* > mLayers; | ||
|
||
int writeHeader( QTextStream& stream ); | ||
//collect styles | ||
//writeEntities | ||
|
||
//Option: export feature once / multiple export (considering symbol layers / symbol levels) | ||
}; | ||
|
||
#endif // QGSDXFEXPORT_H |