Skip to content

Commit d5c6b97

Browse files
committedDec 14, 2016
[FEATURE] DWG import into geopackage using libdxfrw
1 parent 58933aa commit d5c6b97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+90249
-1
lines changed
 

‎src/app/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ADD_SUBDIRECTORY(dwg/libdxfrw)
2+
13
SET(QGIS_APP_SRCS
24
qgisapp.cpp
35
qgisappinterface.cpp
@@ -166,6 +168,9 @@ SET(QGIS_APP_SRCS
166168
openstreetmap/qgsosmimportdialog.cpp
167169
openstreetmap/qgsosmexportdialog.cpp
168170

171+
dwg/qgsdwgimportdialog.cpp
172+
dwg/qgsdwgimporter.cpp
173+
169174
pluginmanager/qgspluginmanager.cpp
170175
pluginmanager/qgspluginmanager_texts.cpp
171176
pluginmanager/qgsapppluginmanagerinterface.cpp
@@ -338,6 +343,8 @@ SET (QGIS_APP_MOC_HDRS
338343
openstreetmap/qgsosmimportdialog.h
339344
openstreetmap/qgsosmexportdialog.h
340345

346+
dwg/qgsdwgimportdialog.h
347+
341348
pluginmanager/qgspluginmanager.h
342349
pluginmanager/qgsapppluginmanagerinterface.h
343350
pluginmanager/qgspluginsortfilterproxymodel.h
@@ -559,6 +566,8 @@ INCLUDE_DIRECTORIES(
559566
../python
560567
gps
561568
openstreetmap
569+
dwg
570+
dwg/libdxfrw
562571
)
563572
INCLUDE_DIRECTORIES(SYSTEM
564573
${SPATIALITE_INCLUDE_DIR}
@@ -592,7 +601,8 @@ ENDIF (ANDROID)
592601
REMOVE_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
593602
ADD_DEFINITIONS("\"-DAPP_EXPORT=${DLLEXPORT}\"")
594603

595-
# Putting IMAGE_RCC_SRCS into qgis_app lib is cousing problems when the lib is loaded (by plugin for example) in test unit (qgis_composerpicturetest).
604+
# Putting IMAGE_RCC_SRCS into qgis_app lib is causing problems when the lib is
605+
# loaded (by plugin for example) in test unit (qgis_composerpicturetest).
596606
ADD_LIBRARY(qgis_app SHARED ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${QGIS_APP_HDRS} ${QGIS_APP_MOC_HDRS})
597607

598608
TARGET_LINK_LIBRARIES(qgis_app
@@ -607,6 +617,7 @@ TARGET_LINK_LIBRARIES(qgis_app
607617
qgis_core
608618
qgis_gui
609619
qgis_analysis
620+
libdxfrw
610621
)
611622

612623
IF (NOT ANDROID)

‎src/app/dwg/libdxfrw/CMakeLists.txt

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
INCLUDE_DIRECTORIES(
2+
${CMAKE_SOURCE_DIR}/src/core
3+
${QT_INCLUDE_DIR}
4+
)
5+
6+
ADD_LIBRARY(libdxfrw STATIC
7+
drw_classes.cpp
8+
drw_entities.cpp
9+
drw_header.cpp
10+
drw_objects.cpp
11+
libdwgr.cpp
12+
libdxfrw.cpp
13+
intern/drw_dbg.cpp
14+
intern/drw_textcodec.cpp
15+
intern/dwgbuffer.cpp
16+
intern/dwgreader.cpp
17+
intern/dwgreader15.cpp
18+
intern/dwgreader18.cpp
19+
intern/dwgreader21.cpp
20+
intern/dwgreader24.cpp
21+
intern/dwgreader27.cpp
22+
intern/dwgutil.cpp
23+
intern/dxfreader.cpp
24+
intern/dxfwriter.cpp
25+
intern/rscodec.cpp
26+
)
27+
SET_PROPERTY(TARGET libdxfrw PROPERTY POSITION_INDEPENDENT_CODE ON)
28+
29+
IF(FALSE)
30+
IF(DOXYGEN_FOUND)
31+
ADD_CUSTOM_TARGET(doxygen-dxfrw ALL
32+
COMMAND ${DOXYGEN_EXECUTABLE} libdxfrw.dox
33+
drw_base.h
34+
drw_classes.cpp
35+
drw_classes.h
36+
drw_entities.cpp
37+
drw_entities.h
38+
drw_header.cpp
39+
drw_header.h
40+
drw_interface.h
41+
drw_objects.cpp
42+
drw_objects.h
43+
libdwgr.cpp
44+
libdwgr.h
45+
libdxfrw.cpp
46+
libdxfrw.h
47+
intern/drw_cptable932.h
48+
intern/drw_cptable936.h
49+
intern/drw_cptable949.h
50+
intern/drw_cptable950.h
51+
intern/drw_cptables.h
52+
intern/drw_dbg.cpp
53+
intern/drw_dbg.h
54+
intern/drw_textcodec.cpp
55+
intern/drw_textcodec.h
56+
intern/dwgbuffer.cpp
57+
intern/dwgbuffer.h
58+
intern/dwgreader.cpp
59+
intern/dwgreader.h
60+
intern/dwgreader15.cpp
61+
intern/dwgreader15.h
62+
intern/dwgreader18.cpp
63+
intern/dwgreader18.h
64+
intern/dwgreader21.cpp
65+
intern/dwgreader21.h
66+
intern/dwgreader24.cpp
67+
intern/dwgreader24.h
68+
intern/dwgreader27.cpp
69+
intern/dwgreader27.h
70+
intern/dwgutil.cpp
71+
intern/dwgutil.h
72+
intern/dxfreader.cpp
73+
intern/dxfreader.h
74+
intern/dxfwriter.cpp
75+
intern/dxfwriter.h
76+
intern/rscodec.cpp
77+
intern/rscodec.h
78+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
79+
DEPENDS libdxfrw
80+
COMMENT "Generating libdxfrw documentation" VERBATIM)
81+
ENDIF(DOXYGEN_FOUND)
82+
ENDIF(FALSE)

2 commit comments

Comments
 (2)

PedroVenancio commented on Dec 22, 2016

@PedroVenancio
Contributor

Hi @jef-n

It works great on Windows, but it does not work here on Linux. It's not ready for Linux yet?

Another great work! Thank you very much!

PedroVenancio commented on Dec 22, 2016

@PedroVenancio
Contributor

On Linux, when I try to import the DWG, it says:
"Could not open layer list" and then
"Drawing import failed ()".

Also, when I try to open (on Linux) a geopackage created with DWG/DXF Import on Windows, it says:
"Invalid Data Source: /home/pedro/.../xxx.gpkg is not a valid or recognized data source".

Please sign in to comment.