Skip to content
Permalink
Browse files

[FEATURE] DWG import into geopackage using libdxfrw

  • Loading branch information
jef-n committed Dec 14, 2016
1 parent 58933aa commit d5c6b977eb9d58484525953c753b164957b51a16
Showing with 90,249 additions and 1 deletion.
  1. +12 −1 src/app/CMakeLists.txt
  2. +82 −0 src/app/dwg/libdxfrw/CMakeLists.txt
  3. +542 −0 src/app/dwg/libdxfrw/drw_base.h
  4. +139 −0 src/app/dwg/libdxfrw/drw_classes.cpp
  5. +65 −0 src/app/dwg/libdxfrw/drw_classes.h
  6. +3,876 −0 src/app/dwg/libdxfrw/drw_entities.cpp
  7. +1,681 −0 src/app/dwg/libdxfrw/drw_entities.h
  8. +2,761 −0 src/app/dwg/libdxfrw/drw_header.cpp
  9. +115 −0 src/app/dwg/libdxfrw/drw_header.h
  10. +178 −0 src/app/dwg/libdxfrw/drw_interface.h
  11. +1,478 −0 src/app/dwg/libdxfrw/drw_objects.cpp
  12. +779 −0 src/app/dwg/libdxfrw/drw_objects.h
  13. +7,815 −0 src/app/dwg/libdxfrw/intern/drw_cptable932.h
  14. +21,946 −0 src/app/dwg/libdxfrw/intern/drw_cptable936.h
  15. +17,202 −0 src/app/dwg/libdxfrw/intern/drw_cptable949.h
  16. +13,657 −0 src/app/dwg/libdxfrw/intern/drw_cptable950.h
  17. +1,340 −0 src/app/dwg/libdxfrw/intern/drw_cptables.h
  18. +207 −0 src/app/dwg/libdxfrw/intern/drw_dbg.cpp
  19. +61 −0 src/app/dwg/libdxfrw/intern/drw_dbg.h
  20. +675 −0 src/app/dwg/libdxfrw/intern/drw_textcodec.cpp
  21. +100 −0 src/app/dwg/libdxfrw/intern/drw_textcodec.h
  22. +1,060 −0 src/app/dwg/libdxfrw/intern/dwgbuffer.cpp
  23. +161 −0 src/app/dwg/libdxfrw/intern/dwgbuffer.h
  24. +1,584 −0 src/app/dwg/libdxfrw/intern/dwgreader.cpp
  25. +223 −0 src/app/dwg/libdxfrw/intern/dwgreader.h
  26. +231 −0 src/app/dwg/libdxfrw/intern/dwgreader15.cpp
  27. +50 −0 src/app/dwg/libdxfrw/intern/dwgreader15.h
  28. +825 −0 src/app/dwg/libdxfrw/intern/dwgreader18.cpp
  29. +109 −0 src/app/dwg/libdxfrw/intern/dwgreader18.h
  30. +657 −0 src/app/dwg/libdxfrw/intern/dwgreader21.cpp
  31. +70 −0 src/app/dwg/libdxfrw/intern/dwgreader21.h
  32. +46 −0 src/app/dwg/libdxfrw/intern/dwgreader24.cpp
  33. +60 −0 src/app/dwg/libdxfrw/intern/dwgreader24.h
  34. +47 −0 src/app/dwg/libdxfrw/intern/dwgreader27.cpp
  35. +59 −0 src/app/dwg/libdxfrw/intern/dwgreader27.h
  36. +794 −0 src/app/dwg/libdxfrw/intern/dwgutil.cpp
  37. +104 −0 src/app/dwg/libdxfrw/intern/dwgutil.h
  38. +312 −0 src/app/dwg/libdxfrw/intern/dxfreader.cpp
  39. +112 −0 src/app/dwg/libdxfrw/intern/dxfreader.h
  40. +286 −0 src/app/dwg/libdxfrw/intern/dxfwriter.cpp
  41. +72 −0 src/app/dwg/libdxfrw/intern/dxfwriter.h
  42. +464 −0 src/app/dwg/libdxfrw/intern/rscodec.cpp
  43. +70 −0 src/app/dwg/libdxfrw/intern/rscodec.h
  44. +377 −0 src/app/dwg/libdxfrw/libdwgr.cpp
  45. +52 −0 src/app/dwg/libdxfrw/libdwgr.h
  46. +3,401 −0 src/app/dwg/libdxfrw/libdxfrw.cpp
  47. +288 −0 src/app/dwg/libdxfrw/libdxfrw.dox
  48. +148 −0 src/app/dwg/libdxfrw/libdxfrw.h
  49. +495 −0 src/app/dwg/qgsdwgimportdialog.cpp
  50. +52 −0 src/app/dwg/qgsdwgimportdialog.h
  51. +2,832 −0 src/app/dwg/qgsdwgimporter.cpp
  52. +199 −0 src/app/dwg/qgsdwgimporter.h
  53. +8 −0 src/app/qgisapp.cpp
  54. +2 −0 src/app/qgisapp.h
  55. +1 −0 src/core/geometry/qgsgeos.cpp
  56. +6 −0 src/ui/qgisapp.ui
  57. +281 −0 src/ui/qgsdwgimportbase.ui
  58. BIN tests/testdata/dwg/entities.dwg
@@ -1,3 +1,5 @@
ADD_SUBDIRECTORY(dwg/libdxfrw)

SET(QGIS_APP_SRCS
qgisapp.cpp
qgisappinterface.cpp
@@ -166,6 +168,9 @@ SET(QGIS_APP_SRCS
openstreetmap/qgsosmimportdialog.cpp
openstreetmap/qgsosmexportdialog.cpp

dwg/qgsdwgimportdialog.cpp
dwg/qgsdwgimporter.cpp

pluginmanager/qgspluginmanager.cpp
pluginmanager/qgspluginmanager_texts.cpp
pluginmanager/qgsapppluginmanagerinterface.cpp
@@ -338,6 +343,8 @@ SET (QGIS_APP_MOC_HDRS
openstreetmap/qgsosmimportdialog.h
openstreetmap/qgsosmexportdialog.h

dwg/qgsdwgimportdialog.h

pluginmanager/qgspluginmanager.h
pluginmanager/qgsapppluginmanagerinterface.h
pluginmanager/qgspluginsortfilterproxymodel.h
@@ -559,6 +566,8 @@ INCLUDE_DIRECTORIES(
../python
gps
openstreetmap
dwg
dwg/libdxfrw
)
INCLUDE_DIRECTORIES(SYSTEM
${SPATIALITE_INCLUDE_DIR}
@@ -592,7 +601,8 @@ ENDIF (ANDROID)
REMOVE_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DAPP_EXPORT=${DLLEXPORT}\"")

# 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).
# Putting IMAGE_RCC_SRCS into qgis_app lib is causing problems when the lib is
# loaded (by plugin for example) in test unit (qgis_composerpicturetest).
ADD_LIBRARY(qgis_app SHARED ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${QGIS_APP_HDRS} ${QGIS_APP_MOC_HDRS})

TARGET_LINK_LIBRARIES(qgis_app
@@ -607,6 +617,7 @@ TARGET_LINK_LIBRARIES(qgis_app
qgis_core
qgis_gui
qgis_analysis
libdxfrw
)

IF (NOT ANDROID)
@@ -0,0 +1,82 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core
${QT_INCLUDE_DIR}
)

ADD_LIBRARY(libdxfrw STATIC
drw_classes.cpp
drw_entities.cpp
drw_header.cpp
drw_objects.cpp
libdwgr.cpp
libdxfrw.cpp
intern/drw_dbg.cpp
intern/drw_textcodec.cpp
intern/dwgbuffer.cpp
intern/dwgreader.cpp
intern/dwgreader15.cpp
intern/dwgreader18.cpp
intern/dwgreader21.cpp
intern/dwgreader24.cpp
intern/dwgreader27.cpp
intern/dwgutil.cpp
intern/dxfreader.cpp
intern/dxfwriter.cpp
intern/rscodec.cpp
)
SET_PROPERTY(TARGET libdxfrw PROPERTY POSITION_INDEPENDENT_CODE ON)

IF(FALSE)
IF(DOXYGEN_FOUND)
ADD_CUSTOM_TARGET(doxygen-dxfrw ALL
COMMAND ${DOXYGEN_EXECUTABLE} libdxfrw.dox
drw_base.h
drw_classes.cpp
drw_classes.h
drw_entities.cpp
drw_entities.h
drw_header.cpp
drw_header.h
drw_interface.h
drw_objects.cpp
drw_objects.h
libdwgr.cpp
libdwgr.h
libdxfrw.cpp
libdxfrw.h
intern/drw_cptable932.h
intern/drw_cptable936.h
intern/drw_cptable949.h
intern/drw_cptable950.h
intern/drw_cptables.h
intern/drw_dbg.cpp
intern/drw_dbg.h
intern/drw_textcodec.cpp
intern/drw_textcodec.h
intern/dwgbuffer.cpp
intern/dwgbuffer.h
intern/dwgreader.cpp
intern/dwgreader.h
intern/dwgreader15.cpp
intern/dwgreader15.h
intern/dwgreader18.cpp
intern/dwgreader18.h
intern/dwgreader21.cpp
intern/dwgreader21.h
intern/dwgreader24.cpp
intern/dwgreader24.h
intern/dwgreader27.cpp
intern/dwgreader27.h
intern/dwgutil.cpp
intern/dwgutil.h
intern/dxfreader.cpp
intern/dxfreader.h
intern/dxfwriter.cpp
intern/dxfwriter.h
intern/rscodec.cpp
intern/rscodec.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS libdxfrw
COMMENT "Generating libdxfrw documentation" VERBATIM)
ENDIF(DOXYGEN_FOUND)
ENDIF(FALSE)

2 comments on commit d5c6b97

@PedroVenancio

This comment has been minimized.

Copy link
Contributor

@PedroVenancio PedroVenancio replied Dec 22, 2016

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

This comment has been minimized.

Copy link
Contributor

@PedroVenancio PedroVenancio replied Dec 22, 2016

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.
You can’t perform that action at this time.