File tree 5 files changed +130
-0
lines changed
5 files changed +130
-0
lines changed Original file line number Diff line number Diff line change 27
27
%Include qgsdatasourceuri.sip
28
28
%Include qgsdbfilterproxymodel.sip
29
29
%Include qgsdistancearea.sip
30
+ %Include qgsdxfexport.sip
30
31
%Include qgserror.sip
31
32
%Include qgsexpression.sip
32
33
%Include qgsfeature.sip
Original file line number Diff line number Diff line change
1
+ /***************************************************************************
2
+ qgsdxfexport.sip
3
+ ----------------
4
+ begin : September 2013
5
+ copyright : (C) 2013 by Marco Hugentobler
6
+ email : marco at sourcepole dot ch
7
+ ***************************************************************************/
8
+
9
+ /***************************************************************************
10
+ * *
11
+ * This program is free software; you can redistribute it and/or modify *
12
+ * it under the terms of the GNU General Public License as published by *
13
+ * the Free Software Foundation; either version 2 of the License, or *
14
+ * (at your option) any later version. *
15
+ * *
16
+ ***************************************************************************/
17
+
18
+ class QgsDxfExport
19
+ {
20
+ %TypeHeaderCode
21
+ #include <qgsdxfexport.h>
22
+ %End
23
+ public:
24
+ QgsDxfExport();
25
+ ~QgsDxfExport();
26
+
27
+ void addLayers( QList< QgsMapLayer* >& layers );
28
+ int writeToFile( QIODevice* d );
29
+ };
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ SET(QGIS_CORE_SRCS
62
62
qgsdbfilterproxymodel.cpp
63
63
qgsdiagramrendererv2.cpp
64
64
qgsdistancearea.cpp
65
+ qgsdxfexport.cpp
65
66
qgserror.cpp
66
67
qgsexpression.cpp
67
68
qgsexpression_texts.cpp
Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ qgsdxfexport.cpp
3
+ ----------------
4
+ begin : September 2013
5
+ copyright : (C) 2013 by Marco Hugentobler
6
+ email : marco at sourcepole dot ch
7
+ ***************************************************************************/
8
+
9
+ /* **************************************************************************
10
+ * *
11
+ * This program is free software; you can redistribute it and/or modify *
12
+ * it under the terms of the GNU General Public License as published by *
13
+ * the Free Software Foundation; either version 2 of the License, or *
14
+ * (at your option) any later version. *
15
+ * *
16
+ ***************************************************************************/
17
+
18
+ #include " qgsdxfexport.h"
19
+ #include < QIODevice>
20
+ #include < QTextStream>
21
+
22
+ QgsDxfExport::QgsDxfExport ()
23
+ {
24
+ }
25
+
26
+ QgsDxfExport::~QgsDxfExport ()
27
+ {
28
+
29
+ }
30
+
31
+ int QgsDxfExport::writeToFile ( QIODevice* d )
32
+ {
33
+ if ( !d )
34
+ {
35
+ return 1 ;
36
+ }
37
+
38
+ if ( !d->open ( QIODevice::WriteOnly ) )
39
+ {
40
+ return 2 ;
41
+ }
42
+
43
+ QTextStream outStream ( d );
44
+ writeHeader ( outStream );
45
+ return 0 ;
46
+ }
47
+
48
+ int QgsDxfExport::writeHeader ( QTextStream& stream )
49
+ {
50
+ stream << " Hello, dxf!" ;
51
+ return 0 ; // soon...
52
+ }
Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ qgsdxfexport.h
3
+ --------------
4
+ begin : September 2013
5
+ copyright : (C) 2013 by Marco Hugentobler
6
+ email : marco at sourcepole dot ch
7
+ ***************************************************************************/
8
+
9
+ /* **************************************************************************
10
+ * *
11
+ * This program is free software; you can redistribute it and/or modify *
12
+ * it under the terms of the GNU General Public License as published by *
13
+ * the Free Software Foundation; either version 2 of the License, or *
14
+ * (at your option) any later version. *
15
+ * *
16
+ ***************************************************************************/
17
+
18
+ #ifndef QGSDXFEXPORT_H
19
+ #define QGSDXFEXPORT_H
20
+
21
+ #include < QList>
22
+
23
+ class QgsMapLayer ;
24
+ class QIODevice ;
25
+ class QTextStream ;
26
+
27
+ class QgsDxfExport
28
+ {
29
+ public:
30
+ QgsDxfExport ();
31
+ ~QgsDxfExport ();
32
+
33
+ void addLayers ( QList< QgsMapLayer* >& layers ) { mLayers = layers; }
34
+ int writeToFile ( QIODevice* d ); // maybe add progress dialog? //other parameters (e.g. scale, dpi)?
35
+
36
+ private:
37
+
38
+ QList< QgsMapLayer* > mLayers ;
39
+
40
+ int writeHeader ( QTextStream& stream );
41
+ // collect styles
42
+ // writeEntities
43
+
44
+ // Option: export feature once / multiple export (considering symbol layers / symbol levels)
45
+ };
46
+
47
+ #endif // QGSDXFEXPORT_H
You can’t perform that action at this time.
0 commit comments