├── .gitignore ├── debian ├── compat ├── .gitignore ├── source │ └── format ├── libdxflib3.install ├── patches │ ├── series │ ├── FTBFS_cstring_h.patch │ ├── fix_boundaries.patch │ ├── build-system.patch │ └── configure.patch ├── libdxflib-dev.install ├── watch ├── README.source ├── rules ├── copyright_hints ├── control ├── copyright ├── changelog └── libdxflib3.symbols ├── examples ├── readwrite │ ├── demo.dxf │ ├── test.pro │ ├── test_creationclass.h │ ├── test_creationclass.cpp │ ├── main.cpp │ └── myfile.dxf └── writehatch │ ├── test.pro │ └── main.cpp ├── src ├── dl_global.h ├── dl_exception.h ├── dl_writer_ascii.h ├── dl_extrusion.h ├── dl_writer_ascii.cpp ├── dl_creationadapter.h ├── dl_attributes.h ├── dl_creationinterface.h ├── dl_writer.h ├── dl_dxf.h └── dl_codes.h ├── dxflib.pro ├── dxflib.doxygen ├── dxflib_commercial_license.txt └── gpl-2.0greater.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .pc 2 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | .pc 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/libdxflib3.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libdxflib*.so.* 2 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | FTBFS_cstring_h.patch 2 | build-system.patch 3 | configure.patch 4 | -------------------------------------------------------------------------------- /examples/readwrite/demo.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easyw/dxflib/master/examples/readwrite/demo.dxf -------------------------------------------------------------------------------- /debian/libdxflib-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | usr/lib/*/lib*.a 3 | usr/lib/*/libdxflib.so 4 | usr/lib/*/pkgconfig/* 5 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | 3 | opts="uversionmangle=s/-.*//" \ 4 | http://www.qcad.org/en/dxflib-downloads \ 5 | /archives/dxflib/dxflib-(.*)\-src\.tar\.gz 6 | -------------------------------------------------------------------------------- /debian/README.source: -------------------------------------------------------------------------------- 1 | dxflib for Debian 2 | ----------------- 3 | 4 | dxflib's build system builds static libraries. Debian patches it to build 5 | shared libraries. 6 | -------------------------------------------------------------------------------- /src/dl_global.h: -------------------------------------------------------------------------------- 1 | #if defined(DXFLIB_DLL) 2 | # ifdef _WIN32 3 | # if defined(DXFLIB_LIBRARY) 4 | # define DXFLIB_EXPORT __declspec(dllexport) 5 | # else 6 | # define DXFLIB_EXPORT __declspec(dllimport) 7 | # endif 8 | # else 9 | # define DXFLIB_EXPORT 10 | # endif 11 | #else 12 | # define DXFLIB_EXPORT 13 | #endif 14 | -------------------------------------------------------------------------------- /debian/patches/FTBFS_cstring_h.patch: -------------------------------------------------------------------------------- 1 | Description: Missing include needs to be added 2 | Author: Scott Howard 3 | 4 | Index: dxflib-3.7.5/src/dl_writer.h 5 | =================================================================== 6 | --- dxflib-3.7.5.orig/src/dl_writer.h 7 | +++ dxflib-3.7.5/src/dl_writer.h 8 | @@ -37,6 +37,7 @@ 9 | #endif // _MSC_VER > 1000 10 | 11 | #include 12 | +#include 13 | #include 14 | 15 | #include "dl_attributes.h" 16 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | # Uncomment this to turn on verbose mode. 5 | #export DH_VERBOSE=1 6 | 7 | DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) 8 | LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) 9 | 10 | %: 11 | mv configure.in configure.ac 12 | dh $@ --with autoreconf 13 | mv configure.ac configure.in 14 | 15 | override_dh_auto_test: 16 | make testing 17 | 18 | override_dh_auto_install: 19 | dh_auto_install 20 | dh_link -p libdxflib3 $(LIBDIR)/libdxflib.so.3.12.2 $(LIBDIR)/libdxflib.so.3 21 | 22 | get-orig-source: 23 | uscan --download-current-version --repack --rename 24 | -------------------------------------------------------------------------------- /dxflib.pro: -------------------------------------------------------------------------------- 1 | exists(../../../shared.pri) { 2 | include( ../../../shared.pri ) 3 | } 4 | 5 | win32-msvc { 6 | DEFINES += _CRT_SECURE_NO_DEPRECATE 7 | } 8 | 9 | INCLUDEPATH += src 10 | HEADERS = \ 11 | src/dl_attributes.h \ 12 | src/dl_codes.h \ 13 | src/dl_creationadapter.h \ 14 | src/dl_creationinterface.h \ 15 | src/dl_dxf.h \ 16 | src/dl_entities.h \ 17 | src/dl_exception.h \ 18 | src/dl_extrusion.h \ 19 | src/dl_writer.h \ 20 | src/dl_writer_ascii.h 21 | 22 | SOURCES = \ 23 | src/dl_dxf.cpp \ 24 | src/dl_writer_ascii.cpp 25 | 26 | TARGET = dxflib 27 | TEMPLATE = lib 28 | CONFIG += staticlib 29 | DEFINES += DXFLIB_LIBRARY 30 | -------------------------------------------------------------------------------- /examples/writehatch/test.pro: -------------------------------------------------------------------------------- 1 | win32-msvc { 2 | DEFINES += _CRT_SECURE_NO_DEPRECATE 3 | } 4 | 5 | OBJECTS_DIR=.obj 6 | CONFIG -= app_bundle 7 | 8 | INCLUDEPATH += ../../src 9 | HEADERS = \ 10 | ../../src/dl_attributes.h \ 11 | ../../src/dl_codes.h \ 12 | ../../src/dl_creationadapter.h \ 13 | ../../src/dl_creationinterface.h \ 14 | ../../src/dl_dxf.h \ 15 | ../../src/dl_entities.h \ 16 | ../../src/dl_exception.h \ 17 | ../../src/dl_extrusion.h \ 18 | ../../src/dl_writer.h \ 19 | ../../src/dl_writer_ascii.h 20 | 21 | SOURCES = \ 22 | main.cpp \ 23 | ../../src/dl_dxf.cpp \ 24 | ../../src/dl_writer_ascii.cpp 25 | 26 | TARGET = writehatch 27 | TEMPLATE = app 28 | -------------------------------------------------------------------------------- /examples/readwrite/test.pro: -------------------------------------------------------------------------------- 1 | #include( ../../../shared.pri ) 2 | 3 | win32-msvc { 4 | DEFINES += _CRT_SECURE_NO_DEPRECATE 5 | } 6 | 7 | OBJECTS_DIR=.obj 8 | CONFIG -= app_bundle 9 | 10 | #macx { 11 | # QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.5.sdk 12 | # CONFIG+=x86 ppc 13 | #} 14 | 15 | INCLUDEPATH += ../../src 16 | HEADERS = \ 17 | test_creationclass.h \ 18 | ../../src/dl_attributes.h \ 19 | ../../src/dl_codes.h \ 20 | ../../src/dl_creationadapter.h \ 21 | ../../src/dl_creationinterface.h \ 22 | ../../src/dl_dxf.h \ 23 | ../../src/dl_entities.h \ 24 | ../../src/dl_exception.h \ 25 | ../../src/dl_extrusion.h \ 26 | ../../src/dl_writer.h \ 27 | ../../src/dl_writer_ascii.h 28 | 29 | SOURCES = \ 30 | main.cpp \ 31 | test_creationclass.cpp \ 32 | ../../src/dl_dxf.cpp \ 33 | ../../src/dl_writer_ascii.cpp 34 | 35 | TARGET = readwrite 36 | TEMPLATE = app 37 | -------------------------------------------------------------------------------- /debian/copyright_hints: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: FIXME 3 | Upstream-Contact: FIXME 4 | Source: FIXME 5 | Disclaimer: Autogenerated by CDBS 6 | 7 | Files: ./src/dl_attributes.h 8 | ./src/dl_creationadapter.h 9 | ./src/dl_creationinterface.h 10 | ./src/dl_dxf.cpp 11 | ./src/dl_dxf.h 12 | ./src/dl_entities.h 13 | ./src/dl_extrusion.h 14 | Copyright: 2001-2003, RibbonSoft. 15 | License: UNKNOWN 16 | FIXME 17 | 18 | Files: ./src/dl_codes.h 19 | ./src/dl_exception.h 20 | ./src/dl_writer.h 21 | ./src/dl_writer_ascii.cpp 22 | ./src/dl_writer_ascii.h 23 | Copyright: 2001, Robert J. Campbell Jr 24 | 2001-2003, RibbonSoft. 25 | License: UNKNOWN 26 | FIXME 27 | 28 | Files: ./test/main.cpp 29 | ./test/test_creationclass.cpp 30 | ./test/test_creationclass.h 31 | Copyright: 2000-2001, Andrew Mustun 32 | 2001, Andrew Mustun 33 | License: LGPL 34 | FIXME 35 | 36 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: dxflib 2 | Priority: optional 3 | Maintainer: Debian Science Team 4 | Uploaders: Alastair McKinstry 5 | Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, libx11-dev 6 | Standards-Version: 3.9.6 7 | Section: libs 8 | Homepage: http://www.qcad.org/en/what-is-dxflib 9 | Vcs-Git: git://anonscm.debian.org/debian-science/packages/dxflib.git 10 | Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/dxflib.git 11 | 12 | Package: libdxflib-dev 13 | Priority: extra 14 | Section: libdevel 15 | Architecture: any 16 | Depends: libdxflib3 (= ${binary:Version}), ${misc:Depends} 17 | Description: Development files for the dxflib library 18 | dxflib is a C++ library for reading and writing DXF files. When reading DXF 19 | files, dxflib parses the file and calls functions that you define in your 20 | own C++ class for adding entities, layers, etc. 21 | . 22 | This package contains the development files (headers and documentation) for 23 | libdxflib. 24 | 25 | Package: libdxflib3 26 | Architecture: any 27 | Depends: ${shlibs:Depends}, ${misc:Depends} 28 | Description: Library for reading and writing DXF files 29 | dxflib is a C++ library for reading and writing DXF files. When reading DXF 30 | files, dxflib parses the file and calls functions that you define in your 31 | own C++ class for adding entities, layers, etc. 32 | -------------------------------------------------------------------------------- /debian/patches/fix_boundaries.patch: -------------------------------------------------------------------------------- 1 | Author: Rallaz 2 | Subject: fix boundaries issues. 3 | 4 | Fixes a boundary bug. Patch needed for LibreCAD. 5 | 6 | diff --git a/src/dl_dxf.cpp b/src/dl_dxf.cpp 7 | index 939fed2..b398acd 100644 8 | --- a/src/dl_dxf.cpp 9 | +++ b/src/dl_dxf.cpp 10 | @@ -1358,6 +1358,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* /*creationInterface*/) { 11 | hatchLoopIndex++; 12 | hatchLoops[hatchLoopIndex] 13 | = DL_HatchLoopData(toInt(groupValue)); 14 | + hatchLoops[hatchLoopIndex].pathType = toInt(values[92]); 15 | 16 | maxHatchEdges[hatchLoopIndex] = toInt(groupValue); 17 | hatchEdgeIndex[hatchLoopIndex] = -1; 18 | @@ -1948,6 +1949,7 @@ void DL_Dxf::addHatch(DL_CreationInterface* creationInterface) { 19 | 20 | for (int l=0; laddHatchLoop(ld); 24 | for (int b=0; baddHatchEdge(hatchEdges[l][b]); 26 | diff --git a/src/dl_entities.h b/src/dl_entities.h 27 | index 39f7617..dfb47f0 100644 28 | --- a/src/dl_entities.h 29 | +++ b/src/dl_entities.h 30 | @@ -1272,6 +1272,7 @@ struct DL_HatchLoopData { 31 | 32 | /*! Number of edges in this loop. */ 33 | int numEdges; 34 | + int pathType; //Boundary path type 35 | }; 36 | 37 | 38 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: dxflib 3 | Source: http://www.ribbonsoft.com/en/what-is-dxflib 4 | 5 | Files: * 6 | Copyright: 2001 Robert J. Campbell Jr 7 | 2001-2003 RibbonSoft. 8 | License: GPL-2.0 9 | This program is free software; you can redistribute it 10 | and/or modify it under the terms of the GNU General Public 11 | License as published by the Free Software Foundation. 12 | . 13 | This program is distributed in the hope that it will be 14 | useful, but WITHOUT ANY WARRANTY; without even the implied 15 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 16 | PURPOSE. See the GNU General Public License for more 17 | details. 18 | . 19 | On Debian systems, the full text of the GNU General Public 20 | License version 2 can be found in the file 21 | `/usr/share/common-licenses/GPL-2'. 22 | 23 | Files: debian/* 24 | Copyright: 2011 Scott Howard 25 | License: GPL-2.0+ 26 | This program is free software; you can redistribute it 27 | and/or modify it under the terms of the GNU General Public 28 | License as published by the Free Software Foundation; either 29 | version 2 of the License, or (at your option) any later 30 | version. 31 | . 32 | This program is distributed in the hope that it will be 33 | useful, but WITHOUT ANY WARRANTY; without even the implied 34 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 35 | PURPOSE. See the GNU General Public License for more 36 | details. 37 | . 38 | On Debian systems, the full text of the GNU General Public 39 | License version 2 can be found in the file 40 | `/usr/share/common-licenses/GPL-2'. 41 | -------------------------------------------------------------------------------- /debian/patches/build-system.patch: -------------------------------------------------------------------------------- 1 | Description: Build system for shared library. 2 | Author: Scott Howard 3 | 4 | Index: dxflib-3.7.5/Makefile.am 5 | =================================================================== 6 | --- /dev/null 7 | +++ dxflib-3.7.5/Makefile.am 8 | @@ -0,0 +1,33 @@ 9 | +pkgconfigdir = $(libdir)/pkgconfig 10 | +pkgconfig_DATA = dxflib.pc 11 | + 12 | +BASE_DIR = ./src 13 | + 14 | +BASE_SRC = \ 15 | + $(BASE_DIR)/dl_dxf.cpp \ 16 | + $(BASE_DIR)/dl_writer_ascii.cpp 17 | + 18 | +BASE_INS = \ 19 | + $(BASE_DIR)/dl_attributes.h \ 20 | + $(BASE_DIR)/dl_codes.h \ 21 | + $(BASE_DIR)/dl_creationadapter.h \ 22 | + $(BASE_DIR)/dl_creationinterface.h \ 23 | + $(BASE_DIR)/dl_dxf.h \ 24 | + $(BASE_DIR)/dl_entities.h \ 25 | + $(BASE_DIR)/dl_exception.h \ 26 | + $(BASE_DIR)/dl_extrusion.h \ 27 | + $(BASE_DIR)/dl_global.h \ 28 | + $(BASE_DIR)/dl_writer.h \ 29 | + $(BASE_DIR)/dl_writer_ascii.h 30 | + 31 | +lib_LTLIBRARIES = libdxflib.la 32 | +libdxflib_la_SOURCES = $(BASE_SRC) 33 | +libdxflib_la_includedir=$(includedir)/dxflib 34 | +libdxflib_la_include_HEADERS = $(BASE_INS) 35 | +libdxflib_la_LDFLAGS = -version-number 3:12:2 36 | + 37 | +testing: 38 | + (cd ./test ; make) 39 | + 40 | +docu: 41 | + -(doxygen ./doxygen.cfg) 42 | Index: dxflib-3.7.5/dxflib.pc.in 43 | =================================================================== 44 | --- /dev/null 45 | +++ dxflib-3.7.5/dxflib.pc.in 46 | @@ -0,0 +1,10 @@ 47 | +prefix=@prefix@ 48 | +exec_prefix=@exec_prefix@ 49 | +libdir=@libdir@ 50 | +includedir=@includedir@/dxflib 51 | + 52 | +Name: dxflib 53 | +Description: Library for reading dxf files 54 | +Version: @PACKAGE_VERSION@ 55 | +Libs: -L${libdir} -ldxflib 56 | +Cflags: -I${includedir} 57 | -------------------------------------------------------------------------------- /src/dl_exception.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | #ifndef DL_EXCEPTION_H 27 | #define DL_EXCEPTION_H 28 | 29 | #include "dl_global.h" 30 | 31 | #if _MSC_VER > 1000 32 | #pragma once 33 | #endif // _MSC_VER > 1000 34 | 35 | /** 36 | * Used for exception handling. 37 | */ 38 | class DXFLIB_EXPORT DL_Exception {} 39 | ; 40 | 41 | /** 42 | * Used for exception handling. 43 | */ 44 | class DXFLIB_EXPORT DL_NullStrExc : public DL_Exception {} 45 | ; 46 | 47 | /** 48 | * Used for exception handling. 49 | */ 50 | class DXFLIB_EXPORT DL_GroupCodeExc : public DL_Exception { 51 | DL_GroupCodeExc(int gc=0) : groupCode(gc) {} 52 | int groupCode; 53 | }; 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /debian/patches/configure.patch: -------------------------------------------------------------------------------- 1 | Author: Alastair McKinstry 2 | Description: Re-include configure.in missing from 3.12.2 3 | Forwarded: no 4 | Last-Updated: 2016-01-04 5 | 6 | Index: dxflib-3.12.2/configure.in 7 | =================================================================== 8 | --- /dev/null 9 | +++ dxflib-3.12.2/configure.in 10 | @@ -0,0 +1,60 @@ 11 | + 12 | +# 13 | +# Check for one project file 14 | +# 15 | +AC_PREREQ([2.67]) 16 | +AC_INIT([dxflib], [3.12.2], []) 17 | +AC_CONFIG_SRCDIR([src/dl_exception.h]) 18 | +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) 19 | +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 20 | +AC_PROG_LIBTOOL 21 | + 22 | +PRODUCT=dxflib 23 | + 24 | +# 25 | +# check cannonical system name 26 | +# 27 | +AC_CANONICAL_HOST 28 | +case "$host" in 29 | +*-linux-gnu ) AC_DEFINE(LINUX) ;; 30 | + *-aix* ) AC_DEFINE(AIX) ;; 31 | + * ) AC_DEFINE(UNIX) ;; 32 | +esac 33 | + 34 | +# 35 | +# check C compiler, preprocesor, etc. 36 | +# 37 | +AC_PROG_CC 38 | +AC_PROG_CPP 39 | +AC_PROG_CXX 40 | +AC_PROG_INSTALL 41 | +AC_CHECK_PROG(FIND, find, find, :) 42 | +AC_CHECK_PROG(MAKEDEPEND, makedepend, makedepend, :) 43 | + 44 | +# 45 | +# Try to locate the X Window System include files and libraries 46 | +# and add /usr/local to include and lib path and add -lm (for testing) 47 | +# 48 | +AC_PATH_XTRA 49 | +CFLAGS="$CFLAGS $X_CFLAGS" 50 | +LDFLAGS="$LDFLAGS $X_LIBS -L/usr/local/lib" 51 | + 52 | + 53 | +# 54 | +# Declare variables which we want substituted in the Makefile.in's 55 | +# 56 | + 57 | + 58 | +AC_HEADER_STDC 59 | +AC_CHECK_HEADERS(limits.h) 60 | + 61 | + 62 | +# 63 | +# finally create makefiles using Makefile.in 64 | +# 65 | +echo 66 | +AC_OUTPUT(Makefile dxflib.pc) 67 | + 68 | +echo 69 | +echo "Run 'make depend' to create dependencies." 70 | +echo 71 | -------------------------------------------------------------------------------- /examples/readwrite/test_creationclass.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file test_creationclass.h 3 | */ 4 | 5 | /***************************************************************************** 6 | ** $Id: test_creationclass.h 8865 2008-02-04 18:54:02Z andrew $ 7 | ** 8 | ** This is part of the dxflib library 9 | ** Copyright (C) 2001 Andrew Mustun 10 | ** 11 | ** This program is free software; you can redistribute it and/or modify 12 | ** it under the terms of the GNU Library General Public License as 13 | ** published by the Free Software Foundation. 14 | ** 15 | ** This program is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU Library General Public License for more details. 19 | ** 20 | ** You should have received a copy of the GNU Library General Public License 21 | ** along with this program; if not, write to the Free Software 22 | ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | ******************************************************************************/ 24 | 25 | #ifndef TEST_CREATIONCLASS_H 26 | #define TEST_CREATIONCLASS_H 27 | 28 | #include "dl_creationadapter.h" 29 | 30 | 31 | 32 | /** 33 | * This class takes care of the entities read from the file. 34 | * Usually such a class would probably store the entities. 35 | * this one just prints some information about them to stdout. 36 | * 37 | * @author Andrew Mustun 38 | */ 39 | class Test_CreationClass : public DL_CreationAdapter { 40 | public: 41 | Test_CreationClass(); 42 | 43 | virtual void addLayer(const DL_LayerData& data); 44 | virtual void addPoint(const DL_PointData& data); 45 | virtual void addLine(const DL_LineData& data); 46 | virtual void addArc(const DL_ArcData& data); 47 | virtual void addCircle(const DL_CircleData& data); 48 | virtual void addPolyline(const DL_PolylineData& data); 49 | virtual void addVertex(const DL_VertexData& data); 50 | virtual void add3dFace(const DL_3dFaceData& data); 51 | 52 | void printAttributes(); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/dl_writer_ascii.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | #ifndef DL_WRITER_ASCII_H 27 | #define DL_WRITER_ASCII_H 28 | 29 | #include "dl_global.h" 30 | 31 | #if _MSC_VER > 1000 32 | #pragma once 33 | #endif // _MSC_VER > 1000 34 | 35 | #include "dl_writer.h" 36 | #include 37 | #include 38 | 39 | /** 40 | * Implements functions defined in DL_Writer for writing low 41 | * level DXF constructs to an ASCII format DXF file. 42 | * 43 | * @para fname File name of the file to be created. 44 | * @para version DXF version. Defaults to DL_VERSION_2002. 45 | * 46 | * @todo What if \c fname is NULL? Or \c fname can't be opened for 47 | * another reason? 48 | */ 49 | class DXFLIB_EXPORT DL_WriterA : public DL_Writer { 50 | public: 51 | DL_WriterA(const char* fname, DL_Codes::version version=DL_VERSION_2000) 52 | : DL_Writer(version), m_ofile(fname) {} 53 | virtual ~DL_WriterA() {} 54 | 55 | bool openFailed() const; 56 | void close() const; 57 | void dxfReal(int gc, double value) const; 58 | void dxfInt(int gc, int value) const; 59 | void dxfHex(int gc, int value) const; 60 | void dxfString(int gc, const char* value) const; 61 | void dxfString(int gc, const std::string& value) const; 62 | 63 | static void strReplace(char* str, char src, char dest); 64 | 65 | private: 66 | /** 67 | * DXF file to be created. 68 | */ 69 | mutable std::ofstream m_ofile; 70 | 71 | }; 72 | 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /examples/writehatch/main.cpp: -------------------------------------------------------------------------------- 1 | #include "dl_dxf.h" 2 | 3 | int main() { 4 | DL_Dxf dxf; 5 | DL_WriterA* dw = dxf.out("hatch.dxf", DL_Codes::AC1015); 6 | 7 | // section header: 8 | dxf.writeHeader(*dw); 9 | dw->sectionEnd(); 10 | 11 | // section tables: 12 | dw->sectionTables(); 13 | 14 | // VPORT: 15 | dxf.writeVPort(*dw); 16 | 17 | // LTYPE: 18 | dw->tableLinetypes(1); 19 | dxf.writeLinetype(*dw, DL_LinetypeData("CONTINUOUS", "Continuous", 0, 0, 0.0)); 20 | dxf.writeLinetype(*dw, DL_LinetypeData("BYLAYER", "", 0, 0, 0.0)); 21 | dxf.writeLinetype(*dw, DL_LinetypeData("BYBLOCK", "", 0, 0, 0.0)); 22 | dw->tableEnd(); 23 | 24 | // LAYER: 25 | dw->tableLayers(1); 26 | dxf.writeLayer( 27 | *dw, 28 | DL_LayerData("0", 0), 29 | DL_Attributes("", 2, 0, 100, "CONTINUOUS") 30 | ); 31 | dw->tableEnd(); 32 | 33 | // STYLE: 34 | dw->tableStyle(1); 35 | DL_StyleData style("Standard", 0, 0.0, 1.0, 0.0, 0, 2.5, "txt", ""); 36 | style.bold = false; 37 | style.italic = false; 38 | dxf.writeStyle(*dw, style); 39 | dw->tableEnd(); 40 | 41 | // VIEW: 42 | dxf.writeView(*dw); 43 | 44 | // UCS: 45 | dxf.writeUcs(*dw); 46 | 47 | // APPID: 48 | dw->tableAppid(1); 49 | dxf.writeAppid(*dw, "ACAD"); 50 | dw->tableEnd(); 51 | 52 | // DIMSTYLE: 53 | dxf.writeDimStyle(*dw, 2.5, 0.625, 0.625, 0.625, 2.5); 54 | 55 | // BLOCK_RECORD: 56 | dxf.writeBlockRecord(*dw); 57 | dw->tableEnd(); 58 | 59 | dw->sectionEnd(); 60 | 61 | // BLOCK: 62 | dw->sectionBlocks(); 63 | dxf.writeBlock(*dw, DL_BlockData("*Model_Space", 0, 0.0, 0.0, 0.0)); 64 | dxf.writeEndBlock(*dw, "*Model_Space"); 65 | dxf.writeBlock(*dw, DL_BlockData("*Paper_Space", 0, 0.0, 0.0, 0.0)); 66 | dxf.writeEndBlock(*dw, "*Paper_Space"); 67 | dxf.writeBlock(*dw, DL_BlockData("*Paper_Space0", 0, 0.0, 0.0, 0.0)); 68 | dxf.writeEndBlock(*dw, "*Paper_Space0"); 69 | dw->sectionEnd(); 70 | 71 | // ENTITIES: 72 | dw->sectionEntities(); 73 | 74 | DL_Attributes attributes("0", 2, 0, -1, "BYLAYER"); 75 | 76 | // start hatch with one loop: 77 | DL_HatchData data(1, false, 100.0, 0.0, "ESCHER", 0.0, 0.0); 78 | dxf.writeHatch1(*dw, data, attributes); 79 | 80 | // start loop: 81 | DL_HatchLoopData lData(1); 82 | dxf.writeHatchLoop1(*dw, lData); 83 | 84 | // write edge: 85 | DL_HatchEdgeData eData( 86 | 0.0, 87 | 0.0, 88 | 100.0, 89 | 0.0, 90 | M_PI*2, 91 | true 92 | ); 93 | dxf.writeHatchEdge(*dw, eData); 94 | 95 | // end loop: 96 | dxf.writeHatchLoop2(*dw, lData); 97 | 98 | // end hatch: 99 | dxf.writeHatch2(*dw, data, attributes); 100 | 101 | // end section ENTITIES: 102 | dw->sectionEnd(); 103 | dxf.writeObjects(*dw, "MY_OBJECTS"); 104 | dxf.writeObjectsEnd(*dw); 105 | 106 | dw->dxfEOF(); 107 | dw->close(); 108 | delete dw; 109 | 110 | return 0; 111 | } 112 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | dxflib (3.12.2-2) UNRELEASED; urgency=medium 2 | 3 | * Update debian/copyright: test/* removed; GPL2+ files in debian/* 4 | 5 | -- Alastair McKinstry Mon, 22 Feb 2016 11:05:11 +0000 6 | 7 | dxflib (3.12.2-1) unstable; urgency=medium 8 | 9 | * New upstream release. Move 2.5.0.0 -> 3 and rename packages. 10 | * Remove explicit dbg package. Now done automatically. 11 | * Remove lisandro from Uploaders: 12 | 13 | -- Alastair McKinstry Sat, 09 Jan 2016 22:38:18 +0000 14 | 15 | dxflib (2.5.0.0-4) unstable; urgency=medium 16 | 17 | * Team upload. 18 | * Remove myself from uploaders 19 | * Updated symbols 20 | * Rename package for g++ transition (Closes: #797649) 21 | * Updated copyright 22 | * Bump Debian SV to 3.9.6, no changes 23 | 24 | -- Scott Howard Mon, 07 Sep 2015 12:30:34 -0400 25 | 26 | dxflib (2.5.0.0-3) unstable; urgency=medium 27 | 28 | * Adopt dxflib. Closes: #733823. 29 | 30 | -- Alastair McKinstry Fri, 14 Aug 2015 17:31:11 +0100 31 | 32 | dxflib (2.5.0.0-2) unstable; urgency=low 33 | 34 | * Merge from experimental to unstable. (Closes: #731577) 35 | 36 | -- Scott Howard Fri, 13 Dec 2013 16:41:48 -0500 37 | 38 | dxflib (2.5.0.0-1) experimental; urgency=low 39 | 40 | * New upstream release. 41 | * Dropped debian/patches/hatch_fix.patch: 42 | - patch from depending project that no longer uses dxflib 43 | * Enable multi-arch, S-V 3.9.4, hardening flags 44 | * Fix a FTBFS for missing AM_PROG_AR macro (Closes: #713303) 45 | 46 | -- Scott Howard Sun, 23 Jun 2013 17:16:54 -0400 47 | 48 | dxflib (2.2.0.0-8) unstable; urgency=low 49 | 50 | * More hatch fixes in debian/patches/hatches_fixes.patch 51 | 52 | -- Scott Howard Sat, 03 Mar 2012 21:25:22 -0500 53 | 54 | dxflib (2.2.0.0-7) unstable; urgency=low 55 | 56 | [ Lisandro Damián Nicanor Pérez Meyer ] 57 | * Previous upload also included patch to solve a boundary bug 58 | needed by LibreCAD. Thanks Rallaz for the patch. 59 | 60 | [ Scott Howard ] 61 | * Added symbols file, managed by pkgkde-symbolshelper 62 | 63 | -- Scott Howard Sun, 05 Feb 2012 13:39:54 -0500 64 | 65 | dxflib (2.2.0.0-6) unstable; urgency=low 66 | 67 | * Add myself to Uploaders. 68 | 69 | -- Lisandro Damián Nicanor Pérez Meyer Mon, 10 Oct 2011 14:24:55 -0300 70 | 71 | dxflib (2.2.0.0-5) unstable; urgency=low 72 | 73 | * Moved headers to /usr/include/dxflib as excepted by upstream 74 | makefile (Closes: #630999) 75 | * Debian S-V 3.9.2 no changes 76 | 77 | -- Scott Howard Sun, 19 Jun 2011 13:19:16 -0400 78 | 79 | dxflib (2.2.0.0-4) unstable; urgency=low 80 | 81 | * Corrected debian/copyright to be GPLv2 and LGPLv2 82 | 83 | -- Scott Howard Thu, 21 Apr 2011 23:11:41 -0400 84 | 85 | dxflib (2.2.0.0-3) unstable; urgency=low 86 | 87 | * Removed symbols files, FTBFS (arch-dep symbols) 88 | 89 | -- Scott Howard Thu, 14 Apr 2011 09:08:15 -0400 90 | 91 | dxflib (2.2.0.0-2) unstable; urgency=low 92 | 93 | * Set source package priority: optional, no change to binary packages 94 | * Removed *.la from debian/libdxflib-dev.install 95 | 96 | -- Scott Howard Thu, 07 Apr 2011 19:13:27 -0400 97 | 98 | dxflib (2.2.0.0-1) unstable; urgency=low 99 | 100 | * Initial release (Closes: #617623) 101 | 102 | -- Scott Howard Sat, 12 Mar 2011 12:00:24 -0500 103 | -------------------------------------------------------------------------------- /src/dl_extrusion.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_EXTRUSION_H 26 | #define DL_EXTRUSION_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include 31 | 32 | 33 | /** 34 | * Storing and passing around attributes. Attributes 35 | * are the layer name, color, width and line type. 36 | * 37 | * @author Andrew Mustun 38 | */ 39 | class DXFLIB_EXPORT DL_Extrusion { 40 | 41 | public: 42 | 43 | /** 44 | * Default constructor. 45 | */ 46 | DL_Extrusion() { 47 | direction = new double[3]; 48 | setDirection(0.0, 0.0, 1.0); 49 | setElevation(0.0); 50 | } 51 | 52 | 53 | /** 54 | * Destructor. 55 | */ 56 | ~DL_Extrusion() { 57 | delete[] direction ; 58 | } 59 | 60 | 61 | /** 62 | * Constructor for DXF extrusion. 63 | * 64 | * @param direction Vector of axis along which the entity shall be extruded 65 | * this is also the Z axis of the Entity coordinate system 66 | * @param elevation Distance of the entities XY plane from the origin of the 67 | * world coordinate system 68 | */ 69 | DL_Extrusion(double dx, double dy, double dz, double elevation) { 70 | direction = new double[3]; 71 | setDirection(dx, dy, dz); 72 | setElevation(elevation); 73 | } 74 | 75 | 76 | 77 | /** 78 | * Sets the direction vector. 79 | */ 80 | void setDirection(double dx, double dy, double dz) { 81 | direction[0]=dx; 82 | direction[1]=dy; 83 | direction[2]=dz; 84 | } 85 | 86 | 87 | 88 | /** 89 | * @return direction vector. 90 | */ 91 | double* getDirection() const { 92 | return direction; 93 | } 94 | 95 | 96 | 97 | /** 98 | * @return direction vector. 99 | */ 100 | void getDirection(double dir[]) const { 101 | dir[0]=direction[0]; 102 | dir[1]=direction[1]; 103 | dir[2]=direction[2]; 104 | } 105 | 106 | 107 | 108 | /** 109 | * Sets the elevation. 110 | */ 111 | void setElevation(double elevation) { 112 | this->elevation = elevation; 113 | } 114 | 115 | 116 | 117 | /** 118 | * @return Elevation. 119 | */ 120 | double getElevation() const { 121 | return elevation; 122 | } 123 | 124 | 125 | 126 | /** 127 | * Copies extrusion (deep copies) from another extrusion object. 128 | */ 129 | DL_Extrusion operator = (const DL_Extrusion& extru) { 130 | setDirection(extru.direction[0], extru.direction[1], extru.direction[2]); 131 | setElevation(extru.elevation); 132 | 133 | return *this; 134 | } 135 | 136 | 137 | 138 | private: 139 | double *direction; 140 | double elevation; 141 | }; 142 | 143 | #endif 144 | 145 | -------------------------------------------------------------------------------- /src/dl_writer_ascii.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | #if _MSC_VER > 1000 27 | #pragma once 28 | #endif // _MSC_VER > 1000 29 | 30 | #include 31 | #include 32 | 33 | #include "dl_writer_ascii.h" 34 | #include "dl_exception.h" 35 | 36 | 37 | /** 38 | * Closes the output file. 39 | */ 40 | void DL_WriterA::close() const { 41 | m_ofile.close(); 42 | } 43 | 44 | 45 | /** 46 | * @retval true Opening file has failed. 47 | * @retval false Otherwise. 48 | */ 49 | bool DL_WriterA::openFailed() const { 50 | return m_ofile.fail(); 51 | } 52 | 53 | 54 | 55 | /** 56 | * Writes a real (double) variable to the DXF file. 57 | * 58 | * @param gc Group code. 59 | * @param value Double value 60 | */ 61 | void DL_WriterA::dxfReal(int gc, double value) const { 62 | char str[256]; 63 | if (version==DL_Codes::AC1009_MIN) { 64 | sprintf(str, "%.6lf", value); 65 | } 66 | else { 67 | sprintf(str, "%.16lf", value); 68 | } 69 | 70 | // fix for german locale: 71 | strReplace(str, ',', '.'); 72 | 73 | // Cut away those zeros at the end: 74 | bool dot = false; 75 | int end = -1; 76 | for (unsigned int i=0; i0 && end<(int)strlen(str)) { 86 | str[end] = '\0'; 87 | } 88 | 89 | dxfString(gc, str); 90 | m_ofile.flush(); 91 | } 92 | 93 | 94 | 95 | /** 96 | * Writes an int variable to the DXF file. 97 | * 98 | * @param gc Group code. 99 | * @param value Int value 100 | */ 101 | void DL_WriterA::dxfInt(int gc, int value) const { 102 | m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" << value << "\n"; 103 | } 104 | 105 | 106 | 107 | /** 108 | * Writes a hex int variable to the DXF file. 109 | * 110 | * @param gc Group code. 111 | * @param value Int value 112 | */ 113 | void DL_WriterA::dxfHex(int gc, int value) const { 114 | char str[12]; 115 | sprintf(str, "%0X", value); 116 | dxfString(gc, str); 117 | } 118 | 119 | 120 | 121 | /** 122 | * Writes a string variable to the DXF file. 123 | * 124 | * @param gc Group code. 125 | * @param value String 126 | */ 127 | void DL_WriterA::dxfString(int gc, const char* value) const { 128 | if (value==NULL) { 129 | #ifndef __GCC2x__ 130 | //throw DL_NullStrExc(); 131 | #endif 132 | } 133 | m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" 134 | << value << "\n"; 135 | } 136 | 137 | 138 | 139 | void DL_WriterA::dxfString(int gc, const std::string& value) const { 140 | m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" 141 | << value << "\n"; 142 | } 143 | 144 | 145 | /** 146 | * Replaces every occurence of src with dest in the null terminated str. 147 | */ 148 | void DL_WriterA::strReplace(char* str, char src, char dest) { 149 | size_t i; 150 | for (i=0; i 28 | #include 29 | 30 | 31 | /** 32 | * Default constructor. 33 | */ 34 | Test_CreationClass::Test_CreationClass() {} 35 | 36 | 37 | /** 38 | * Sample implementation of the method which handles layers. 39 | */ 40 | void Test_CreationClass::addLayer(const DL_LayerData& data) { 41 | printf("LAYER: %s flags: %d\n", data.name.c_str(), data.flags); 42 | printAttributes(); 43 | } 44 | 45 | /** 46 | * Sample implementation of the method which handles point entities. 47 | */ 48 | void Test_CreationClass::addPoint(const DL_PointData& data) { 49 | printf("POINT (%6.3f, %6.3f, %6.3f)\n", 50 | data.x, data.y, data.z); 51 | printAttributes(); 52 | } 53 | 54 | /** 55 | * Sample implementation of the method which handles line entities. 56 | */ 57 | void Test_CreationClass::addLine(const DL_LineData& data) { 58 | printf("LINE (%6.3f, %6.3f, %6.3f) (%6.3f, %6.3f, %6.3f)\n", 59 | data.x1, data.y1, data.z1, data.x2, data.y2, data.z2); 60 | printAttributes(); 61 | } 62 | 63 | /** 64 | * Sample implementation of the method which handles arc entities. 65 | */ 66 | void Test_CreationClass::addArc(const DL_ArcData& data) { 67 | printf("ARC (%6.3f, %6.3f, %6.3f) %6.3f, %6.3f, %6.3f\n", 68 | data.cx, data.cy, data.cz, 69 | data.radius, data.angle1, data.angle2); 70 | printAttributes(); 71 | } 72 | 73 | /** 74 | * Sample implementation of the method which handles circle entities. 75 | */ 76 | void Test_CreationClass::addCircle(const DL_CircleData& data) { 77 | printf("CIRCLE (%6.3f, %6.3f, %6.3f) %6.3f\n", 78 | data.cx, data.cy, data.cz, 79 | data.radius); 80 | printAttributes(); 81 | } 82 | 83 | 84 | /** 85 | * Sample implementation of the method which handles polyline entities. 86 | */ 87 | void Test_CreationClass::addPolyline(const DL_PolylineData& data) { 88 | printf("POLYLINE \n"); 89 | printf("flags: %d\n", (int)data.flags); 90 | printAttributes(); 91 | } 92 | 93 | 94 | /** 95 | * Sample implementation of the method which handles vertices. 96 | */ 97 | void Test_CreationClass::addVertex(const DL_VertexData& data) { 98 | printf("VERTEX (%6.3f, %6.3f, %6.3f) %6.3f\n", 99 | data.x, data.y, data.z, 100 | data.bulge); 101 | printAttributes(); 102 | } 103 | 104 | 105 | void Test_CreationClass::add3dFace(const DL_3dFaceData& data) { 106 | printf("3DFACE\n"); 107 | for (int i=0; i<4; i++) { 108 | printf(" corner %d: %6.3f %6.3f %6.3f\n", 109 | i, data.x[i], data.y[i], data.z[i]); 110 | } 111 | printAttributes(); 112 | } 113 | 114 | 115 | void Test_CreationClass::printAttributes() { 116 | printf(" Attributes: Layer: %s, ", attributes.getLayer().c_str()); 117 | printf(" Color: "); 118 | if (attributes.getColor()==256) { 119 | printf("BYLAYER"); 120 | } else if (attributes.getColor()==0) { 121 | printf("BYBLOCK"); 122 | } else { 123 | printf("%d", attributes.getColor()); 124 | } 125 | printf(" Width: "); 126 | if (attributes.getWidth()==-1) { 127 | printf("BYLAYER"); 128 | } else if (attributes.getWidth()==-2) { 129 | printf("BYBLOCK"); 130 | } else if (attributes.getWidth()==-3) { 131 | printf("DEFAULT"); 132 | } else { 133 | printf("%d", attributes.getWidth()); 134 | } 135 | printf(" Type: %s\n", attributes.getLinetype().c_str()); 136 | } 137 | 138 | 139 | 140 | // EOF 141 | -------------------------------------------------------------------------------- /dxflib.doxygen: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = dxflib 2 | OUTPUT_DIRECTORY = doc/classref 3 | CREATE_SUBDIRS = NO 4 | OUTPUT_LANGUAGE = English 5 | USE_WINDOWS_ENCODING = NO 6 | BRIEF_MEMBER_DESC = YES 7 | REPEAT_BRIEF = YES 8 | ABBREVIATE_BRIEF = 9 | ALWAYS_DETAILED_SEC = NO 10 | INLINE_INHERITED_MEMB = NO 11 | FULL_PATH_NAMES = YES 12 | STRIP_FROM_PATH = 13 | STRIP_FROM_INC_PATH = 14 | SHORT_NAMES = NO 15 | JAVADOC_AUTOBRIEF = YES 16 | MULTILINE_CPP_IS_BRIEF = NO 17 | DETAILS_AT_TOP = NO 18 | INHERIT_DOCS = YES 19 | SEPARATE_MEMBER_PAGES = NO 20 | TAB_SIZE = 8 21 | ALIASES = 22 | OPTIMIZE_OUTPUT_FOR_C = NO 23 | OPTIMIZE_OUTPUT_JAVA = NO 24 | BUILTIN_STL_SUPPORT = NO 25 | DISTRIBUTE_GROUP_DOC = NO 26 | SUBGROUPING = YES 27 | EXTRACT_ALL = NO 28 | EXTRACT_PRIVATE = NO 29 | EXTRACT_STATIC = YES 30 | EXTRACT_LOCAL_CLASSES = YES 31 | EXTRACT_LOCAL_METHODS = NO 32 | HIDE_UNDOC_MEMBERS = NO 33 | HIDE_UNDOC_CLASSES = NO 34 | HIDE_FRIEND_COMPOUNDS = NO 35 | HIDE_IN_BODY_DOCS = NO 36 | INTERNAL_DOCS = NO 37 | CASE_SENSE_NAMES = YES 38 | HIDE_SCOPE_NAMES = NO 39 | SHOW_INCLUDE_FILES = YES 40 | INLINE_INFO = YES 41 | SORT_MEMBER_DOCS = YES 42 | SORT_BRIEF_DOCS = NO 43 | SORT_BY_SCOPE_NAME = NO 44 | GENERATE_TODOLIST = YES 45 | GENERATE_TESTLIST = YES 46 | GENERATE_BUGLIST = YES 47 | GENERATE_DEPRECATEDLIST= YES 48 | ENABLED_SECTIONS = 49 | MAX_INITIALIZER_LINES = 30 50 | SHOW_USED_FILES = YES 51 | SHOW_DIRECTORIES = NO 52 | FILE_VERSION_FILTER = 53 | QUIET = NO 54 | WARNINGS = YES 55 | WARN_IF_UNDOCUMENTED = YES 56 | WARN_IF_DOC_ERROR = YES 57 | WARN_NO_PARAMDOC = NO 58 | WARN_FORMAT = "$file:$line: $text" 59 | WARN_LOGFILE = 60 | INPUT = ./src 61 | FILE_PATTERNS = *.h *.cpp 62 | RECURSIVE = YES 63 | EXCLUDE = 64 | EXCLUDE_SYMLINKS = NO 65 | EXCLUDE_PATTERNS = 66 | EXAMPLE_PATH = 67 | EXAMPLE_PATTERNS = 68 | EXAMPLE_RECURSIVE = NO 69 | IMAGE_PATH = 70 | INPUT_FILTER = 71 | FILTER_PATTERNS = 72 | FILTER_SOURCE_FILES = NO 73 | SOURCE_BROWSER = NO 74 | INLINE_SOURCES = NO 75 | STRIP_CODE_COMMENTS = YES 76 | REFERENCED_BY_RELATION = YES 77 | REFERENCES_RELATION = YES 78 | REFERENCES_LINK_SOURCE = YES 79 | USE_HTAGS = NO 80 | VERBATIM_HEADERS = YES 81 | ALPHABETICAL_INDEX = NO 82 | COLS_IN_ALPHA_INDEX = 5 83 | IGNORE_PREFIX = 84 | GENERATE_HTML = YES 85 | HTML_OUTPUT = html 86 | HTML_FILE_EXTENSION = .html 87 | HTML_HEADER = 88 | HTML_FOOTER = 89 | HTML_STYLESHEET = 90 | HTML_ALIGN_MEMBERS = YES 91 | GENERATE_HTMLHELP = NO 92 | CHM_FILE = 93 | HHC_LOCATION = 94 | GENERATE_CHI = NO 95 | BINARY_TOC = NO 96 | TOC_EXPAND = NO 97 | DISABLE_INDEX = NO 98 | ENUM_VALUES_PER_LINE = 4 99 | GENERATE_TREEVIEW = NO 100 | TREEVIEW_WIDTH = 250 101 | GENERATE_LATEX = NO 102 | LATEX_OUTPUT = latex 103 | LATEX_CMD_NAME = latex 104 | MAKEINDEX_CMD_NAME = makeindex 105 | COMPACT_LATEX = NO 106 | PAPER_TYPE = a4wide 107 | EXTRA_PACKAGES = 108 | LATEX_HEADER = 109 | PDF_HYPERLINKS = NO 110 | USE_PDFLATEX = NO 111 | LATEX_BATCHMODE = NO 112 | LATEX_HIDE_INDICES = NO 113 | GENERATE_RTF = NO 114 | RTF_OUTPUT = rtf 115 | COMPACT_RTF = NO 116 | RTF_HYPERLINKS = NO 117 | RTF_STYLESHEET_FILE = 118 | RTF_EXTENSIONS_FILE = 119 | GENERATE_MAN = NO 120 | MAN_OUTPUT = man 121 | MAN_EXTENSION = .3 122 | MAN_LINKS = NO 123 | GENERATE_XML = NO 124 | XML_OUTPUT = xml 125 | XML_SCHEMA = 126 | XML_DTD = 127 | XML_PROGRAMLISTING = YES 128 | GENERATE_AUTOGEN_DEF = NO 129 | GENERATE_PERLMOD = NO 130 | PERLMOD_LATEX = NO 131 | PERLMOD_PRETTY = YES 132 | PERLMOD_MAKEVAR_PREFIX = 133 | ENABLE_PREPROCESSING = YES 134 | MACRO_EXPANSION = NO 135 | EXPAND_ONLY_PREDEF = NO 136 | SEARCH_INCLUDES = YES 137 | INCLUDE_PATH = 138 | INCLUDE_FILE_PATTERNS = 139 | PREDEFINED = 140 | EXPAND_AS_DEFINED = 141 | SKIP_FUNCTION_MACROS = YES 142 | TAGFILES = 143 | GENERATE_TAGFILE = 144 | ALLEXTERNALS = NO 145 | EXTERNAL_GROUPS = YES 146 | PERL_PATH = /usr/bin/perl 147 | CLASS_DIAGRAMS = YES 148 | HIDE_UNDOC_RELATIONS = YES 149 | HAVE_DOT = NO 150 | CLASS_GRAPH = YES 151 | COLLABORATION_GRAPH = YES 152 | GROUP_GRAPHS = YES 153 | UML_LOOK = NO 154 | TEMPLATE_RELATIONS = NO 155 | INCLUDE_GRAPH = YES 156 | INCLUDED_BY_GRAPH = YES 157 | CALL_GRAPH = NO 158 | CALLER_GRAPH = NO 159 | GRAPHICAL_HIERARCHY = YES 160 | DIRECTORY_GRAPH = YES 161 | DOT_IMAGE_FORMAT = png 162 | DOT_PATH = 163 | DOTFILE_DIRS = 164 | MAX_DOT_GRAPH_WIDTH = 1024 165 | MAX_DOT_GRAPH_HEIGHT = 1024 166 | MAX_DOT_GRAPH_DEPTH = 0 167 | DOT_TRANSPARENT = NO 168 | DOT_MULTI_TARGETS = NO 169 | GENERATE_LEGEND = YES 170 | DOT_CLEANUP = YES 171 | SEARCHENGINE = NO 172 | -------------------------------------------------------------------------------- /src/dl_creationadapter.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_CREATIONADAPTER_H 26 | #define DL_CREATIONADAPTER_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include "dl_creationinterface.h" 31 | 32 | /** 33 | * An abstract adapter class for receiving DXF events when a DXF file is being read. 34 | * The methods in this class are empty. This class exists as convenience for creating 35 | * listener objects. 36 | * 37 | * @author Andrew Mustun 38 | */ 39 | class DXFLIB_EXPORT DL_CreationAdapter : public DL_CreationInterface { 40 | public: 41 | DL_CreationAdapter() {} 42 | virtual ~DL_CreationAdapter() {} 43 | virtual void processCodeValuePair(unsigned int, const std::string&) {} 44 | virtual void endSection() {} 45 | virtual void addLayer(const DL_LayerData&) {} 46 | virtual void addLinetype(const DL_LinetypeData&) {} 47 | virtual void addLinetypeDash(double) {} 48 | virtual void addBlock(const DL_BlockData&) {} 49 | virtual void endBlock() {} 50 | virtual void addTextStyle(const DL_StyleData&) {} 51 | virtual void addPoint(const DL_PointData&) {} 52 | virtual void addLine(const DL_LineData&) {} 53 | virtual void addXLine(const DL_XLineData&) {} 54 | virtual void addRay(const DL_RayData&) {} 55 | 56 | virtual void addArc(const DL_ArcData&) {} 57 | virtual void addCircle(const DL_CircleData&) {} 58 | virtual void addEllipse(const DL_EllipseData&) {} 59 | 60 | virtual void addPolyline(const DL_PolylineData&) {} 61 | virtual void addVertex(const DL_VertexData&) {} 62 | 63 | virtual void addSpline(const DL_SplineData&) {} 64 | virtual void addControlPoint(const DL_ControlPointData&) {} 65 | virtual void addFitPoint(const DL_FitPointData&) {} 66 | virtual void addKnot(const DL_KnotData&) {} 67 | 68 | virtual void addInsert(const DL_InsertData&) {} 69 | 70 | virtual void addMText(const DL_MTextData&) {} 71 | virtual void addMTextChunk(const std::string&) {} 72 | virtual void addText(const DL_TextData&) {} 73 | virtual void addAttribute(const DL_AttributeData&) {} 74 | 75 | virtual void addDimAlign(const DL_DimensionData&, 76 | const DL_DimAlignedData&) {} 77 | virtual void addDimLinear(const DL_DimensionData&, 78 | const DL_DimLinearData&) {} 79 | virtual void addDimRadial(const DL_DimensionData&, 80 | const DL_DimRadialData&) {} 81 | virtual void addDimDiametric(const DL_DimensionData&, 82 | const DL_DimDiametricData&) {} 83 | virtual void addDimAngular(const DL_DimensionData&, 84 | const DL_DimAngularData&) {} 85 | virtual void addDimAngular3P(const DL_DimensionData&, 86 | const DL_DimAngular3PData&) {} 87 | virtual void addDimOrdinate(const DL_DimensionData&, 88 | const DL_DimOrdinateData&) {} 89 | virtual void addLeader(const DL_LeaderData&) {} 90 | virtual void addLeaderVertex(const DL_LeaderVertexData&) {} 91 | 92 | virtual void addHatch(const DL_HatchData&) {} 93 | 94 | virtual void addTrace(const DL_TraceData&) {} 95 | virtual void add3dFace(const DL_3dFaceData&) {} 96 | virtual void addSolid(const DL_SolidData&) {} 97 | 98 | virtual void addImage(const DL_ImageData&) {} 99 | virtual void linkImage(const DL_ImageDefData&) {} 100 | virtual void addHatchLoop(const DL_HatchLoopData&) {} 101 | virtual void addHatchEdge(const DL_HatchEdgeData&) {} 102 | 103 | virtual void addXRecord(const std::string&) {} 104 | virtual void addXRecordString(int, const std::string&) {} 105 | virtual void addXRecordReal(int, double) {} 106 | virtual void addXRecordInt(int, int) {} 107 | virtual void addXRecordBool(int, bool) {} 108 | 109 | virtual void addXDataApp(const std::string&) {} 110 | virtual void addXDataString(int, const std::string&) {} 111 | virtual void addXDataReal(int, double) {} 112 | virtual void addXDataInt(int, int) {} 113 | 114 | virtual void addDictionary(const DL_DictionaryData&) {} 115 | virtual void addDictionaryEntry(const DL_DictionaryEntryData&) {} 116 | 117 | virtual void endEntity() {} 118 | 119 | virtual void addComment(const std::string&) {} 120 | 121 | virtual void setVariableVector(const std::string&, double, double, double, int) {} 122 | virtual void setVariableString(const std::string&, const std::string&, int) {} 123 | virtual void setVariableInt(const std::string&, int, int) {} 124 | virtual void setVariableDouble(const std::string&, double, int) {} 125 | #ifdef DL_COMPAT 126 | virtual void setVariableVector(const char*, double, double, double, int) {} 127 | virtual void setVariableString(const char*, const char*, int) {} 128 | virtual void setVariableInt(const char*, int, int) {} 129 | virtual void setVariableDouble(const char*, double, int) {} 130 | virtual void processCodeValuePair(unsigned int, char*) {} 131 | virtual void addComment(const char*) {} 132 | virtual void addMTextChunk(const char*) {} 133 | #endif 134 | virtual void endSequence() {} 135 | }; 136 | 137 | #endif 138 | -------------------------------------------------------------------------------- /src/dl_attributes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_ATTRIBUTES_H 26 | #define DL_ATTRIBUTES_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include 31 | #include 32 | 33 | #include "dl_codes.h" 34 | 35 | /** 36 | * Storing and passing around attributes. Attributes 37 | * are the layer name, color, width and line type. 38 | * 39 | * @author Andrew Mustun 40 | */ 41 | class DXFLIB_EXPORT DL_Attributes { 42 | 43 | public: 44 | 45 | /** 46 | * Default constructor. 47 | */ 48 | DL_Attributes() : 49 | layer(""), 50 | color(0), 51 | color24(-1), 52 | width(0), 53 | linetype("BYLAYER"), 54 | linetypeScale(1.0), 55 | handle(-1), 56 | inPaperSpace(false) { 57 | } 58 | 59 | /** 60 | * Constructor for DXF attributes. 61 | * 62 | * @param layer Layer name for this entity or NULL for no layer 63 | * (every entity should be on a named layer!). 64 | * @param color Color number (0..256). 0 = BYBLOCK, 256 = BYLAYER. 65 | * @param width Line thickness. Defaults to zero. -1 = BYLAYER, 66 | * -2 = BYBLOCK, -3 = default width 67 | * @param linetype Line type name or "BYLAYER" or "BYBLOCK". Defaults 68 | * to "BYLAYER" 69 | */ 70 | DL_Attributes(const std::string& layer, 71 | int color, int width, 72 | const std::string& linetype, 73 | double linetypeScale) : 74 | layer(layer), 75 | color(color), 76 | color24(-1), 77 | width(width), 78 | linetype(linetype), 79 | linetypeScale(linetypeScale), 80 | handle(-1), 81 | inPaperSpace(false) { 82 | 83 | } 84 | 85 | /** 86 | * Constructor for DXF attributes. 87 | * 88 | * @param layer Layer name for this entity or NULL for no layer 89 | * (every entity should be on a named layer!). 90 | * @param color Color number (0..256). 0 = BYBLOCK, 256 = BYLAYER. 91 | * @param color24 24 bit color (see DXF reference). 92 | * @param width Line thickness. Defaults to zero. -1 = BYLAYER, 93 | * -2 = BYBLOCK, -3 = default width 94 | * @param linetype Line type name or "BYLAYER" or "BYBLOCK". Defaults 95 | * to "BYLAYER" 96 | */ 97 | DL_Attributes(const std::string& layer, 98 | int color, int color24, int width, 99 | const std::string& linetype, 100 | int handle=-1) : 101 | layer(layer), 102 | color(color), 103 | color24(color24), 104 | width(width), 105 | linetype(linetype), 106 | linetypeScale(1.0), 107 | handle(handle), 108 | inPaperSpace(false) { 109 | } 110 | 111 | /** 112 | * Sets the layer. If the given pointer points to NULL, the 113 | * new layer name will be an empty but valid string. 114 | */ 115 | void setLayer(const std::string& layer) { 116 | this->layer = layer; 117 | } 118 | 119 | /** 120 | * @return Layer name. 121 | */ 122 | std::string getLayer() const { 123 | return layer; 124 | } 125 | 126 | /** 127 | * Sets the color. 128 | * 129 | * @see DL_Codes, dxfColors 130 | */ 131 | void setColor(int color) { 132 | this->color = color; 133 | } 134 | 135 | /** 136 | * Sets the 24bit color. 137 | * 138 | * @see DL_Codes, dxfColors 139 | */ 140 | void setColor24(int color) { 141 | this->color24 = color; 142 | } 143 | 144 | /** 145 | * @return Color. 146 | * 147 | * @see DL_Codes, dxfColors 148 | */ 149 | int getColor() const { 150 | return color; 151 | } 152 | 153 | /** 154 | * @return 24 bit color or -1 if no 24bit color is defined. 155 | * 156 | * @see DL_Codes, dxfColors 157 | */ 158 | int getColor24() const { 159 | return color24; 160 | } 161 | 162 | /** 163 | * Sets the width. 164 | */ 165 | void setWidth(int width) { 166 | this->width = width; 167 | } 168 | 169 | /** 170 | * @return Width. 171 | */ 172 | int getWidth() const { 173 | return width; 174 | } 175 | 176 | /** 177 | * Sets the line type. This can be any string and is not 178 | * checked to be a valid line type. 179 | */ 180 | void setLinetype(const std::string& linetype) { 181 | this->linetype = linetype; 182 | } 183 | 184 | /** 185 | * Sets the entity specific line type scale. 186 | */ 187 | void setLinetypeScale(double linetypeScale) { 188 | this->linetypeScale = linetypeScale; 189 | } 190 | 191 | double getLinetypeScale() const { 192 | return linetypeScale; 193 | } 194 | 195 | /** 196 | * @return Line type. 197 | */ 198 | std::string getLinetype() const { 199 | if (linetype.length()==0) { 200 | return "BYLAYER"; 201 | } else { 202 | return linetype; 203 | } 204 | } 205 | 206 | void setHandle(int h) { 207 | handle = h; 208 | } 209 | 210 | int getHandle() const { 211 | return handle; 212 | } 213 | 214 | void setInPaperSpace(bool on) { 215 | inPaperSpace = on; 216 | } 217 | 218 | bool isInPaperSpace() { 219 | return inPaperSpace; 220 | } 221 | 222 | private: 223 | std::string layer; 224 | int color; 225 | int color24; 226 | int width; 227 | std::string linetype; 228 | double linetypeScale; 229 | int handle; 230 | 231 | // DXF code 67 (true: entity in paper space, false: entity in model space (default): 232 | bool inPaperSpace; 233 | }; 234 | 235 | #endif 236 | 237 | // EOF 238 | -------------------------------------------------------------------------------- /examples/readwrite/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @file main.cpp 3 | */ 4 | 5 | /***************************************************************************** 6 | ** $Id: main.cpp 3591 2006-10-18 21:23:25Z andrew $ 7 | ** 8 | ** This is part of the dxflib library 9 | ** Copyright (C) 2000-2001 Andrew Mustun 10 | ** 11 | ** This program is free software; you can redistribute it and/or modify 12 | ** it under the terms of the GNU Library General Public License as 13 | ** published by the Free Software Foundation. 14 | ** 15 | ** This program is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU Library General Public License for more details. 19 | ** 20 | ** You should have received a copy of the GNU Library General Public License 21 | ** along with this program; if not, write to the Free Software 22 | ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | ******************************************************************************/ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "dl_dxf.h" 30 | #include "dl_creationadapter.h" 31 | 32 | #include "test_creationclass.h" 33 | 34 | void usage(); 35 | void testReading(char* file); 36 | void testWriting(); 37 | 38 | 39 | /* 40 | * @brief Main function for DXFLib test program. 41 | * 42 | * @param argc Number of delimited items on command line, 43 | * including program name. 44 | * @param argv Pointer to array of command line items 45 | * 46 | * @retval 0 if missing input file argument or 47 | * file couldn't be opened 48 | * @retval 1 if file opened 49 | */ 50 | int main(int argc, char** argv) { 51 | 52 | // Check given arguments: 53 | if (argc<2) { 54 | usage(); 55 | return 0; 56 | } 57 | 58 | testReading(argv[1]); 59 | 60 | testWriting(); 61 | 62 | return 0; 63 | } 64 | 65 | 66 | 67 | /* 68 | * @brief Prints error message if file name not specified as command 69 | * line argument. 70 | */ 71 | void usage() { 72 | std::cout << "\nUsage: test \n\n"; 73 | } 74 | 75 | 76 | void testReading(char* file) { 77 | // Load DXF file into memory: 78 | std::cout << "Reading file " << file << "...\n"; 79 | Test_CreationClass* creationClass = new Test_CreationClass(); 80 | DL_Dxf* dxf = new DL_Dxf(); 81 | if (!dxf->in(file, creationClass)) { // if file open failed 82 | std::cerr << file << " could not be opened.\n"; 83 | return; 84 | } 85 | delete dxf; 86 | delete creationClass; 87 | } 88 | 89 | 90 | 91 | void testWriting() { 92 | DL_Dxf* dxf = new DL_Dxf(); 93 | DL_Codes::version exportVersion = DL_Codes::AC1015; 94 | DL_WriterA* dw = dxf->out("myfile.dxf", exportVersion); 95 | if (dw==NULL) { 96 | printf("Cannot open file 'myfile.dxf' \ 97 | for writing."); 98 | // abort function e.g. with return 99 | } 100 | 101 | dxf->writeHeader(*dw); 102 | /* 103 | // int variable: 104 | dw->dxfString(9, "$INSUNITS"); 105 | dw->dxfInt(70, 4); 106 | // real (double, float) variable: 107 | dw->dxfString(9, "$DIMEXE"); 108 | dw->dxfReal(40, 1.25); 109 | // string variable: 110 | dw->dxfString(9, "$TEXTSTYLE"); 111 | dw->dxfString(7, "Standard"); 112 | // vector variable: 113 | dw->dxfString(9, "$LIMMIN"); 114 | dw->dxfReal(10, 0.0); 115 | dw->dxfReal(20, 0.0); 116 | */ 117 | dw->sectionEnd(); 118 | dw->sectionTables(); 119 | dxf->writeVPort(*dw); 120 | 121 | dw->tableLinetypes(3); 122 | dxf->writeLinetype(*dw, DL_LinetypeData("BYBLOCK", "BYBLOCK", 0, 0, 0.0)); 123 | dxf->writeLinetype(*dw, DL_LinetypeData("BYLAYER", "BYLAYER", 0, 0, 0.0)); 124 | dxf->writeLinetype(*dw, DL_LinetypeData("CONTINUOUS", "Continuous", 0, 0, 0.0)); 125 | dw->tableEnd(); 126 | 127 | int numberOfLayers = 3; 128 | dw->tableLayers(numberOfLayers); 129 | 130 | dxf->writeLayer(*dw, 131 | DL_LayerData("0", 0), 132 | DL_Attributes( 133 | std::string(""), // leave empty 134 | DL_Codes::black, // default color 135 | 100, // default width 136 | "CONTINUOUS", 1.0)); // default line style 137 | 138 | dxf->writeLayer(*dw, 139 | DL_LayerData("mainlayer", 0), 140 | DL_Attributes( 141 | std::string(""), 142 | DL_Codes::red, 143 | 100, 144 | "CONTINUOUS", 1.0)); 145 | 146 | dxf->writeLayer(*dw, 147 | DL_LayerData("anotherlayer", 0), 148 | DL_Attributes( 149 | std::string(""), 150 | DL_Codes::black, 151 | 100, 152 | "CONTINUOUS", 1.0)); 153 | 154 | dw->tableEnd(); 155 | 156 | dw->tableStyle(1); 157 | dxf->writeStyle(*dw, DL_StyleData("standard", 0, 2.5, 1.0, 0.0, 0, 2.5, "txt", "")); 158 | dw->tableEnd(); 159 | 160 | dxf->writeView(*dw); 161 | dxf->writeUcs(*dw); 162 | 163 | dw->tableAppid(1); 164 | dxf->writeAppid(*dw, "ACAD"); 165 | dw->tableEnd(); 166 | 167 | dxf->writeDimStyle(*dw, 1, 1, 1, 1, 1); 168 | 169 | dxf->writeBlockRecord(*dw); 170 | dxf->writeBlockRecord(*dw, "myblock1"); 171 | dxf->writeBlockRecord(*dw, "myblock2"); 172 | dw->tableEnd(); 173 | 174 | dw->sectionEnd(); 175 | 176 | dw->sectionBlocks(); 177 | dxf->writeBlock(*dw, DL_BlockData("*Model_Space", 0, 0.0, 0.0, 0.0)); 178 | dxf->writeEndBlock(*dw, "*Model_Space"); 179 | dxf->writeBlock(*dw, DL_BlockData("*Paper_Space", 0, 0.0, 0.0, 0.0)); 180 | dxf->writeEndBlock(*dw, "*Paper_Space"); 181 | dxf->writeBlock(*dw, DL_BlockData("*Paper_Space0", 0, 0.0, 0.0, 0.0)); 182 | dxf->writeEndBlock(*dw, "*Paper_Space0"); 183 | 184 | dxf->writeBlock(*dw, DL_BlockData("myblock1", 0, 0.0, 0.0, 0.0)); 185 | // ... 186 | // write block entities e.g. with dxf->writeLine(), .. 187 | // ... 188 | dxf->writeEndBlock(*dw, "myblock1"); 189 | 190 | dxf->writeBlock(*dw, DL_BlockData("myblock2", 0, 0.0, 0.0, 0.0)); 191 | // ... 192 | // write block entities e.g. with dxf->writeLine(), .. 193 | // ... 194 | dxf->writeEndBlock(*dw, "myblock2"); 195 | 196 | dw->sectionEnd(); 197 | dw->sectionEntities(); 198 | 199 | // write all entities in model space: 200 | dxf->writePoint( 201 | *dw, 202 | DL_PointData(10.0, 203 | 45.0, 204 | 0.0), 205 | DL_Attributes("mainlayer", 256, -1, "BYLAYER", 1.0)); 206 | 207 | dxf->writeLine( 208 | *dw, 209 | DL_LineData(25.0, // start point 210 | 30.0, 211 | 0.0, 212 | 100.0, // end point 213 | 120.0, 214 | 0.0), 215 | DL_Attributes("mainlayer", 256, -1, "BYLAYER", 1.0)); 216 | 217 | dw->sectionEnd(); 218 | 219 | dxf->writeObjects(*dw); 220 | dxf->writeObjectsEnd(*dw); 221 | 222 | dw->dxfEOF(); 223 | dw->close(); 224 | delete dw; 225 | delete dxf; 226 | } 227 | 228 | -------------------------------------------------------------------------------- /dxflib_commercial_license.txt: -------------------------------------------------------------------------------- 1 | dxflib COMMERCIAL LICENSE AGREEMENT 2 | FOR PROFESSIONAL EDITIONS 3 | Agreement version 1.2 4 | 5 | IMPORTANT-READ CAREFULLY: 6 | 1. This RibbonSoft End-User License Agreement ("Agreement") is a legal 7 | agreement between you (either an individual or a legal entity) 8 | ("Licensee") and RibbonSoft GmbH ("RibbonSoft") for the RibbonSoft 9 | software product(s) accompanying this Agreement, which include(s) 10 | computer software and may include "online" or electronic documentation, 11 | associated media, and printed materials, including the source code, 12 | example programs and the documentation ("Licensed Software"). 13 | 14 | 2. The Licensed Software is protected by copyright laws and 15 | international copyright treaties, as well as other intellectual 16 | property laws and treaties. The Licensed Software is licensed, not 17 | sold. 18 | 19 | 3. By installing, copying, or otherwise using the Licensed Software, 20 | Licensee agrees to be bound by the terms of this Agreement. If 21 | Licensee does not agree to the terms of this Agreement, Licensee may 22 | not install, copy, or otherwise use the Licensed Software. 23 | 24 | 4. Upon Licensee's acceptance of the terms and conditions of this 25 | Agreement, RibbonSoft grants Licensee the right to use the Licensed 26 | Software in the manner provided below. 27 | 28 | 5. RibbonSoft grants to Licensee as an individual a royalty-free, 29 | personal, non-exclusive, non-transferable, perpetual license to make 30 | and use copies of the Licensed Software for the sole purposes of 31 | designing, developing, and testing Licensee's software product(s) 32 | ("Applications"). Licensee may install copies of the Licensed Software 33 | on an unlimited number of computers provided that Licensee is the only 34 | individual using the Licensed Software. If Licensee is an entity, 35 | RibbonSoft grants Licensee the right to designate one, and only one, 36 | individual within Licensee's organization who shall have the sole 37 | right to use the Licensed Software in the manner provided 38 | above. Licensee may at any time, but not more frequently that once 39 | every six (6) months, designate another individual within Licensee's 40 | organization to replace the current designated user by notifying 41 | RibbonSoft, so long as there is no more than one designated user at any 42 | given time. 43 | 44 | GENERAL TERMS THAT APPLY TO APPLICATIONS AND REDISTRIBUTABLES 45 | 6. RibbonSoft grants Licensee a nonexclusive, royalty-free right to 46 | reproduce and distribute the object code form of certain portions of the 47 | Licensed Software ("Redistributables"), as specified in Appendix 1, 48 | Section 1, for execution on any operating system. Copies of 49 | Redistributables may only be distributed with and for the sole purpose 50 | of executing Applications permitted under this Agreement that Licensee 51 | has created using the Licensed Software. Under no circumstances may any 52 | copies of Redistributables be distributed separately. This Agreement 53 | does not give Licensee any rights to distribute any of the parts of 54 | the Licensed Software listed in Appendix 1, Section 2, neither as a 55 | whole nor as parts or snippets of code. 56 | 57 | 7. The license granted in this Agreement for Licensee to create 58 | Applications and distribute them to Licensee's customers is subject 59 | to all of the following conditions: 60 | (i) Licensee will indemnify and hold RibbonSoft, its related companies 61 | and its suppliers, harmless from and against any claims or liabilities 62 | arising out of the use, reproduction or distribution of Applications; 63 | (ii) Applications must be developed using a licensed, registered copy 64 | of the Licensed Software; (iii) Applications must add primary and 65 | substantial functionality to the Licensed Software; (iv) Applications 66 | may not pass on functionality which in any way makes it possible for 67 | others to create software with the Licensed Software; (v) Applications 68 | may not compete with the Licensed Software; (iv) Licensee may not use 69 | RibbonSoft's or any of its suppliers' names, logos, or trademarks to 70 | market Application(s), except to state that Application was developed 71 | using the Licensed Software. 72 | 73 | NOTE: dxflib Open Source Edition is licensed under the terms of the 74 | GPL and not under this Agreement. If Licensee has, at any time, 75 | developed all (or any portions of) the Application(s) using RibbonSoft's 76 | publicly licensed dxflib Open Source Edition, Licensee must comply 77 | with RibbonSoft's requirements and license such Application(s) 78 | (or any portions derived there from) under the terms of the Free Software 79 | Foundation's GNU General Public License version 2 (the "GPL") a copy of 80 | which is located at http://www.gnu.org/copyleft/gpl.html#SEC1 81 | (i.e., any Product(s) and/or parts, components, portions thereof developed 82 | using GPL licensed software, including dxflib Open Source Edition, must 83 | be licensed under the terms of the GPL, and the GPL-based source code must 84 | be made available upon request). 85 | 86 | WARRANTY DISCLAIMER 87 | 8. The Licensed Software is licensed to Licensee "as is". To the 88 | maximum extent permitted by applicable law, RibbonSoft on behalf of 89 | itself and its suppliers, disclaims all warranties and conditions, 90 | either express or implied, including, but not limited to, implied 91 | warranties of merchantability, fitness for a particular purpose, title 92 | and non-infringement with regard to the Licensed Software. 93 | 94 | LIMITATION OF LIABILITY 95 | 9. If, RibbonSoft's warranty disclaimer notwithstanding, RibbonSoft is 96 | held liable to Licensee, whether in contract, tort or any other legal 97 | theory, based on the Licensed Software, RibbonSoft's entire liability 98 | to Licensee and Licensee's exclusive remedy shall be, at RibbonSoft's 99 | option, either (A) return of the price Licensee paid for the Licensed 100 | Software, or (B) repair or replacement of the Licensed Software, 101 | provided Licensee returns to RibbonSoft all copies of the Licensed 102 | Software as originally delivered to Licensee. RibbonSoft shall not 103 | under any circumstances be liable to Licensee based on failure of the 104 | Licensed Software if the failure resulted from accident, abuse or 105 | misapplication, nor shall RibbonSoft under any circumstances be liable 106 | for special damages, punitive or exemplary damages, damages for loss 107 | of profits or interruption of business or for loss or corruption of 108 | data. Any award of damages from RibbonSoft to Licensee shall not exceed 109 | the total amount Licensee has paid to RibbonSoft in connection with 110 | this Agreement. 111 | 112 | SUPPORT AND UPDATES 113 | 10. Licensee will be eligible to access to Updates ("Updates") to 114 | the Licensed Software for a period not to exceed one year from the 115 | date of initial delivery ("Initial Term"), in accordance with 116 | RibbonSoft's then current policies and procedures, if any. Such 117 | policies and procedures may be changed from time to time. Following 118 | the Initial Term, RibbonSoft will no longer make the Licensed Software 119 | available to Licensee unless Licensee purchases additional Updates 120 | according to section 11 below. 121 | 122 | GENERAL PROVISIONS 123 | 11. Licensee Name: RibbonSoft may include Licensee's company name in a 124 | publicly available list of RibbonSoft customers. 125 | 126 | 12. Renewal of Updates: Licensee may purchase additional Updates 127 | following the Initial Term at RibbonSoft's terms and conditions 128 | applicable at the time of renewal. 129 | 130 | 13. No Assignment: Neither this Agreement nor Licensee's rights under 131 | this Agreement are assignable or transferable by Licensee either in 132 | whole or in part to any third party without RibbonSoft's written 133 | consent. Any attempted assignment or transfer in violation of the 134 | foregoing shall be void. RibbonSoft may assign or transfer this 135 | Agreement to any third party who acquires substantially all of 136 | RibbonSoft copyrights in and to the Licensed Software. 137 | 138 | 14. Termination: RibbonSoft may terminate the Agreement at any time 139 | immediately upon written notice by RibbonSoft to Licensee if Licensee 140 | breaches this Agreement, fails to pay the fees for the Licensed 141 | Software, or infringes RibbonSoft's intellectual property in or to the 142 | Licensed Software. Upon termination of the Licenses, Licensee shall 143 | return to RibbonSoft all copies of Licensed Software that were supplied 144 | by RibbonSoft. All other copies of Licensed Software in the possession 145 | or control of Licensee must be erased or destroyed. An officer of 146 | Licensee must promptly deliver to RibbonSoft a written confirmation 147 | that this has occurred. 148 | 149 | 15. Entire Agreement: This Agreement constitutes the complete 150 | agreement between the parties and supersedes all prior or 151 | contemporaneous discussions, representations, and proposals, written 152 | or oral, with respect to the subject matters discussed herein. No 153 | modification of this Agreement will be effective unless contained in a 154 | writing executed by an authorized representative of each party. No 155 | term or condition contained in Licensee's purchase order will apply 156 | unless expressly accepted by RibbonSoft in writing. If any provision of 157 | the Agreement is found void or unenforceable, the remainder will 158 | remain valid and enforceable according to its terms. If any remedy 159 | provided is determined to have failed for its essential purpose, all 160 | limitations of liability and exclusions of damages set forth in this 161 | Agreement shall remain in effect. 162 | 163 | 16. Governing law, legal venue: This Agreement shall be construed, 164 | interpreted and governed by the laws of Switzerland, the legal venue 165 | to be Zurich City Court. RibbonSoft reserves all rights not specifically 166 | granted in this Agreement. 167 | 168 | Appendix 1: 169 | 170 | 1. Parts of the Licensed Software that are permitted for distribution 171 | ("Redistributables"): 172 | 173 | - The Licensed Software's library in object code form 174 | 175 | 2. Parts of the Licensed Software that are not permitted for distribution 176 | include, but are not limited to: 177 | 178 | - The Licensed Software's source code and header files 179 | - The Licensed Software's documentation 180 | -------------------------------------------------------------------------------- /src/dl_creationinterface.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_CREATIONINTERFACE_H 26 | #define DL_CREATIONINTERFACE_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include 31 | 32 | #include "dl_attributes.h" 33 | #include "dl_codes.h" 34 | #include "dl_entities.h" 35 | #include "dl_extrusion.h" 36 | 37 | /** 38 | * Abstract class (interface) for the creation of new entities. 39 | * Inherit your class which takes care of the entities in the 40 | * processed DXF file from this interface. 41 | * 42 | * Double arrays passed to your implementation contain 3 double 43 | * values for x, y, z coordinates unless stated differently. 44 | * 45 | * @author Andrew Mustun 46 | */ 47 | class DXFLIB_EXPORT DL_CreationInterface { 48 | public: 49 | DL_CreationInterface() { 50 | extrusion = new DL_Extrusion; 51 | } 52 | virtual ~DL_CreationInterface() { 53 | delete extrusion; 54 | } 55 | 56 | /** 57 | * Called for every code / value tuple of the DXF file. The complete DXF file 58 | * contents can be handled by the implemetation of this function. 59 | */ 60 | virtual void processCodeValuePair(unsigned int groupCode, const std::string& groupValue) = 0; 61 | 62 | /** 63 | * Called when a section (entity, table entry, etc.) is finished. 64 | */ 65 | virtual void endSection() = 0; 66 | 67 | /** 68 | * Called for every layer. 69 | */ 70 | virtual void addLayer(const DL_LayerData& data) = 0; 71 | 72 | /** 73 | * Called for every linetype. 74 | */ 75 | virtual void addLinetype(const DL_LinetypeData& data) = 0; 76 | 77 | /** 78 | * Called for every dash in linetype pattern 79 | */ 80 | virtual void addLinetypeDash(double length) = 0; 81 | 82 | /** 83 | * Called for every block. Note: all entities added after this 84 | * command go into this block until endBlock() is called. 85 | * 86 | * @see endBlock() 87 | */ 88 | virtual void addBlock(const DL_BlockData& data) = 0; 89 | 90 | /** Called to end the current block */ 91 | virtual void endBlock() = 0; 92 | 93 | /** Called for every text style */ 94 | virtual void addTextStyle(const DL_StyleData& data) = 0; 95 | 96 | /** Called for every point */ 97 | virtual void addPoint(const DL_PointData& data) = 0; 98 | 99 | /** Called for every line */ 100 | virtual void addLine(const DL_LineData& data) = 0; 101 | 102 | /** Called for every xline */ 103 | virtual void addXLine(const DL_XLineData& data) = 0; 104 | 105 | /** Called for every ray */ 106 | virtual void addRay(const DL_RayData& data) = 0; 107 | 108 | /** Called for every arc */ 109 | virtual void addArc(const DL_ArcData& data) = 0; 110 | 111 | /** Called for every circle */ 112 | virtual void addCircle(const DL_CircleData& data) = 0; 113 | 114 | /** Called for every ellipse */ 115 | virtual void addEllipse(const DL_EllipseData& data) = 0; 116 | 117 | /** Called for every polyline start */ 118 | virtual void addPolyline(const DL_PolylineData& data) = 0; 119 | 120 | /** Called for every polyline vertex */ 121 | virtual void addVertex(const DL_VertexData& data) = 0; 122 | 123 | /** Called for every spline */ 124 | virtual void addSpline(const DL_SplineData& data) = 0; 125 | 126 | /** Called for every spline control point */ 127 | virtual void addControlPoint(const DL_ControlPointData& data) = 0; 128 | 129 | /** Called for every spline fit point */ 130 | virtual void addFitPoint(const DL_FitPointData& data) = 0; 131 | 132 | /** Called for every spline knot value */ 133 | virtual void addKnot(const DL_KnotData& data) = 0; 134 | 135 | /** Called for every insert. */ 136 | virtual void addInsert(const DL_InsertData& data) = 0; 137 | 138 | /** Called for every trace start */ 139 | virtual void addTrace(const DL_TraceData& data) = 0; 140 | 141 | /** Called for every 3dface start */ 142 | virtual void add3dFace(const DL_3dFaceData& data) = 0; 143 | 144 | /** Called for every solid start */ 145 | virtual void addSolid(const DL_SolidData& data) = 0; 146 | 147 | 148 | /** Called for every Multi Text entity. */ 149 | virtual void addMText(const DL_MTextData& data) = 0; 150 | 151 | /** 152 | * Called for additional text chunks for MTEXT entities. 153 | * The chunks come at 250 character in size each. Note that 154 | * those chunks come before the actual MTEXT entity. 155 | */ 156 | virtual void addMTextChunk(const std::string& text) = 0; 157 | 158 | /** Called for every Text entity. */ 159 | virtual void addText(const DL_TextData& data) = 0; 160 | 161 | /** Called for every Block Attribute entity. */ 162 | virtual void addAttribute(const DL_AttributeData& data) = 0; 163 | 164 | /** 165 | * Called for every aligned dimension entity. 166 | */ 167 | virtual void addDimAlign(const DL_DimensionData& data, 168 | const DL_DimAlignedData& edata) = 0; 169 | /** 170 | * Called for every linear or rotated dimension entity. 171 | */ 172 | virtual void addDimLinear(const DL_DimensionData& data, 173 | const DL_DimLinearData& edata) = 0; 174 | 175 | /** 176 | * Called for every radial dimension entity. 177 | */ 178 | virtual void addDimRadial(const DL_DimensionData& data, 179 | const DL_DimRadialData& edata) = 0; 180 | 181 | /** 182 | * Called for every diametric dimension entity. 183 | */ 184 | virtual void addDimDiametric(const DL_DimensionData& data, 185 | const DL_DimDiametricData& edata) = 0; 186 | 187 | /** 188 | * Called for every angular dimension (2 lines version) entity. 189 | */ 190 | virtual void addDimAngular(const DL_DimensionData& data, 191 | const DL_DimAngularData& edata) = 0; 192 | 193 | /** 194 | * Called for every angular dimension (3 points version) entity. 195 | */ 196 | virtual void addDimAngular3P(const DL_DimensionData& data, 197 | const DL_DimAngular3PData& edata) = 0; 198 | 199 | /** 200 | * Called for every ordinate dimension entity. 201 | */ 202 | virtual void addDimOrdinate(const DL_DimensionData& data, 203 | const DL_DimOrdinateData& edata) = 0; 204 | 205 | /** 206 | * Called for every leader start. 207 | */ 208 | virtual void addLeader(const DL_LeaderData& data) = 0; 209 | 210 | /** 211 | * Called for every leader vertex 212 | */ 213 | virtual void addLeaderVertex(const DL_LeaderVertexData& data) = 0; 214 | 215 | /** 216 | * Called for every hatch entity. 217 | */ 218 | virtual void addHatch(const DL_HatchData& data) = 0; 219 | 220 | /** 221 | * Called for every image entity. 222 | */ 223 | virtual void addImage(const DL_ImageData& data) = 0; 224 | 225 | /** 226 | * Called for every image definition. 227 | */ 228 | virtual void linkImage(const DL_ImageDefData& data) = 0; 229 | 230 | /** 231 | * Called for every hatch loop. 232 | */ 233 | virtual void addHatchLoop(const DL_HatchLoopData& data) = 0; 234 | 235 | /** 236 | * Called for every hatch edge entity. 237 | */ 238 | virtual void addHatchEdge(const DL_HatchEdgeData& data) = 0; 239 | 240 | /** 241 | * Called for every XRecord with the given handle. 242 | */ 243 | virtual void addXRecord(const std::string& handle) = 0; 244 | 245 | /** 246 | * Called for XRecords of type string. 247 | */ 248 | virtual void addXRecordString(int code, const std::string& value) = 0; 249 | 250 | /** 251 | * Called for XRecords of type double. 252 | */ 253 | virtual void addXRecordReal(int code, double value) = 0; 254 | 255 | /** 256 | * Called for XRecords of type int. 257 | */ 258 | virtual void addXRecordInt(int code, int value) = 0; 259 | 260 | /** 261 | * Called for XRecords of type bool. 262 | */ 263 | virtual void addXRecordBool(int code, bool value) = 0; 264 | 265 | /** 266 | * Called for every beginning of an XData section of the given application. 267 | */ 268 | virtual void addXDataApp(const std::string& appId) = 0; 269 | 270 | /** 271 | * Called for XData tuples. 272 | */ 273 | virtual void addXDataString(int code, const std::string& value) = 0; 274 | 275 | /** 276 | * Called for XData tuples. 277 | */ 278 | virtual void addXDataReal(int code, double value) = 0; 279 | 280 | /** 281 | * Called for XData tuples. 282 | */ 283 | virtual void addXDataInt(int code, int value) = 0; 284 | 285 | /** 286 | * Called for dictionary objects. 287 | */ 288 | virtual void addDictionary(const DL_DictionaryData& data) = 0; 289 | 290 | /** 291 | * Called for dictionary entries. 292 | */ 293 | virtual void addDictionaryEntry(const DL_DictionaryEntryData& data) = 0; 294 | 295 | /** 296 | * Called after an entity has been completed. 297 | */ 298 | virtual void endEntity() = 0; 299 | 300 | /** 301 | * Called for every comment in the DXF file (code 999). 302 | */ 303 | virtual void addComment(const std::string& comment) = 0; 304 | 305 | /** 306 | * Called for every vector variable in the DXF file (e.g. "$EXTMIN"). 307 | */ 308 | virtual void setVariableVector(const std::string& key, double v1, double v2, double v3, int code) = 0; 309 | 310 | /** 311 | * Called for every string variable in the DXF file (e.g. "$ACADVER"). 312 | */ 313 | virtual void setVariableString(const std::string& key, const std::string& value, int code) = 0; 314 | 315 | /** 316 | * Called for every int variable in the DXF file (e.g. "$ACADMAINTVER"). 317 | */ 318 | virtual void setVariableInt(const std::string& key, int value, int code) = 0; 319 | 320 | /** 321 | * Called for every double variable in the DXF file (e.g. "$DIMEXO"). 322 | */ 323 | virtual void setVariableDouble(const std::string& key, double value, int code) = 0; 324 | 325 | #ifdef DL_COMPAT 326 | virtual void setVariableVector(const char* key, double v1, double v2, double v3, int code) = 0; 327 | virtual void setVariableString(const char* key, const char* value, int code) = 0; 328 | virtual void setVariableInt(const char* key, int value, int code) = 0; 329 | virtual void setVariableDouble(const char* key, double value, int code) = 0; 330 | virtual void processCodeValuePair(unsigned int groupCode, char* groupValue) = 0; 331 | virtual void addComment(const char* comment) = 0; 332 | virtual void addMTextChunk(const char* text) = 0; 333 | #endif 334 | 335 | /** 336 | * Called when a SEQEND occurs (when a POLYLINE or ATTRIB is done) 337 | */ 338 | virtual void endSequence() = 0; 339 | 340 | /** Sets the current attributes for entities. */ 341 | void setAttributes(const DL_Attributes& attrib) { 342 | attributes = attrib; 343 | } 344 | 345 | /** @return the current attributes used for new entities. */ 346 | DL_Attributes getAttributes() { 347 | return attributes; 348 | } 349 | 350 | /** Sets the current attributes for entities. */ 351 | void setExtrusion(double dx, double dy, double dz, double elevation) { 352 | extrusion->setDirection(dx, dy, dz); 353 | extrusion->setElevation(elevation); 354 | } 355 | 356 | /** @return the current attributes used for new entities. */ 357 | DL_Extrusion* getExtrusion() { 358 | return extrusion; 359 | } 360 | 361 | protected: 362 | DL_Attributes attributes; 363 | DL_Extrusion *extrusion; 364 | }; 365 | 366 | #endif 367 | -------------------------------------------------------------------------------- /examples/readwrite/myfile.dxf: -------------------------------------------------------------------------------- 1 | 999 2 | dxflib 3.12.2.0 3 | 0 4 | SECTION 5 | 2 6 | HEADER 7 | 9 8 | $ACADVER 9 | 1 10 | AC1015 11 | 9 12 | $HANDSEED 13 | 5 14 | FFFF 15 | 0 16 | ENDSEC 17 | 0 18 | SECTION 19 | 2 20 | TABLES 21 | 0 22 | TABLE 23 | 2 24 | VPORT 25 | 5 26 | 8 27 | 100 28 | AcDbSymbolTable 29 | 70 30 | 1 31 | 0 32 | VPORT 33 | 5 34 | 30 35 | 100 36 | AcDbSymbolTableRecord 37 | 100 38 | AcDbViewportTableRecord 39 | 2 40 | *Active 41 | 70 42 | 0 43 | 10 44 | 0.0 45 | 20 46 | 0.0 47 | 11 48 | 1.0 49 | 21 50 | 1.0 51 | 12 52 | 286.3055555555554861 53 | 22 54 | 148.5 55 | 13 56 | 0.0 57 | 23 58 | 0.0 59 | 14 60 | 10.0 61 | 24 62 | 10.0 63 | 15 64 | 10.0 65 | 25 66 | 10.0 67 | 16 68 | 0.0 69 | 26 70 | 0.0 71 | 36 72 | 1.0 73 | 17 74 | 0.0 75 | 27 76 | 0.0 77 | 37 78 | 0.0 79 | 40 80 | 297.0 81 | 41 82 | 1.92798353909465 83 | 42 84 | 50.0 85 | 43 86 | 0.0 87 | 44 88 | 0.0 89 | 50 90 | 0.0 91 | 51 92 | 0.0 93 | 71 94 | 0 95 | 72 96 | 100 97 | 73 98 | 1 99 | 74 100 | 3 101 | 75 102 | 1 103 | 76 104 | 1 105 | 77 106 | 0 107 | 78 108 | 0 109 | 281 110 | 0 111 | 65 112 | 1 113 | 110 114 | 0.0 115 | 120 116 | 0.0 117 | 130 118 | 0.0 119 | 111 120 | 1.0 121 | 121 122 | 0.0 123 | 131 124 | 0.0 125 | 112 126 | 0.0 127 | 122 128 | 1.0 129 | 132 130 | 0.0 131 | 79 132 | 0 133 | 146 134 | 0.0 135 | 0 136 | ENDTAB 137 | 0 138 | TABLE 139 | 2 140 | LTYPE 141 | 5 142 | 5 143 | 100 144 | AcDbSymbolTable 145 | 70 146 | 3 147 | 0 148 | LTYPE 149 | 5 150 | 14 151 | 100 152 | AcDbSymbolTableRecord 153 | 100 154 | AcDbLinetypeTableRecord 155 | 2 156 | BYBLOCK 157 | 70 158 | 0 159 | 3 160 | 161 | 72 162 | 65 163 | 73 164 | 0 165 | 40 166 | 0.0 167 | 0 168 | LTYPE 169 | 5 170 | 15 171 | 100 172 | AcDbSymbolTableRecord 173 | 100 174 | AcDbLinetypeTableRecord 175 | 2 176 | BYLAYER 177 | 70 178 | 0 179 | 3 180 | 181 | 72 182 | 65 183 | 73 184 | 0 185 | 40 186 | 0.0 187 | 0 188 | LTYPE 189 | 5 190 | 16 191 | 100 192 | AcDbSymbolTableRecord 193 | 100 194 | AcDbLinetypeTableRecord 195 | 2 196 | CONTINUOUS 197 | 70 198 | 0 199 | 3 200 | Solid line 201 | 72 202 | 65 203 | 73 204 | 0 205 | 40 206 | 0.0 207 | 0 208 | ENDTAB 209 | 0 210 | TABLE 211 | 2 212 | LAYER 213 | 5 214 | 2 215 | 100 216 | AcDbSymbolTable 217 | 70 218 | 3 219 | 0 220 | LAYER 221 | 5 222 | 10 223 | 100 224 | AcDbSymbolTableRecord 225 | 100 226 | AcDbLayerTableRecord 227 | 2 228 | 0 229 | 70 230 | 0 231 | 62 232 | 250 233 | 6 234 | CONTINUOUS 235 | 370 236 | 100 237 | 390 238 | F 239 | 0 240 | LAYER 241 | 5 242 | 31 243 | 100 244 | AcDbSymbolTableRecord 245 | 100 246 | AcDbLayerTableRecord 247 | 2 248 | mainlayer 249 | 70 250 | 0 251 | 62 252 | 1 253 | 6 254 | CONTINUOUS 255 | 370 256 | 100 257 | 390 258 | F 259 | 0 260 | LAYER 261 | 5 262 | 32 263 | 100 264 | AcDbSymbolTableRecord 265 | 100 266 | AcDbLayerTableRecord 267 | 2 268 | anotherlayer 269 | 70 270 | 0 271 | 62 272 | 250 273 | 6 274 | CONTINUOUS 275 | 370 276 | 100 277 | 390 278 | F 279 | 0 280 | ENDTAB 281 | 0 282 | TABLE 283 | 2 284 | STYLE 285 | 5 286 | 3 287 | 100 288 | AcDbSymbolTable 289 | 70 290 | 1 291 | 0 292 | STYLE 293 | 5 294 | 33 295 | 100 296 | AcDbSymbolTableRecord 297 | 100 298 | AcDbTextStyleTableRecord 299 | 2 300 | standard 301 | 70 302 | 0 303 | 40 304 | 2.5 305 | 41 306 | 1.0 307 | 50 308 | 0.0 309 | 71 310 | 0 311 | 42 312 | 2.5 313 | 3 314 | 315 | 4 316 | 317 | 1001 318 | ACAD 319 | 1000 320 | txt 321 | 1071 322 | 0 323 | 0 324 | ENDTAB 325 | 0 326 | TABLE 327 | 2 328 | VIEW 329 | 5 330 | 6 331 | 100 332 | AcDbSymbolTable 333 | 70 334 | 0 335 | 0 336 | ENDTAB 337 | 0 338 | TABLE 339 | 2 340 | UCS 341 | 5 342 | 7 343 | 100 344 | AcDbSymbolTable 345 | 70 346 | 0 347 | 0 348 | ENDTAB 349 | 0 350 | TABLE 351 | 2 352 | APPID 353 | 5 354 | 9 355 | 100 356 | AcDbSymbolTable 357 | 70 358 | 1 359 | 0 360 | APPID 361 | 5 362 | 12 363 | 100 364 | AcDbSymbolTableRecord 365 | 100 366 | AcDbRegAppTableRecord 367 | 2 368 | ACAD 369 | 70 370 | 0 371 | 0 372 | ENDTAB 373 | 0 374 | TABLE 375 | 2 376 | DIMSTYLE 377 | 5 378 | A 379 | 100 380 | AcDbSymbolTable 381 | 70 382 | 1 383 | 100 384 | AcDbDimStyleTable 385 | 71 386 | 0 387 | 0 388 | DIMSTYLE 389 | 105 390 | 27 391 | 100 392 | AcDbSymbolTableRecord 393 | 100 394 | AcDbDimStyleTableRecord 395 | 2 396 | Standard 397 | 41 398 | 1.0 399 | 42 400 | 1.0 401 | 43 402 | 3.75 403 | 44 404 | 1.0 405 | 70 406 | 0 407 | 73 408 | 0 409 | 74 410 | 0 411 | 77 412 | 1 413 | 78 414 | 8 415 | 140 416 | 1.0 417 | 141 418 | 2.5 419 | 143 420 | 0.03937007874016 421 | 147 422 | 1.0 423 | 171 424 | 3 425 | 172 426 | 1 427 | 271 428 | 2 429 | 272 430 | 2 431 | 274 432 | 3 433 | 278 434 | 44 435 | 283 436 | 0 437 | 284 438 | 8 439 | 340 440 | 0 441 | 0 442 | ENDTAB 443 | 0 444 | TABLE 445 | 2 446 | BLOCK_RECORD 447 | 5 448 | 1 449 | 100 450 | AcDbSymbolTable 451 | 70 452 | 1 453 | 0 454 | BLOCK_RECORD 455 | 5 456 | 1F 457 | 100 458 | AcDbSymbolTableRecord 459 | 100 460 | AcDbBlockTableRecord 461 | 2 462 | *Model_Space 463 | 340 464 | 22 465 | 0 466 | BLOCK_RECORD 467 | 5 468 | 1B 469 | 100 470 | AcDbSymbolTableRecord 471 | 100 472 | AcDbBlockTableRecord 473 | 2 474 | *Paper_Space 475 | 340 476 | 1E 477 | 0 478 | BLOCK_RECORD 479 | 5 480 | 23 481 | 100 482 | AcDbSymbolTableRecord 483 | 100 484 | AcDbBlockTableRecord 485 | 2 486 | *Paper_Space0 487 | 340 488 | 26 489 | 0 490 | BLOCK_RECORD 491 | 5 492 | 34 493 | 100 494 | AcDbSymbolTableRecord 495 | 100 496 | AcDbBlockTableRecord 497 | 2 498 | myblock1 499 | 340 500 | 0 501 | 0 502 | BLOCK_RECORD 503 | 5 504 | 35 505 | 100 506 | AcDbSymbolTableRecord 507 | 100 508 | AcDbBlockTableRecord 509 | 2 510 | myblock2 511 | 340 512 | 0 513 | 0 514 | ENDTAB 515 | 0 516 | ENDSEC 517 | 0 518 | SECTION 519 | 2 520 | BLOCKS 521 | 0 522 | BLOCK 523 | 5 524 | 20 525 | 100 526 | AcDbEntity 527 | 8 528 | 0 529 | 100 530 | AcDbBlockBegin 531 | 2 532 | *Model_Space 533 | 70 534 | 0 535 | 10 536 | 0.0 537 | 20 538 | 0.0 539 | 30 540 | 0.0 541 | 3 542 | *Model_Space 543 | 1 544 | 545 | 0 546 | ENDBLK 547 | 5 548 | 21 549 | 100 550 | AcDbEntity 551 | 8 552 | 0 553 | 100 554 | AcDbBlockEnd 555 | 0 556 | BLOCK 557 | 5 558 | 1C 559 | 100 560 | AcDbEntity 561 | 67 562 | 1 563 | 8 564 | 0 565 | 100 566 | AcDbBlockBegin 567 | 2 568 | *Paper_Space 569 | 70 570 | 0 571 | 10 572 | 0.0 573 | 20 574 | 0.0 575 | 30 576 | 0.0 577 | 3 578 | *Paper_Space 579 | 1 580 | 581 | 0 582 | ENDBLK 583 | 5 584 | 1D 585 | 100 586 | AcDbEntity 587 | 67 588 | 1 589 | 8 590 | 0 591 | 100 592 | AcDbBlockEnd 593 | 0 594 | BLOCK 595 | 5 596 | 24 597 | 100 598 | AcDbEntity 599 | 8 600 | 0 601 | 100 602 | AcDbBlockBegin 603 | 2 604 | *Paper_Space0 605 | 70 606 | 0 607 | 10 608 | 0.0 609 | 20 610 | 0.0 611 | 30 612 | 0.0 613 | 3 614 | *Paper_Space0 615 | 1 616 | 617 | 0 618 | ENDBLK 619 | 5 620 | 25 621 | 100 622 | AcDbEntity 623 | 8 624 | 0 625 | 100 626 | AcDbBlockEnd 627 | 0 628 | BLOCK 629 | 5 630 | 36 631 | 100 632 | AcDbEntity 633 | 8 634 | 0 635 | 100 636 | AcDbBlockBegin 637 | 2 638 | myblock1 639 | 70 640 | 0 641 | 10 642 | 0.0 643 | 20 644 | 0.0 645 | 30 646 | 0.0 647 | 3 648 | myblock1 649 | 1 650 | 651 | 0 652 | ENDBLK 653 | 5 654 | 37 655 | 100 656 | AcDbEntity 657 | 8 658 | 0 659 | 100 660 | AcDbBlockEnd 661 | 0 662 | BLOCK 663 | 5 664 | 38 665 | 100 666 | AcDbEntity 667 | 8 668 | 0 669 | 100 670 | AcDbBlockBegin 671 | 2 672 | myblock2 673 | 70 674 | 0 675 | 10 676 | 0.0 677 | 20 678 | 0.0 679 | 30 680 | 0.0 681 | 3 682 | myblock2 683 | 1 684 | 685 | 0 686 | ENDBLK 687 | 5 688 | 39 689 | 100 690 | AcDbEntity 691 | 8 692 | 0 693 | 100 694 | AcDbBlockEnd 695 | 0 696 | ENDSEC 697 | 0 698 | SECTION 699 | 2 700 | ENTITIES 701 | 0 702 | POINT 703 | 5 704 | 3A 705 | 100 706 | AcDbEntity 707 | 100 708 | AcDbPoint 709 | 8 710 | mainlayer 711 | 62 712 | 256 713 | 370 714 | -1 715 | 48 716 | 1.0 717 | 6 718 | BYLAYER 719 | 10 720 | 10.0 721 | 20 722 | 45.0 723 | 30 724 | 0.0 725 | 0 726 | LINE 727 | 5 728 | 3B 729 | 100 730 | AcDbEntity 731 | 100 732 | AcDbLine 733 | 8 734 | mainlayer 735 | 62 736 | 256 737 | 370 738 | -1 739 | 48 740 | 1.0 741 | 6 742 | BYLAYER 743 | 10 744 | 25.0 745 | 20 746 | 30.0 747 | 30 748 | 0.0 749 | 11 750 | 100.0 751 | 21 752 | 120.0 753 | 31 754 | 0.0 755 | 0 756 | ENDSEC 757 | 0 758 | SECTION 759 | 2 760 | OBJECTS 761 | 0 762 | DICTIONARY 763 | 5 764 | C 765 | 100 766 | AcDbDictionary 767 | 280 768 | 0 769 | 281 770 | 1 771 | 3 772 | ACAD_GROUP 773 | 350 774 | D 775 | 3 776 | ACAD_LAYOUT 777 | 350 778 | 1A 779 | 3 780 | ACAD_MLINESTYLE 781 | 350 782 | 17 783 | 3 784 | ACAD_PLOTSETTINGS 785 | 350 786 | 19 787 | 3 788 | ACAD_PLOTSTYLENAME 789 | 350 790 | E 791 | 3 792 | AcDbVariableDictionary 793 | 350 794 | 3C 795 | 0 796 | DICTIONARY 797 | 5 798 | D 799 | 100 800 | AcDbDictionary 801 | 280 802 | 0 803 | 281 804 | 1 805 | 0 806 | ACDBDICTIONARYWDFLT 807 | 5 808 | E 809 | 100 810 | AcDbDictionary 811 | 281 812 | 1 813 | 3 814 | Normal 815 | 350 816 | F 817 | 100 818 | AcDbDictionaryWithDefault 819 | 340 820 | F 821 | 0 822 | ACDBPLACEHOLDER 823 | 5 824 | F 825 | 0 826 | DICTIONARY 827 | 5 828 | 17 829 | 100 830 | AcDbDictionary 831 | 280 832 | 0 833 | 281 834 | 1 835 | 3 836 | Standard 837 | 350 838 | 18 839 | 0 840 | MLINESTYLE 841 | 5 842 | 18 843 | 100 844 | AcDbMlineStyle 845 | 2 846 | STANDARD 847 | 70 848 | 0 849 | 3 850 | 851 | 62 852 | 256 853 | 51 854 | 90.0 855 | 52 856 | 90.0 857 | 71 858 | 2 859 | 49 860 | 0.5 861 | 62 862 | 256 863 | 6 864 | BYLAYER 865 | 49 866 | -0.5 867 | 62 868 | 256 869 | 6 870 | BYLAYER 871 | 0 872 | DICTIONARY 873 | 5 874 | 19 875 | 100 876 | AcDbDictionary 877 | 280 878 | 0 879 | 281 880 | 1 881 | 0 882 | DICTIONARY 883 | 5 884 | 1A 885 | 100 886 | AcDbDictionary 887 | 281 888 | 1 889 | 3 890 | Layout1 891 | 350 892 | 1E 893 | 3 894 | Layout2 895 | 350 896 | 26 897 | 3 898 | Model 899 | 350 900 | 22 901 | 0 902 | LAYOUT 903 | 5 904 | 1E 905 | 100 906 | AcDbPlotSettings 907 | 1 908 | 909 | 2 910 | none_device 911 | 4 912 | 913 | 6 914 | 915 | 40 916 | 0.0 917 | 41 918 | 0.0 919 | 42 920 | 0.0 921 | 43 922 | 0.0 923 | 44 924 | 0.0 925 | 45 926 | 0.0 927 | 46 928 | 0.0 929 | 47 930 | 0.0 931 | 48 932 | 0.0 933 | 49 934 | 0.0 935 | 140 936 | 0.0 937 | 141 938 | 0.0 939 | 142 940 | 1.0 941 | 143 942 | 1.0 943 | 70 944 | 688 945 | 72 946 | 0 947 | 73 948 | 0 949 | 74 950 | 5 951 | 7 952 | 953 | 75 954 | 16 955 | 147 956 | 1.0 957 | 148 958 | 0.0 959 | 149 960 | 0.0 961 | 100 962 | AcDbLayout 963 | 1 964 | Layout1 965 | 70 966 | 1 967 | 71 968 | 1 969 | 10 970 | 0.0 971 | 20 972 | 0.0 973 | 11 974 | 420.0 975 | 21 976 | 297.0 977 | 12 978 | 0.0 979 | 22 980 | 0.0 981 | 32 982 | 0.0 983 | 14 984 | 100000000000000000000.0 985 | 24 986 | 100000000000000000000.0 987 | 34 988 | 100000000000000000000.0 989 | 15 990 | -100000000000000000000.0 991 | 25 992 | -100000000000000000000.0 993 | 35 994 | -100000000000000000000.0 995 | 146 996 | 0.0 997 | 13 998 | 0.0 999 | 23 1000 | 0.0 1001 | 33 1002 | 0.0 1003 | 16 1004 | 1.0 1005 | 26 1006 | 0.0 1007 | 36 1008 | 0.0 1009 | 17 1010 | 0.0 1011 | 27 1012 | 1.0 1013 | 37 1014 | 0.0 1015 | 76 1016 | 0 1017 | 330 1018 | 1B 1019 | 0 1020 | LAYOUT 1021 | 5 1022 | 22 1023 | 100 1024 | AcDbPlotSettings 1025 | 1 1026 | 1027 | 2 1028 | none_device 1029 | 4 1030 | 1031 | 6 1032 | 1033 | 40 1034 | 0.0 1035 | 41 1036 | 0.0 1037 | 42 1038 | 0.0 1039 | 43 1040 | 0.0 1041 | 44 1042 | 0.0 1043 | 45 1044 | 0.0 1045 | 46 1046 | 0.0 1047 | 47 1048 | 0.0 1049 | 48 1050 | 0.0 1051 | 49 1052 | 0.0 1053 | 140 1054 | 0.0 1055 | 141 1056 | 0.0 1057 | 142 1058 | 1.0 1059 | 143 1060 | 1.0 1061 | 70 1062 | 1712 1063 | 72 1064 | 0 1065 | 73 1066 | 0 1067 | 74 1068 | 0 1069 | 7 1070 | 1071 | 75 1072 | 0 1073 | 147 1074 | 1.0 1075 | 148 1076 | 0.0 1077 | 149 1078 | 0.0 1079 | 100 1080 | AcDbLayout 1081 | 1 1082 | Model 1083 | 70 1084 | 1 1085 | 71 1086 | 0 1087 | 10 1088 | 0.0 1089 | 20 1090 | 0.0 1091 | 11 1092 | 12.0 1093 | 21 1094 | 9.0 1095 | 12 1096 | 0.0 1097 | 22 1098 | 0.0 1099 | 32 1100 | 0.0 1101 | 14 1102 | 0.0 1103 | 24 1104 | 0.0 1105 | 34 1106 | 0.0 1107 | 15 1108 | 0.0 1109 | 25 1110 | 0.0 1111 | 35 1112 | 0.0 1113 | 146 1114 | 0.0 1115 | 13 1116 | 0.0 1117 | 23 1118 | 0.0 1119 | 33 1120 | 0.0 1121 | 16 1122 | 1.0 1123 | 26 1124 | 0.0 1125 | 36 1126 | 0.0 1127 | 17 1128 | 0.0 1129 | 27 1130 | 1.0 1131 | 37 1132 | 0.0 1133 | 76 1134 | 0 1135 | 330 1136 | 1F 1137 | 0 1138 | LAYOUT 1139 | 5 1140 | 26 1141 | 100 1142 | AcDbPlotSettings 1143 | 1 1144 | 1145 | 2 1146 | none_device 1147 | 4 1148 | 1149 | 6 1150 | 1151 | 40 1152 | 0.0 1153 | 41 1154 | 0.0 1155 | 42 1156 | 0.0 1157 | 43 1158 | 0.0 1159 | 44 1160 | 0.0 1161 | 45 1162 | 0.0 1163 | 46 1164 | 0.0 1165 | 47 1166 | 0.0 1167 | 48 1168 | 0.0 1169 | 49 1170 | 0.0 1171 | 140 1172 | 0.0 1173 | 141 1174 | 0.0 1175 | 142 1176 | 1.0 1177 | 143 1178 | 1.0 1179 | 70 1180 | 688 1181 | 72 1182 | 0 1183 | 73 1184 | 0 1185 | 74 1186 | 5 1187 | 7 1188 | 1189 | 75 1190 | 16 1191 | 147 1192 | 1.0 1193 | 148 1194 | 0.0 1195 | 149 1196 | 0.0 1197 | 100 1198 | AcDbLayout 1199 | 1 1200 | Layout2 1201 | 70 1202 | 1 1203 | 71 1204 | 2 1205 | 10 1206 | 0.0 1207 | 20 1208 | 0.0 1209 | 11 1210 | 12.0 1211 | 21 1212 | 9.0 1213 | 12 1214 | 0.0 1215 | 22 1216 | 0.0 1217 | 32 1218 | 0.0 1219 | 14 1220 | 0.0 1221 | 24 1222 | 0.0 1223 | 34 1224 | 0.0 1225 | 15 1226 | 0.0 1227 | 25 1228 | 0.0 1229 | 35 1230 | 0.0 1231 | 146 1232 | 0.0 1233 | 13 1234 | 0.0 1235 | 23 1236 | 0.0 1237 | 33 1238 | 0.0 1239 | 16 1240 | 1.0 1241 | 26 1242 | 0.0 1243 | 36 1244 | 0.0 1245 | 17 1246 | 0.0 1247 | 27 1248 | 1.0 1249 | 37 1250 | 0.0 1251 | 76 1252 | 0 1253 | 330 1254 | 23 1255 | 0 1256 | DICTIONARY 1257 | 5 1258 | 3C 1259 | 100 1260 | AcDbDictionary 1261 | 281 1262 | 1 1263 | 3 1264 | DIMASSOC 1265 | 350 1266 | 3E 1267 | 3 1268 | HIDETEXT 1269 | 350 1270 | 3D 1271 | 0 1272 | DICTIONARYVAR 1273 | 5 1274 | 3D 1275 | 100 1276 | DictionaryVariables 1277 | 280 1278 | 0 1279 | 1 1280 | 2 1281 | 0 1282 | DICTIONARYVAR 1283 | 5 1284 | 3E 1285 | 100 1286 | DictionaryVariables 1287 | 280 1288 | 0 1289 | 1 1290 | 1 1291 | 0 1292 | ENDSEC 1293 | 0 1294 | EOF 1295 | -------------------------------------------------------------------------------- /debian/libdxflib3.symbols: -------------------------------------------------------------------------------- 1 | --- debian/symbols (libdxflib3_3.12.2-1_amd64) 2 | +++ dpkg-gensymbolsbVsR8b 2016-01-09 22:31:04.260117532 +0000 3 | @@ -0,0 +1,206 @@ 4 | +libdxflib.so.3 libdxflib3 #MINVER# 5 | + _ZN10DL_WriterA10strReplaceEPccc@Base 3.12.2-1 6 | + _ZN10DL_WriterAD0Ev@Base 3.12.2-1 7 | + _ZN10DL_WriterAD1Ev@Base 3.12.2-1 8 | + _ZN10DL_WriterAD2Ev@Base 3.12.2-1 9 | + _ZN11DL_TextDataD1Ev@Base 3.12.2-1 10 | + _ZN11DL_TextDataD2Ev@Base 3.12.2-1 11 | + _ZN13DL_AttributesD1Ev@Base 3.12.2-1 12 | + _ZN13DL_AttributesD2Ev@Base 3.12.2-1 13 | + _ZN16DL_DimensionDataD1Ev@Base 3.12.2-1 14 | + _ZN16DL_DimensionDataD2Ev@Base 3.12.2-1 15 | + _ZN16DL_HatchEdgeDataC1ERKS_@Base 3.12.2-1 16 | + _ZN16DL_HatchEdgeDataC2ERKS_@Base 3.12.2-1 17 | + _ZN16DL_HatchEdgeDataD1Ev@Base 3.12.2-1 18 | + _ZN16DL_HatchEdgeDataD2Ev@Base 3.12.2-1 19 | + _ZN18DL_CreationAdapter10addCommentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 20 | + _ZN18DL_CreationAdapter11addXDataIntEii@Base 3.12.2-1 21 | + _ZN18DL_CreationAdapter11endSequenceEv@Base 3.12.2-1 22 | + _ZN18DL_CreationAdapter12addXDataRealEid@Base 3.12.2-1 23 | + _ZN18DL_CreationAdapter14addDimOrdinateERK16DL_DimensionDataRK18DL_DimOrdinateData@Base 3.12.2-1 24 | + _ZN18DL_CreationAdapter14addXDataStringEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 25 | + _ZN18DL_CreationAdapter14addXRecordBoolEib@Base 3.12.2-1 26 | + _ZN18DL_CreationAdapter14setVariableIntERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii@Base 3.12.2-1 27 | + _ZN18DL_CreationAdapter15addLinetypeDashEd@Base 3.12.2-1 28 | + _ZN18DL_CreationAdapter17setVariableDoubleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEdi@Base 3.12.2-1 29 | + _ZN18DL_CreationAdapter17setVariableStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_i@Base 3.12.2-1 30 | + _ZN18DL_CreationAdapter17setVariableVectorERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEdddi@Base 3.12.2-1 31 | + _ZN18DL_CreationAdapter20processCodeValuePairEjRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 32 | + _ZN22DL_DictionaryEntryDataD1Ev@Base 3.12.2-1 33 | + _ZN22DL_DictionaryEntryDataD2Ev@Base 3.12.2-1 34 | + _ZN6DL_Dxf10addCommentEP20DL_CreationInterfaceRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 35 | + _ZN6DL_Dxf10addEllipseEP20DL_CreationInterface@Base 3.12.2-1 36 | + _ZN6DL_Dxf10addSettingEP20DL_CreationInterface@Base 3.12.2-1 37 | + _ZN6DL_Dxf10getDimDataEv@Base 3.12.2-1 38 | + _ZN6DL_Dxf10writeAppidER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 39 | + _ZN6DL_Dxf10writeBlockER10DL_WriterARK12DL_BlockData@Base 3.12.2-1 40 | + _ZN6DL_Dxf10writeImageER10DL_WriterARK12DL_ImageDataRK13DL_Attributes@Base 3.12.2-1 41 | + _ZN6DL_Dxf10writeLayerER10DL_WriterARK12DL_LayerDataRK13DL_Attributes@Base 3.12.2-1 42 | + _ZN6DL_Dxf10writeMTextER10DL_WriterARK12DL_MTextDataRK13DL_Attributes@Base 3.12.2-1 43 | + _ZN6DL_Dxf10writePointER10DL_WriterARK12DL_PointDataRK13DL_Attributes@Base 3.12.2-1 44 | + _ZN6DL_Dxf10writeSolidER10DL_WriterARK12DL_TraceDataRK13DL_Attributes@Base 3.12.2-1 45 | + _ZN6DL_Dxf10writeStyleER10DL_WriterARK12DL_StyleData@Base 3.12.2-1 46 | + _ZN6DL_Dxf10writeTraceER10DL_WriterARK12DL_TraceDataRK13DL_Attributes@Base 3.12.2-1 47 | + _ZN6DL_Dxf10writeVPortER10DL_WriterA@Base 3.12.2-1 48 | + _ZN6DL_Dxf10writeXLineER10DL_WriterARK12DL_XLineDataRK13DL_Attributes@Base 3.12.2-1 49 | + _ZN6DL_Dxf11addImageDefEP20DL_CreationInterface@Base 3.12.2-1 50 | + _ZN6DL_Dxf11addLinetypeEP20DL_CreationInterface@Base 3.12.2-1 51 | + _ZN6DL_Dxf11addPolylineEP20DL_CreationInterface@Base 3.12.2-1 52 | + _ZN6DL_Dxf11endSequenceEP20DL_CreationInterface@Base 3.12.2-1 53 | + _ZN6DL_Dxf11getIntValueEii@Base 3.12.2-1 54 | + _ZN6DL_Dxf11handleXDataEP20DL_CreationInterface@Base 3.12.2-1 55 | + _ZN6DL_Dxf11write3dFaceER10DL_WriterARK12DL_TraceDataRK13DL_Attributes@Base 3.12.2-1 56 | + _ZN6DL_Dxf11writeCircleER10DL_WriterARK13DL_CircleDataRK13DL_Attributes@Base 3.12.2-1 57 | + _ZN6DL_Dxf11writeHatch1ER10DL_WriterARK12DL_HatchDataRK13DL_Attributes@Base 3.12.2-1 58 | + _ZN6DL_Dxf11writeHatch2ER10DL_WriterARK12DL_HatchDataRK13DL_Attributes@Base 3.12.2-1 59 | + _ZN6DL_Dxf11writeHeaderER10DL_WriterA@Base 3.12.2-1 60 | + _ZN6DL_Dxf11writeInsertER10DL_WriterARK13DL_InsertDataRK13DL_Attributes@Base 3.12.2-1 61 | + _ZN6DL_Dxf11writeLeaderER10DL_WriterARK13DL_LeaderDataRK13DL_Attributes@Base 3.12.2-1 62 | + _ZN6DL_Dxf11writeSplineER10DL_WriterARK13DL_SplineDataRK13DL_Attributes@Base 3.12.2-1 63 | + _ZN6DL_Dxf11writeVertexER10DL_WriterARK13DL_VertexData@Base 3.12.2-1 64 | + _ZN6DL_Dxf12addAttributeEP20DL_CreationInterface@Base 3.12.2-1 65 | + _ZN6DL_Dxf12addDimLinearEP20DL_CreationInterface@Base 3.12.2-1 66 | + _ZN6DL_Dxf12addDimRadialEP20DL_CreationInterface@Base 3.12.2-1 67 | + _ZN6DL_Dxf12addHatchEdgeEv@Base 3.12.2-1 68 | + _ZN6DL_Dxf12addHatchLoopEv@Base 3.12.2-1 69 | + _ZN6DL_Dxf12addTextStyleEP20DL_CreationInterface@Base 3.12.2-1 70 | + _ZN6DL_Dxf12getRealValueEid@Base 3.12.2-1 71 | + _ZN6DL_Dxf12writeCommentER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 72 | + _ZN6DL_Dxf12writeEllipseER10DL_WriterARK14DL_EllipseDataRK13DL_Attributes@Base 3.12.2-1 73 | + _ZN6DL_Dxf12writeObjectsER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 74 | + _ZN6DL_Dxf12writeXRecordER10DL_WriterAiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 75 | + _ZN6DL_Dxf12writeXRecordER10DL_WriterAib@Base 3.12.2-1 76 | + _ZN6DL_Dxf12writeXRecordER10DL_WriterAid@Base 3.12.2-1 77 | + _ZN6DL_Dxf12writeXRecordER10DL_WriterAii@Base 3.12.2-1 78 | + _ZN6DL_Dxf13addDictionaryEP20DL_CreationInterface@Base 3.12.2-1 79 | + _ZN6DL_Dxf13addDimAlignedEP20DL_CreationInterface@Base 3.12.2-1 80 | + _ZN6DL_Dxf13addDimAngularEP20DL_CreationInterface@Base 3.12.2-1 81 | + _ZN6DL_Dxf13checkVariableEPKcN8DL_Codes7versionE@Base 3.12.2-1 82 | + _ZN6DL_Dxf13getLibVersionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 83 | + _ZN6DL_Dxf13readDxfGroupsEP8_IO_FILEP20DL_CreationInterface@Base 3.12.2-1 84 | + _ZN6DL_Dxf13readDxfGroupsERNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEEP20DL_CreationInterface@Base 3.12.2-1 85 | + _ZN6DL_Dxf13writeDimStyleER10DL_WriterAddddd@Base 3.12.2-1 86 | + _ZN6DL_Dxf13writeEndBlockER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 87 | + _ZN6DL_Dxf13writeFitPointER10DL_WriterARK15DL_FitPointData@Base 3.12.2-1 88 | + _ZN6DL_Dxf13writeImageDefER10DL_WriterAiRK12DL_ImageData@Base 3.12.2-1 89 | + _ZN6DL_Dxf13writeLinetypeER10DL_WriterARK15DL_LinetypeData@Base 3.12.2-1 90 | + _ZN6DL_Dxf13writePolylineER10DL_WriterARK15DL_PolylineDataRK13DL_Attributes@Base 3.12.2-1 91 | + _ZN6DL_Dxf14addDimOrdinateEP20DL_CreationInterface@Base 3.12.2-1 92 | + _ZN6DL_Dxf14getStringValueEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 93 | + _ZN6DL_Dxf14writeAttributeER10DL_WriterARK16DL_AttributeDataRK13DL_Attributes@Base 3.12.2-1 94 | + _ZN6DL_Dxf14writeDimLinearER10DL_WriterARK16DL_DimensionDataRK16DL_DimLinearDataRK13DL_Attributes@Base 3.12.2-1 95 | + _ZN6DL_Dxf14writeDimRadialER10DL_WriterARK16DL_DimensionDataRK16DL_DimRadialDataRK13DL_Attributes@Base 3.12.2-1 96 | + _ZN6DL_Dxf14writeHatchEdgeER10DL_WriterARK16DL_HatchEdgeData@Base 3.12.2-1 97 | + _ZN6DL_Dxf15addDimAngular3PEP20DL_CreationInterface@Base 3.12.2-1 98 | + _ZN6DL_Dxf15addDimDiametricEP20DL_CreationInterface@Base 3.12.2-1 99 | + _ZN6DL_Dxf15getStrippedLineERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjP8_IO_FILEb@Base 3.12.2-1 100 | + _ZN6DL_Dxf15getStrippedLineERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjRNS0_18basic_stringstreamIcS3_S4_EEb@Base 3.12.2-1 101 | + _ZN6DL_Dxf15handleHatchDataEP20DL_CreationInterface@Base 3.12.2-1 102 | + _ZN6DL_Dxf15handleMTextDataEP20DL_CreationInterface@Base 3.12.2-1 103 | + _ZN6DL_Dxf15processDXFGroupEP20DL_CreationInterfaceiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 104 | + _ZN6DL_Dxf15stripWhiteSpaceEPPcb@Base 3.12.2-1 105 | + _ZN6DL_Dxf15writeDimAlignedER10DL_WriterARK16DL_DimensionDataRK17DL_DimAlignedDataRK13DL_Attributes@Base 3.12.2-1 106 | + _ZN6DL_Dxf15writeDimAngularER10DL_WriterARK16DL_DimensionDataRK17DL_DimAngularDataRK13DL_Attributes@Base 3.12.2-1 107 | + _ZN6DL_Dxf15writeHatchLoop1ER10DL_WriterARK16DL_HatchLoopData@Base 3.12.2-1 108 | + _ZN6DL_Dxf15writeHatchLoop2ER10DL_WriterARK16DL_HatchLoopData@Base 3.12.2-1 109 | + _ZN6DL_Dxf15writeObjectsEndER10DL_WriterA@Base 3.12.2-1 110 | + _ZN6DL_Dxf16handleLeaderDataEP20DL_CreationInterface@Base 3.12.2-1 111 | + _ZN6DL_Dxf16handleSplineDataEP20DL_CreationInterface@Base 3.12.2-1 112 | + _ZN6DL_Dxf16writeBlockRecordER10DL_WriterA@Base 3.12.2-1 113 | + _ZN6DL_Dxf16writeBlockRecordER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 114 | + _ZN6DL_Dxf16writeDimOrdinateER10DL_WriterARK16DL_DimensionDataRK18DL_DimOrdinateDataRK13DL_Attributes@Base 3.12.2-1 115 | + _ZN6DL_Dxf16writePolylineEndER10DL_WriterA@Base 3.12.2-1 116 | + _ZN6DL_Dxf17handleXRecordDataEP20DL_CreationInterface@Base 3.12.2-1 117 | + _ZN6DL_Dxf17writeControlPointER10DL_WriterARK19DL_ControlPointData@Base 3.12.2-1 118 | + _ZN6DL_Dxf17writeDimAngular3PER10DL_WriterARK16DL_DimensionDataRK19DL_DimAngular3PDataRK13DL_Attributes@Base 3.12.2-1 119 | + _ZN6DL_Dxf17writeDimDiametricER10DL_WriterARK16DL_DimensionDataRK19DL_DimDiametricDataRK13DL_Attributes@Base 3.12.2-1 120 | + _ZN6DL_Dxf17writeLeaderVertexER10DL_WriterARK19DL_LeaderVertexData@Base 3.12.2-1 121 | + _ZN6DL_Dxf18addDictionaryEntryEP20DL_CreationInterface@Base 3.12.2-1 122 | + _ZN6DL_Dxf18handleLinetypeDataEP20DL_CreationInterface@Base 3.12.2-1 123 | + _ZN6DL_Dxf18writeAppDictionaryER10DL_WriterA@Base 3.12.2-1 124 | + _ZN6DL_Dxf20handleDictionaryDataEP20DL_CreationInterface@Base 3.12.2-1 125 | + _ZN6DL_Dxf20handleLWPolylineDataEP20DL_CreationInterface@Base 3.12.2-1 126 | + _ZN6DL_Dxf20writeDictionaryEntryER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 127 | + _ZN6DL_Dxf22writeDimStyleOverridesER10DL_WriterARK16DL_DimensionData@Base 3.12.2-1 128 | + _ZN6DL_Dxf2inERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP20DL_CreationInterface@Base 3.12.2-1 129 | + _ZN6DL_Dxf2inERNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEEP20DL_CreationInterface@Base 3.12.2-1 130 | + _ZN6DL_Dxf3outEPKcN8DL_Codes7versionE@Base 3.12.2-1 131 | + _ZN6DL_Dxf4testEv@Base 3.12.2-1 132 | + _ZN6DL_Dxf6addArcEP20DL_CreationInterface@Base 3.12.2-1 133 | + _ZN6DL_Dxf6addRayEP20DL_CreationInterface@Base 3.12.2-1 134 | + _ZN6DL_Dxf6toRealERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 135 | + _ZN6DL_Dxf7addLineEP20DL_CreationInterface@Base 3.12.2-1 136 | + _ZN6DL_Dxf7addTextEP20DL_CreationInterface@Base 3.12.2-1 137 | + _ZN6DL_Dxf8addBlockEP20DL_CreationInterface@Base 3.12.2-1 138 | + _ZN6DL_Dxf8addHatchEP20DL_CreationInterface@Base 3.12.2-1 139 | + _ZN6DL_Dxf8addImageEP20DL_CreationInterface@Base 3.12.2-1 140 | + _ZN6DL_Dxf8addLayerEP20DL_CreationInterface@Base 3.12.2-1 141 | + _ZN6DL_Dxf8addMTextEP20DL_CreationInterface@Base 3.12.2-1 142 | + _ZN6DL_Dxf8addPointEP20DL_CreationInterface@Base 3.12.2-1 143 | + _ZN6DL_Dxf8addSolidEP20DL_CreationInterface@Base 3.12.2-1 144 | + _ZN6DL_Dxf8addTraceEP20DL_CreationInterface@Base 3.12.2-1 145 | + _ZN6DL_Dxf8addXLineEP20DL_CreationInterface@Base 3.12.2-1 146 | + _ZN6DL_Dxf8endBlockEP20DL_CreationInterface@Base 3.12.2-1 147 | + _ZN6DL_Dxf8writeArcER10DL_WriterARK10DL_ArcDataRK13DL_Attributes@Base 3.12.2-1 148 | + _ZN6DL_Dxf8writeRayER10DL_WriterARK10DL_RayDataRK13DL_Attributes@Base 3.12.2-1 149 | + _ZN6DL_Dxf8writeUcsER10DL_WriterA@Base 3.12.2-1 150 | + _ZN6DL_Dxf9add3dFaceEP20DL_CreationInterface@Base 3.12.2-1 151 | + _ZN6DL_Dxf9addCircleEP20DL_CreationInterface@Base 3.12.2-1 152 | + _ZN6DL_Dxf9addInsertEP20DL_CreationInterface@Base 3.12.2-1 153 | + _ZN6DL_Dxf9addLeaderEP20DL_CreationInterface@Base 3.12.2-1 154 | + _ZN6DL_Dxf9addSplineEP20DL_CreationInterface@Base 3.12.2-1 155 | + _ZN6DL_Dxf9addVertexEP20DL_CreationInterface@Base 3.12.2-1 156 | + _ZN6DL_Dxf9endEntityEP20DL_CreationInterface@Base 3.12.2-1 157 | + _ZN6DL_Dxf9writeKnotER10DL_WriterARK11DL_KnotData@Base 3.12.2-1 158 | + _ZN6DL_Dxf9writeLineER10DL_WriterARK11DL_LineDataRK13DL_Attributes@Base 3.12.2-1 159 | + _ZN6DL_Dxf9writeTextER10DL_WriterARK11DL_TextDataRK13DL_Attributes@Base 3.12.2-1 160 | + _ZN6DL_Dxf9writeViewER10DL_WriterA@Base 3.12.2-1 161 | + _ZN6DL_DxfC1Ev@Base 3.12.2-1 162 | + _ZN6DL_DxfC2Ev@Base 3.12.2-1 163 | + _ZN6DL_DxfD1Ev@Base 3.12.2-1 164 | + _ZN6DL_DxfD2Ev@Base 3.12.2-1 165 | + _ZNK10DL_WriterA10openFailedEv@Base 3.12.2-1 166 | + _ZNK10DL_WriterA5closeEv@Base 3.12.2-1 167 | + _ZNK10DL_WriterA6dxfHexEii@Base 3.12.2-1 168 | + _ZNK10DL_WriterA6dxfIntEii@Base 3.12.2-1 169 | + _ZNK10DL_WriterA7dxfRealEid@Base 3.12.2-1 170 | + _ZNK10DL_WriterA9dxfStringEiPKc@Base 3.12.2-1 171 | + _ZNK10DL_WriterA9dxfStringEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 3.12.2-1 172 | + _ZNK9DL_Writer16entityAttributesERK13DL_Attributes@Base 3.12.2-1 173 | + _ZNK9DL_Writer17sectionBlockEntryEm@Base 3.12.2-1 174 | + _ZNK9DL_Writer18tableLinetypeEntryEm@Base 3.12.2-1 175 | + _ZNK9DL_Writer5coordEiddd@Base 3.12.2-1 176 | + _ZNK9DL_Writer6entityEPKc@Base 3.12.2-1 177 | + _ZNK9DL_Writer7dxfBoolEib@Base 3.12.2-1 178 | + _ZNKSt5ctypeIcE8do_widenEc@Base 3.12.2-1 179 | + _ZNSt20__uninitialized_copyILb0EE13__uninit_copyIP16DL_HatchEdgeDataS3_EET0_T_S5_S4_@Base 3.12.2-1 180 | + _ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPSt6vectorI16DL_HatchEdgeDataSaIS3_EES6_EET0_T_S8_S7_@Base 3.12.2-1 181 | + _ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPSt6vectorIdSaIdEES5_EET0_T_S7_S6_@Base 3.12.2-1 182 | + _ZNSt3mapIiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIiESaISt4pairIKiS5_EEEixERS9_@Base 3.12.2-1 183 | + _ZNSt6vectorI16DL_HatchEdgeDataSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_@Base 3.12.2-1 184 | + _ZNSt6vectorI16DL_HatchEdgeDataSaIS0_EEC1ERKS2_@Base 3.12.2-1 185 | + _ZNSt6vectorI16DL_HatchEdgeDataSaIS0_EEC2ERKS2_@Base 3.12.2-1 186 | + _ZNSt6vectorI16DL_HatchEdgeDataSaIS0_EED1Ev@Base 3.12.2-1 187 | + _ZNSt6vectorI16DL_HatchEdgeDataSaIS0_EED2Ev@Base 3.12.2-1 188 | + _ZNSt6vectorI16DL_HatchEdgeDataSaIS0_EEaSERKS2_@Base 3.12.2-1 189 | + _ZNSt6vectorIS_I16DL_HatchEdgeDataSaIS0_EESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_@Base 3.12.2-1 190 | + _ZNSt6vectorIS_I16DL_HatchEdgeDataSaIS0_EESaIS2_EED1Ev@Base 3.12.2-1 191 | + _ZNSt6vectorIS_I16DL_HatchEdgeDataSaIS0_EESaIS2_EED2Ev@Base 3.12.2-1 192 | + _ZNSt6vectorIS_IdSaIdEESaIS1_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS1_S3_EERKS1_@Base 3.12.2-1 193 | + _ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_@Base 3.12.2-1 194 | + _ZNSt6vectorIS_IdSaIdEESaIS1_EED1Ev@Base 3.12.2-1 195 | + _ZNSt6vectorIS_IdSaIdEESaIS1_EED2Ev@Base 3.12.2-1 196 | + _ZNSt6vectorIS_IdSaIdEESaIS1_EEaSERKS3_@Base 3.12.2-1 197 | + _ZNSt6vectorIdSaIdEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPdS1_EERKd@Base 3.12.2-1 198 | + _ZNSt6vectorIdSaIdEE9push_backERKd@Base 3.12.2-1 199 | + _ZNSt6vectorIdSaIdEEC1ERKS1_@Base 3.12.2-1 200 | + _ZNSt6vectorIdSaIdEEC2ERKS1_@Base 3.12.2-1 201 | + _ZNSt6vectorIdSaIdEEaSERKS1_@Base 3.12.2-1 202 | + _ZNSt8_Rb_treeIiSt4pairIKiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stIS8_ESt4lessIiESaIS8_EE24_M_get_insert_unique_posERS1_@Base 3.12.2-1 203 | + _ZNSt8_Rb_treeIiSt4pairIKiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stIS8_ESt4lessIiESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS1_@Base 3.12.2-1 204 | + _ZNSt8_Rb_treeIiSt4pairIKiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stIS8_ESt4lessIiESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E@Base 3.12.2-1 205 | + _ZTI10DL_WriterA@Base 3.12.2-1 206 | + _ZTI9DL_Writer@Base 3.12.2-1 207 | + _ZTS10DL_WriterA@Base 3.12.2-1 208 | + _ZTS9DL_Writer@Base 3.12.2-1 209 | + _ZTV10DL_WriterA@Base 3.12.2-1 210 | -------------------------------------------------------------------------------- /src/dl_writer.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | #ifndef DL_WRITER_H 27 | #define DL_WRITER_H 28 | 29 | #include "dl_global.h" 30 | 31 | #ifndef _WIN32 32 | #include 33 | #endif 34 | 35 | #if _MSC_VER > 1000 36 | #pragma once 37 | #endif // _MSC_VER > 1000 38 | 39 | #include 40 | #include 41 | 42 | #include "dl_attributes.h" 43 | #include "dl_codes.h" 44 | 45 | 46 | 47 | /** 48 | * Defines interface for writing low level DXF constructs to 49 | * a file. Implementation is defined in derived classes that write 50 | * to binary or ASCII files. 51 | * 52 | * Implements functions that write higher level constructs in terms of 53 | * the low level ones. 54 | * 55 | * @todo Add error checking for string/entry length. 56 | */ 57 | class DXFLIB_EXPORT DL_Writer { 58 | public: 59 | /** 60 | * @param version DXF version. Defaults to DL_VERSION_2002. 61 | */ 62 | DL_Writer(DL_Codes::version version) : m_handle(0x30) { 63 | this->version = version; 64 | modelSpaceHandle = 0; 65 | paperSpaceHandle = 0; 66 | paperSpace0Handle = 0; 67 | } 68 | 69 | virtual ~DL_Writer() {} 70 | ; 71 | 72 | /** Generic section for section 'name'. 73 | * 74 | *
 75 |      *   0
 76 |      *  SECTION
 77 |      *   2
 78 |      *  name
 79 |      * 
80 | */ 81 | void section(const char* name) const { 82 | dxfString(0, "SECTION"); 83 | dxfString(2, name); 84 | } 85 | 86 | /** 87 | * Section HEADER 88 | * 89 | *
 90 |      *   0
 91 |      *  SECTION
 92 |      *   2
 93 |      *  HEADER
 94 |      * 
95 | */ 96 | void sectionHeader() const { 97 | section("HEADER"); 98 | } 99 | 100 | /** 101 | * Section TABLES 102 | * 103 | *
104 |      *   0
105 |      *  SECTION
106 |      *   2
107 |      *  TABLES
108 |      * 
109 | */ 110 | void sectionTables() const { 111 | section("TABLES"); 112 | } 113 | 114 | /** 115 | * Section BLOCKS 116 | * 117 | *
118 |      *   0
119 |      *  SECTION
120 |      *   2
121 |      *  BLOCKS
122 |      * 
123 | */ 124 | void sectionBlocks() const { 125 | section("BLOCKS"); 126 | } 127 | 128 | /** 129 | * Section ENTITIES 130 | * 131 | *
132 |      *   0
133 |      *  SECTION
134 |      *   2
135 |      *  ENTITIES
136 |      * 
137 | */ 138 | void sectionEntities() const { 139 | section("ENTITIES"); 140 | } 141 | 142 | /** 143 | * Section CLASSES 144 | * 145 | *
146 |      *   0
147 |      *  SECTION
148 |      *   2
149 |      *  CLASSES
150 |      * 
151 | */ 152 | void sectionClasses() const { 153 | section("CLASSES"); 154 | } 155 | 156 | /** 157 | * Section OBJECTS 158 | * 159 | *
160 |      *   0
161 |      *  SECTION
162 |      *   2
163 |      *  OBJECTS
164 |      * 
165 | */ 166 | void sectionObjects() const { 167 | section("OBJECTS"); 168 | } 169 | 170 | /** 171 | * End of a section. 172 | * 173 | *
174 |      *   0
175 |      *  ENDSEC
176 |      * 
177 | */ 178 | void sectionEnd() const { 179 | dxfString(0, "ENDSEC"); 180 | } 181 | 182 | /** 183 | * Generic table for table 'name' with 'num' entries: 184 | * 185 | *
186 |      *   0
187 |      *  TABLE
188 |      *   2
189 |      *  name
190 |      *  70
191 |      *   num
192 |      * 
193 | */ 194 | void table(const char* name, int num, int h=0) const { 195 | dxfString(0, "TABLE"); 196 | dxfString(2, name); 197 | if (version>=DL_VERSION_2000) { 198 | if (h==0) { 199 | handle(); 200 | } 201 | else { 202 | dxfHex(5, h); 203 | } 204 | dxfString(100, "AcDbSymbolTable"); 205 | } 206 | dxfInt(70, num); 207 | } 208 | 209 | /** Table for layers. 210 | * 211 | * @param num Number of layers in total. 212 | * 213 | *
214 |      *   0
215 |      *  TABLE
216 |      *   2
217 |      *  LAYER
218 |      *   70
219 |      *      num
220 |      * 
221 | */ 222 | void tableLayers(int num) const { 223 | table("LAYER", num, 2); 224 | } 225 | 226 | /** Table for line types. 227 | * 228 | * @param num Number of line types in total. 229 | * 230 | *
231 |      *   0
232 |      *  TABLE
233 |      *   2
234 |      *  LTYPE
235 |      *   70
236 |      *      num
237 |      * 
238 | */ 239 | void tableLinetypes(int num) const { 240 | //linetypeHandle = 5; 241 | table("LTYPE", num, 5); 242 | } 243 | 244 | /** Table for application id. 245 | * 246 | * @param num Number of registered applications in total. 247 | * 248 | *
249 |      *   0
250 |      *  TABLE
251 |      *   2
252 |      *  APPID
253 |      *   70
254 |      *      num
255 |      * 
256 | */ 257 | void tableAppid(int num) const { 258 | table("APPID", num, 9); 259 | } 260 | 261 | /** Table for text style. 262 | * 263 | * @param num Number of text styles. 264 | * 265 | *
266 |      *   0
267 |      *  TABLE
268 |      *   2
269 |      *  STYLE
270 |      *   70
271 |      *      num
272 |      * 
273 | */ 274 | void tableStyle(int num) const { 275 | table("STYLE", num, 3); 276 | } 277 | 278 | /** 279 | * End of a table. 280 | * 281 | *
282 |      *   0
283 |      *  ENDTAB
284 |      * 
285 | */ 286 | void tableEnd() const { 287 | dxfString(0, "ENDTAB"); 288 | } 289 | 290 | /** 291 | * End of the DXF file. 292 | * 293 | *
294 |      *   0
295 |      *  EOF
296 |      * 
297 | */ 298 | void dxfEOF() const { 299 | dxfString(0, "EOF"); 300 | } 301 | 302 | /** 303 | * Comment. 304 | * 305 | *
306 |      *  999
307 |      *  text
308 |      * 
309 | */ 310 | void comment(const char* text) const { 311 | dxfString(999, text); 312 | } 313 | 314 | /** 315 | * Entity. 316 | * 317 | *
318 |      *   0
319 |      *  entTypeName
320 |      * 
321 | * 322 | * @return Unique handle or 0. 323 | */ 324 | void entity(const char* entTypeName) const { 325 | dxfString(0, entTypeName); 326 | if (version>=DL_VERSION_2000) { 327 | handle(); 328 | } 329 | } 330 | 331 | /** 332 | * Attributes of an entity. 333 | * 334 | *
335 |      *   8
336 |      *  layer
337 |      *  62
338 |      *  color
339 |      *  39
340 |      *  width
341 |      *   6
342 |      *  linetype
343 |      * 
344 | */ 345 | void entityAttributes(const DL_Attributes& attrib) const { 346 | 347 | // layer name: 348 | dxfString(8, attrib.getLayer()); 349 | 350 | // R12 doesn't accept BYLAYER values. The value has to be missing 351 | // in that case. 352 | if (version>=DL_VERSION_2000 || attrib.getColor()!=256) { 353 | dxfInt(62, attrib.getColor()); 354 | } 355 | if (version>=DL_VERSION_2000 && attrib.getColor24()!=-1) { 356 | dxfInt(420, attrib.getColor24()); 357 | } 358 | if (version>=DL_VERSION_2000) { 359 | dxfInt(370, attrib.getWidth()); 360 | } 361 | if (version>=DL_VERSION_2000) { 362 | dxfReal(48, attrib.getLinetypeScale()); 363 | } 364 | std::string linetype = attrib.getLinetype(); 365 | std::transform(linetype.begin(), linetype.end(), linetype.begin(), ::toupper); 366 | if (version>=DL_VERSION_2000 || linetype=="BYLAYER") { 367 | dxfString(6, attrib.getLinetype()); 368 | } 369 | } 370 | 371 | /** 372 | * Subclass. 373 | */ 374 | void subClass(const char* sub) const { 375 | dxfString(100, sub); 376 | } 377 | 378 | /** 379 | * Layer (must be in the TABLES section LAYER). 380 | * 381 | *
382 |      *   0
383 |      *  LAYER
384 |      * 
385 | */ 386 | void tableLayerEntry(unsigned long int h=0) const { 387 | dxfString(0, "LAYER"); 388 | if (version>=DL_VERSION_2000) { 389 | if (h==0) { 390 | handle(); 391 | } else { 392 | dxfHex(5, h); 393 | } 394 | dxfString(100, "AcDbSymbolTableRecord"); 395 | dxfString(100, "AcDbLayerTableRecord"); 396 | } 397 | } 398 | 399 | /** 400 | * Line type (must be in the TABLES section LTYPE). 401 | * 402 | *
403 |      *   0
404 |      *  LTYPE
405 |      * 
406 | */ 407 | void tableLinetypeEntry(unsigned long int h=0) const { 408 | dxfString(0, "LTYPE"); 409 | if (version>=DL_VERSION_2000) { 410 | if (h==0) { 411 | handle(); 412 | } else { 413 | dxfHex(5, h); 414 | } 415 | //dxfHex(330, 0x5); 416 | dxfString(100, "AcDbSymbolTableRecord"); 417 | dxfString(100, "AcDbLinetypeTableRecord"); 418 | } 419 | } 420 | 421 | /** 422 | * Appid (must be in the TABLES section APPID). 423 | * 424 | *
425 |      *   0
426 |      *  APPID
427 |      * 
428 | */ 429 | void tableAppidEntry(unsigned long int h=0) const { 430 | dxfString(0, "APPID"); 431 | if (version>=DL_VERSION_2000) { 432 | if (h==0) { 433 | handle(); 434 | } else { 435 | dxfHex(5, h); 436 | } 437 | //dxfHex(330, 0x9); 438 | dxfString(100, "AcDbSymbolTableRecord"); 439 | dxfString(100, "AcDbRegAppTableRecord"); 440 | } 441 | } 442 | 443 | /** 444 | * Block (must be in the section BLOCKS). 445 | * 446 | *
447 |      *   0
448 |      *  BLOCK
449 |      * 
450 | */ 451 | void sectionBlockEntry(unsigned long int h=0) const { 452 | dxfString(0, "BLOCK"); 453 | if (version>=DL_VERSION_2000) { 454 | if (h==0) { 455 | handle(); 456 | } else { 457 | dxfHex(5, h); 458 | } 459 | //dxfHex(330, blockHandle); 460 | dxfString(100, "AcDbEntity"); 461 | if (h==0x1C) { 462 | dxfInt(67, 1); 463 | } 464 | dxfString(8, "0"); // TODO: Layer for block 465 | dxfString(100, "AcDbBlockBegin"); 466 | } 467 | } 468 | 469 | /** 470 | * End of Block (must be in the section BLOCKS). 471 | * 472 | *
473 |      *   0
474 |      *  ENDBLK
475 |      * 
476 | */ 477 | void sectionBlockEntryEnd(unsigned long int h=0) const { 478 | dxfString(0, "ENDBLK"); 479 | if (version>=DL_VERSION_2000) { 480 | if (h==0) { 481 | handle(); 482 | } else { 483 | dxfHex(5, h); 484 | } 485 | //dxfHex(330, blockHandle); 486 | dxfString(100, "AcDbEntity"); 487 | if (h==0x1D) { 488 | dxfInt(67, 1); 489 | } 490 | dxfString(8, "0"); // TODO: Layer for block 491 | dxfString(100, "AcDbBlockEnd"); 492 | } 493 | } 494 | 495 | void color(int col=256) const { 496 | dxfInt(62, col); 497 | } 498 | void linetype(const char *lt) const { 499 | dxfString(6, lt); 500 | } 501 | void linetypeScale(double scale) const { 502 | dxfReal(48, scale); 503 | } 504 | void lineWeight(int lw) const { 505 | dxfInt(370, lw); 506 | } 507 | 508 | void coord(int gc, double x, double y, double z=0) const { 509 | dxfReal(gc, x); 510 | dxfReal(gc+10, y); 511 | dxfReal(gc+20, z); 512 | } 513 | 514 | void coordTriplet(int gc, const double* value) const { 515 | if (value) { 516 | dxfReal(gc, *value++); 517 | dxfReal(gc+10, *value++); 518 | dxfReal(gc+20, *value++); 519 | } 520 | } 521 | 522 | void resetHandle() const { 523 | m_handle = 1; 524 | } 525 | 526 | /** 527 | * Writes a unique handle and returns it. 528 | */ 529 | unsigned long handle(int gc=5) const { 530 | // handle has to be hex 531 | dxfHex(gc, m_handle); 532 | return m_handle++; 533 | } 534 | 535 | /** 536 | * @return Next handle that will be written. 537 | */ 538 | unsigned long getNextHandle() const { 539 | return m_handle; 540 | } 541 | 542 | /** 543 | * Increases handle, so that the handle returned remains available. 544 | */ 545 | unsigned long incHandle() const { 546 | return m_handle++; 547 | } 548 | 549 | /** 550 | * Sets the handle of the model space. Entities refer to 551 | * this handle. 552 | */ 553 | void setModelSpaceHandle(unsigned long h) { 554 | modelSpaceHandle = h; 555 | } 556 | 557 | unsigned long getModelSpaceHandle() { 558 | return modelSpaceHandle; 559 | } 560 | 561 | /** 562 | * Sets the handle of the paper space. Some special blocks refer to 563 | * this handle. 564 | */ 565 | void setPaperSpaceHandle(unsigned long h) { 566 | paperSpaceHandle = h; 567 | } 568 | 569 | unsigned long getPaperSpaceHandle() { 570 | return paperSpaceHandle; 571 | } 572 | 573 | /** 574 | * Sets the handle of the paper space 0. Some special blocks refer to 575 | * this handle. 576 | */ 577 | void setPaperSpace0Handle(unsigned long h) { 578 | paperSpace0Handle = h; 579 | } 580 | 581 | unsigned long getPaperSpace0Handle() { 582 | return paperSpace0Handle; 583 | } 584 | 585 | /** 586 | * Must be overwritten by the implementing class to write a 587 | * real value to the file. 588 | * 589 | * @param gc Group code. 590 | * @param value The real value. 591 | */ 592 | virtual void dxfReal(int gc, double value) const = 0; 593 | 594 | /** 595 | * Must be overwritten by the implementing class to write an 596 | * int value to the file. 597 | * 598 | * @param gc Group code. 599 | * @param value The int value. 600 | */ 601 | virtual void dxfInt(int gc, int value) const = 0; 602 | 603 | /** 604 | * Can be overwritten by the implementing class to write a 605 | * bool value to the file. 606 | * 607 | * @param gc Group code. 608 | * @param value The bool value. 609 | */ 610 | virtual void dxfBool(int gc, bool value) const { 611 | dxfInt(gc, (int)value); 612 | } 613 | 614 | /** 615 | * Must be overwritten by the implementing class to write an 616 | * int value (hex) to the file. 617 | * 618 | * @param gc Group code. 619 | * @param value The int value. 620 | */ 621 | virtual void dxfHex(int gc, int value) const = 0; 622 | 623 | /** 624 | * Must be overwritten by the implementing class to write a 625 | * string to the file. 626 | * 627 | * @param gc Group code. 628 | * @param value The string. 629 | */ 630 | virtual void dxfString(int gc, const char* value) const = 0; 631 | 632 | /** 633 | * Must be overwritten by the implementing class to write a 634 | * string to the file. 635 | * 636 | * @param gc Group code. 637 | * @param value The string. 638 | */ 639 | virtual void dxfString(int gc, const std::string& value) const = 0; 640 | 641 | protected: 642 | mutable unsigned long m_handle; 643 | mutable unsigned long modelSpaceHandle; 644 | mutable unsigned long paperSpaceHandle; 645 | mutable unsigned long paperSpace0Handle; 646 | 647 | /** 648 | * DXF version to be created. 649 | */ 650 | DL_Codes::version version; 651 | private: 652 | }; 653 | 654 | #endif 655 | -------------------------------------------------------------------------------- /gpl-2.0greater.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /src/dl_dxf.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_DXF_H 26 | #define DL_DXF_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include "dl_attributes.h" 38 | #include "dl_codes.h" 39 | #include "dl_entities.h" 40 | #include "dl_writer_ascii.h" 41 | 42 | #ifdef _WIN32 43 | #undef M_PI 44 | #define M_PI 3.14159265358979323846 45 | #pragma warning(disable : 4800) 46 | #endif 47 | 48 | #ifndef M_PI 49 | #define M_PI 3.1415926535897932384626433832795 50 | #endif 51 | 52 | #ifndef DL_NANDOUBLE 53 | #define DL_NANDOUBLE std::numeric_limits::quiet_NaN() 54 | #endif 55 | 56 | class DL_CreationInterface; 57 | class DL_WriterA; 58 | 59 | 60 | #define DL_VERSION "3.12.2.0" 61 | 62 | #define DL_VERSION_MAJOR 3 63 | #define DL_VERSION_MINOR 12 64 | #define DL_VERSION_REV 2 65 | #define DL_VERSION_BUILD 0 66 | 67 | #define DL_UNKNOWN 0 68 | #define DL_LAYER 10 69 | #define DL_BLOCK 11 70 | #define DL_ENDBLK 12 71 | #define DL_LINETYPE 13 72 | #define DL_STYLE 20 73 | #define DL_SETTING 50 74 | #define DL_ENTITY_POINT 100 75 | #define DL_ENTITY_LINE 101 76 | #define DL_ENTITY_POLYLINE 102 77 | #define DL_ENTITY_LWPOLYLINE 103 78 | #define DL_ENTITY_VERTEX 104 79 | #define DL_ENTITY_SPLINE 105 80 | #define DL_ENTITY_KNOT 106 81 | #define DL_ENTITY_CONTROLPOINT 107 82 | #define DL_ENTITY_ARC 108 83 | #define DL_ENTITY_CIRCLE 109 84 | #define DL_ENTITY_ELLIPSE 110 85 | #define DL_ENTITY_INSERT 111 86 | #define DL_ENTITY_TEXT 112 87 | #define DL_ENTITY_MTEXT 113 88 | #define DL_ENTITY_DIMENSION 114 89 | #define DL_ENTITY_LEADER 115 90 | #define DL_ENTITY_HATCH 116 91 | #define DL_ENTITY_ATTRIB 117 92 | #define DL_ENTITY_IMAGE 118 93 | #define DL_ENTITY_IMAGEDEF 119 94 | #define DL_ENTITY_TRACE 120 95 | #define DL_ENTITY_SOLID 121 96 | #define DL_ENTITY_3DFACE 122 97 | #define DL_ENTITY_XLINE 123 98 | #define DL_ENTITY_RAY 124 99 | #define DL_ENTITY_SEQEND 125 100 | #define DL_XRECORD 200 101 | #define DL_DICTIONARY 210 102 | 103 | 104 | /** 105 | * Reading and writing of DXF files. 106 | * 107 | * This class can read in a DXF file and calls methods from the 108 | * interface DL_EntityContainer to add the entities to the 109 | * contianer provided by the user of the library. 110 | * 111 | * It can also be used to write DXF files to a certain extent. 112 | * 113 | * When saving entities, special values for colors and linetypes 114 | * can be used: 115 | * 116 | * Special colors are 0 (=BYBLOCK) and 256 (=BYLAYER). 117 | * Special linetypes are "BYLAYER" and "BYBLOCK". 118 | * 119 | * @author Andrew Mustun 120 | */ 121 | class DXFLIB_EXPORT DL_Dxf { 122 | public: 123 | DL_Dxf(); 124 | ~DL_Dxf(); 125 | 126 | bool in(const std::string& file, 127 | DL_CreationInterface* creationInterface); 128 | bool readDxfGroups(FILE* fp, 129 | DL_CreationInterface* creationInterface); 130 | static bool getStrippedLine(std::string& s, unsigned int size, 131 | FILE* stream, bool stripSpace = true); 132 | 133 | bool readDxfGroups(std::stringstream& stream, 134 | DL_CreationInterface* creationInterface); 135 | bool in(std::stringstream &stream, 136 | DL_CreationInterface* creationInterface); 137 | static bool getStrippedLine(std::string& s, unsigned int size, 138 | std::stringstream& stream, bool stripSpace = true); 139 | 140 | static bool stripWhiteSpace(char** s, bool stripSpaces = true); 141 | 142 | bool processDXFGroup(DL_CreationInterface* creationInterface, 143 | int groupCode, const std::string& groupValue); 144 | void addSetting(DL_CreationInterface* creationInterface); 145 | void addLayer(DL_CreationInterface* creationInterface); 146 | void addLinetype(DL_CreationInterface *creationInterface); 147 | void addBlock(DL_CreationInterface* creationInterface); 148 | void endBlock(DL_CreationInterface* creationInterface); 149 | void addTextStyle(DL_CreationInterface* creationInterface); 150 | 151 | void addPoint(DL_CreationInterface* creationInterface); 152 | void addLine(DL_CreationInterface* creationInterface); 153 | void addXLine(DL_CreationInterface* creationInterface); 154 | void addRay(DL_CreationInterface* creationInterface); 155 | 156 | void addPolyline(DL_CreationInterface* creationInterface); 157 | void addVertex(DL_CreationInterface* creationInterface); 158 | 159 | void addSpline(DL_CreationInterface* creationInterface); 160 | 161 | void addArc(DL_CreationInterface* creationInterface); 162 | void addCircle(DL_CreationInterface* creationInterface); 163 | void addEllipse(DL_CreationInterface* creationInterface); 164 | void addInsert(DL_CreationInterface* creationInterface); 165 | 166 | void addTrace(DL_CreationInterface* creationInterface); 167 | void add3dFace(DL_CreationInterface* creationInterface); 168 | void addSolid(DL_CreationInterface* creationInterface); 169 | 170 | void addMText(DL_CreationInterface* creationInterface); 171 | void addText(DL_CreationInterface* creationInterface); 172 | 173 | void addAttribute(DL_CreationInterface* creationInterface); 174 | 175 | DL_DimensionData getDimData(); 176 | void addDimLinear(DL_CreationInterface* creationInterface); 177 | void addDimAligned(DL_CreationInterface* creationInterface); 178 | void addDimRadial(DL_CreationInterface* creationInterface); 179 | void addDimDiametric(DL_CreationInterface* creationInterface); 180 | void addDimAngular(DL_CreationInterface* creationInterface); 181 | void addDimAngular3P(DL_CreationInterface* creationInterface); 182 | void addDimOrdinate(DL_CreationInterface* creationInterface); 183 | 184 | void addLeader(DL_CreationInterface* creationInterface); 185 | 186 | void addHatch(DL_CreationInterface* creationInterface); 187 | void addHatchLoop(); 188 | void addHatchEdge(); 189 | bool handleHatchData(DL_CreationInterface* creationInterface); 190 | 191 | void addImage(DL_CreationInterface* creationInterface); 192 | void addImageDef(DL_CreationInterface* creationInterface); 193 | 194 | void addComment(DL_CreationInterface* creationInterface, const std::string& comment); 195 | 196 | void addDictionary(DL_CreationInterface* creationInterface); 197 | void addDictionaryEntry(DL_CreationInterface* creationInterface); 198 | 199 | bool handleXRecordData(DL_CreationInterface* creationInterface); 200 | bool handleDictionaryData(DL_CreationInterface* creationInterface); 201 | 202 | bool handleXData(DL_CreationInterface *creationInterface); 203 | bool handleMTextData(DL_CreationInterface* creationInterface); 204 | bool handleLWPolylineData(DL_CreationInterface* creationInterface); 205 | bool handleSplineData(DL_CreationInterface* creationInterface); 206 | bool handleLeaderData(DL_CreationInterface* creationInterface); 207 | bool handleLinetypeData(DL_CreationInterface* creationInterface); 208 | 209 | void endEntity(DL_CreationInterface* creationInterface); 210 | 211 | void endSequence(DL_CreationInterface* creationInterface); 212 | 213 | //int stringToInt(const char* s, bool* ok=NULL); 214 | 215 | DL_WriterA* out(const char* file, 216 | DL_Codes::version version=DL_VERSION_2000); 217 | 218 | void writeHeader(DL_WriterA& dw); 219 | 220 | void writePoint(DL_WriterA& dw, 221 | const DL_PointData& data, 222 | const DL_Attributes& attrib); 223 | void writeLine(DL_WriterA& dw, 224 | const DL_LineData& data, 225 | const DL_Attributes& attrib); 226 | void writeXLine(DL_WriterA& dw, 227 | const DL_XLineData& data, 228 | const DL_Attributes& attrib); 229 | void writeRay(DL_WriterA& dw, 230 | const DL_RayData& data, 231 | const DL_Attributes& attrib); 232 | void writePolyline(DL_WriterA& dw, 233 | const DL_PolylineData& data, 234 | const DL_Attributes& attrib); 235 | void writeVertex(DL_WriterA& dw, 236 | const DL_VertexData& data); 237 | void writePolylineEnd(DL_WriterA& dw); 238 | void writeSpline(DL_WriterA& dw, 239 | const DL_SplineData& data, 240 | const DL_Attributes& attrib); 241 | void writeControlPoint(DL_WriterA& dw, 242 | const DL_ControlPointData& data); 243 | void writeFitPoint(DL_WriterA& dw, 244 | const DL_FitPointData& data); 245 | void writeKnot(DL_WriterA& dw, 246 | const DL_KnotData& data); 247 | void writeCircle(DL_WriterA& dw, 248 | const DL_CircleData& data, 249 | const DL_Attributes& attrib); 250 | void writeArc(DL_WriterA& dw, 251 | const DL_ArcData& data, 252 | const DL_Attributes& attrib); 253 | void writeEllipse(DL_WriterA& dw, 254 | const DL_EllipseData& data, 255 | const DL_Attributes& attrib); 256 | void writeSolid(DL_WriterA& dw, 257 | const DL_SolidData& data, 258 | const DL_Attributes& attrib); 259 | void writeTrace(DL_WriterA& dw, 260 | const DL_TraceData& data, 261 | const DL_Attributes& attrib); 262 | void write3dFace(DL_WriterA& dw, 263 | const DL_3dFaceData& data, 264 | const DL_Attributes& attrib); 265 | void writeInsert(DL_WriterA& dw, 266 | const DL_InsertData& data, 267 | const DL_Attributes& attrib); 268 | void writeMText(DL_WriterA& dw, 269 | const DL_MTextData& data, 270 | const DL_Attributes& attrib); 271 | void writeText(DL_WriterA& dw, 272 | const DL_TextData& data, 273 | const DL_Attributes& attrib); 274 | void writeAttribute(DL_WriterA& dw, 275 | const DL_AttributeData& data, 276 | const DL_Attributes& attrib); 277 | void writeDimStyleOverrides(DL_WriterA& dw, 278 | const DL_DimensionData& data); 279 | void writeDimAligned(DL_WriterA& dw, 280 | const DL_DimensionData& data, 281 | const DL_DimAlignedData& edata, 282 | const DL_Attributes& attrib); 283 | void writeDimLinear(DL_WriterA& dw, 284 | const DL_DimensionData& data, 285 | const DL_DimLinearData& edata, 286 | const DL_Attributes& attrib); 287 | void writeDimRadial(DL_WriterA& dw, 288 | const DL_DimensionData& data, 289 | const DL_DimRadialData& edata, 290 | const DL_Attributes& attrib); 291 | void writeDimDiametric(DL_WriterA& dw, 292 | const DL_DimensionData& data, 293 | const DL_DimDiametricData& edata, 294 | const DL_Attributes& attrib); 295 | void writeDimAngular(DL_WriterA& dw, 296 | const DL_DimensionData& data, 297 | const DL_DimAngularData& edata, 298 | const DL_Attributes& attrib); 299 | void writeDimAngular3P(DL_WriterA& dw, 300 | const DL_DimensionData& data, 301 | const DL_DimAngular3PData& edata, 302 | const DL_Attributes& attrib); 303 | void writeDimOrdinate(DL_WriterA& dw, 304 | const DL_DimensionData& data, 305 | const DL_DimOrdinateData& edata, 306 | const DL_Attributes& attrib); 307 | void writeLeader(DL_WriterA& dw, 308 | const DL_LeaderData& data, 309 | const DL_Attributes& attrib); 310 | void writeLeaderVertex(DL_WriterA& dw, 311 | const DL_LeaderVertexData& data); 312 | void writeHatch1(DL_WriterA& dw, 313 | const DL_HatchData& data, 314 | const DL_Attributes& attrib); 315 | void writeHatch2(DL_WriterA& dw, 316 | const DL_HatchData& data, 317 | const DL_Attributes& attrib); 318 | void writeHatchLoop1(DL_WriterA& dw, 319 | const DL_HatchLoopData& data); 320 | void writeHatchLoop2(DL_WriterA& dw, 321 | const DL_HatchLoopData& data); 322 | void writeHatchEdge(DL_WriterA& dw, 323 | const DL_HatchEdgeData& data); 324 | 325 | int writeImage(DL_WriterA& dw, 326 | const DL_ImageData& data, 327 | const DL_Attributes& attrib); 328 | 329 | void writeImageDef(DL_WriterA& dw, int handle, 330 | const DL_ImageData& data); 331 | 332 | void writeLayer(DL_WriterA& dw, 333 | const DL_LayerData& data, 334 | const DL_Attributes& attrib); 335 | 336 | void writeLinetype(DL_WriterA& dw, 337 | const DL_LinetypeData& data); 338 | 339 | void writeAppid(DL_WriterA& dw, const std::string& name); 340 | 341 | void writeBlock(DL_WriterA& dw, 342 | const DL_BlockData& data); 343 | void writeEndBlock(DL_WriterA& dw, const std::string& name); 344 | 345 | void writeVPort(DL_WriterA& dw); 346 | void writeStyle(DL_WriterA& dw, const DL_StyleData& style); 347 | void writeView(DL_WriterA& dw); 348 | void writeUcs(DL_WriterA& dw); 349 | void writeDimStyle(DL_WriterA& dw, 350 | double dimasz, double dimexe, double dimexo, 351 | double dimgap, double dimtxt); 352 | void writeBlockRecord(DL_WriterA& dw); 353 | void writeBlockRecord(DL_WriterA& dw, const std::string& name); 354 | void writeObjects(DL_WriterA& dw, const std::string& appDictionaryName = ""); 355 | void writeAppDictionary(DL_WriterA& dw); 356 | int writeDictionaryEntry(DL_WriterA& dw, const std::string& name); 357 | void writeXRecord(DL_WriterA& dw, int handle, int value); 358 | void writeXRecord(DL_WriterA& dw, int handle, double value); 359 | void writeXRecord(DL_WriterA& dw, int handle, bool value); 360 | void writeXRecord(DL_WriterA& dw, int handle, const std::string& value); 361 | void writeObjectsEnd(DL_WriterA& dw); 362 | 363 | void writeComment(DL_WriterA& dw, const std::string& comment); 364 | 365 | /** 366 | * Converts the given string into a double or returns the given 367 | * default valud (def) if value is NULL or empty. 368 | */ 369 | //static double toReal(const char* value, double def=0.0); 370 | 371 | /** 372 | * Converts the given string into an int or returns the given 373 | * default valud (def) if value is NULL or empty. 374 | */ 375 | // static int toInt(const char* value, int def=0) { 376 | // if (value!=NULL && value[0] != '\0') { 377 | // return atoi(value); 378 | // } 379 | 380 | // return def; 381 | // } 382 | 383 | /** 384 | * Converts the given string into a string or returns the given 385 | * default valud (def) if value is NULL or empty. 386 | */ 387 | // static const char* toString(const char* value, const char* def="") { 388 | // if (value!=NULL && value[0] != '\0') { 389 | // return value; 390 | // } else { 391 | // return def; 392 | // } 393 | // } 394 | 395 | static bool checkVariable(const char* var, DL_Codes::version version); 396 | 397 | DL_Codes::version getVersion() { 398 | return version; 399 | } 400 | 401 | int getLibVersion(const std::string &str); 402 | 403 | static void test(); 404 | 405 | bool hasValue(int code) { 406 | return values.count(code)==1; 407 | } 408 | 409 | int getIntValue(int code, int def) { 410 | if (!hasValue(code)) { 411 | return def; 412 | } 413 | return toInt(values[code]); 414 | } 415 | 416 | int toInt(const std::string& str) { 417 | char* p; 418 | return strtol(str.c_str(), &p, 10); 419 | } 420 | 421 | bool toBool(const std::string& str) { 422 | char* p; 423 | return (bool)strtol(str.c_str(), &p, 10); 424 | } 425 | 426 | std::string getStringValue(int code, const std::string& def) { 427 | if (!hasValue(code)) { 428 | return def; 429 | } 430 | return values[code]; 431 | } 432 | 433 | double getRealValue(int code, double def) { 434 | if (!hasValue(code)) { 435 | return def; 436 | } 437 | return toReal(values[code]); 438 | } 439 | 440 | double toReal(const std::string& str) { 441 | double ret; 442 | // make sure the real value uses '.' not ',': 443 | std::string str2 = str; 444 | std::replace(str2.begin(), str2.end(), ',', '.'); 445 | // make sure c++ expects '.' not ',': 446 | std::istringstream istr(str2); 447 | istr.imbue(std::locale("C")); 448 | istr >> ret; 449 | return ret; 450 | } 451 | 452 | private: 453 | DL_Codes::version version; 454 | 455 | std::string polylineLayer; 456 | double* vertices; 457 | int maxVertices; 458 | int vertexIndex; 459 | 460 | double* knots; 461 | int maxKnots; 462 | int knotIndex; 463 | 464 | double* weights; 465 | int weightIndex; 466 | 467 | double* controlPoints; 468 | int maxControlPoints; 469 | int controlPointIndex; 470 | 471 | double* fitPoints; 472 | int maxFitPoints; 473 | int fitPointIndex; 474 | 475 | double* leaderVertices; 476 | int maxLeaderVertices; 477 | int leaderVertexIndex; 478 | 479 | bool firstHatchLoop; 480 | DL_HatchEdgeData hatchEdge; 481 | std::vector > hatchEdges; 482 | 483 | std::string xRecordHandle; 484 | bool xRecordValues; 485 | 486 | // Only the useful part of the group code 487 | std::string groupCodeTmp; 488 | // ...same as integer 489 | unsigned int groupCode; 490 | // Only the useful part of the group value 491 | std::string groupValue; 492 | // Current entity type 493 | int currentObjectType; 494 | // Value of the current setting 495 | char settingValue[DL_DXF_MAXLINE+1]; 496 | // Key of the current setting (e.g. "$ACADVER") 497 | std::string settingKey; 498 | // Stores the group codes 499 | std::map values; 500 | // First call of this method. We initialize all group values in 501 | // the first call. 502 | bool firstCall; 503 | // Attributes of the current entity (layer, color, width, line type) 504 | DL_Attributes attrib; 505 | // library version. hex: 0x20003001 = 2.0.3.1 506 | int libVersion; 507 | // app specific dictionary handle: 508 | unsigned long appDictionaryHandle; 509 | // handle of standard text style, referenced by dimstyle: 510 | unsigned long styleHandleStd; 511 | }; 512 | 513 | #endif 514 | 515 | // EOF 516 | -------------------------------------------------------------------------------- /src/dl_codes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | /** 27 | * Defines common DXF codes and constants. 28 | */ 29 | 30 | #ifndef DXF_CODES_H 31 | #define DXF_CODES_H 32 | 33 | #include "dl_global.h" 34 | 35 | #if _MSC_VER > 1000 36 | #pragma once 37 | #endif // _MSC_VER > 1000 38 | 39 | #if defined(__OS2__)||defined(__EMX__) 40 | #define strcasecmp(s,t) stricmp(s,t) 41 | #endif 42 | 43 | #if defined(_WIN32) 44 | #define strcasecmp(s,t) _stricmp(s,t) 45 | #endif 46 | 47 | 48 | #ifdef _WIN32 49 | #undef M_PI 50 | #define M_PI 3.14159265358979323846 51 | #pragma warning(disable : 4800) 52 | #endif 53 | 54 | #ifndef M_PI 55 | #define M_PI 3.1415926535897932384626433832795 56 | #endif 57 | 58 | #define DL_DXF_MAXLINE 1024 59 | #define DL_DXF_MAXGROUPCODE 1100 60 | 61 | // used to mark invalid vectors: 62 | //#define DL_DXF_MAXDOUBLE 1.0E+10 63 | 64 | /** 65 | * Codes for colors and DXF versions. 66 | */ 67 | class DXFLIB_EXPORT DL_Codes { 68 | public: 69 | /** 70 | * Standard DXF colors. 71 | */ 72 | enum color { 73 | black = 250, 74 | green = 3, 75 | red = 1, 76 | brown = 15, 77 | yellow = 2, 78 | cyan = 4, 79 | magenta = 6, 80 | gray = 8, 81 | blue = 5, 82 | l_blue = 163, 83 | l_green = 121, 84 | l_cyan = 131, 85 | l_red = 23, 86 | l_magenta = 221, 87 | l_gray = 252, 88 | white = 7, 89 | bylayer = 256, 90 | byblock = 0 91 | }; 92 | 93 | /** 94 | * Version numbers for the DXF Format. 95 | */ 96 | enum version { 97 | AC1009_MIN, // R12, minimalistic 98 | AC1009, // R12 99 | AC1012, 100 | AC1014, 101 | AC1015 // R2000 102 | }; 103 | }; 104 | 105 | 106 | // Extended color palette: 107 | // The first entry is only for direct indexing starting with [1] 108 | // Color 1 is red (1,0,0) 109 | const double dxfColors[][3] = { 110 | {0,0,0}, // unused 111 | {1,0,0}, // 1 112 | {1,1,0}, 113 | {0,1,0}, 114 | {0,1,1}, 115 | {0,0,1}, 116 | {1,0,1}, 117 | {1,1,1}, // black or white 118 | {0.5,0.5,0.5}, 119 | {0.75,0.75,0.75}, 120 | {1,0,0}, // 10 121 | {1,0.5,0.5}, 122 | {0.65,0,0}, 123 | {0.65,0.325,0.325}, 124 | {0.5,0,0}, 125 | {0.5,0.25,0.25}, 126 | {0.3,0,0}, 127 | {0.3,0.15,0.15}, 128 | {0.15,0,0}, 129 | {0.15,0.075,0.075}, 130 | {1,0.25,0}, // 20 131 | {1,0.625,0.5}, 132 | {0.65,0.1625,0}, 133 | {0.65,0.4063,0.325}, 134 | {0.5,0.125,0}, 135 | {0.5,0.3125,0.25}, 136 | {0.3,0.075,0}, 137 | {0.3,0.1875,0.15}, 138 | {0.15,0.0375,0}, 139 | {0.15,0.0938,0.075}, 140 | {1,0.5,0}, // 30 141 | {1,0.75,0.5}, 142 | {0.65,0.325,0}, 143 | {0.65,0.4875,0.325}, 144 | {0.5,0.25,0}, 145 | {0.5,0.375,0.25}, 146 | {0.3,0.15,0}, 147 | {0.3,0.225,0.15}, 148 | {0.15,0.075,0}, 149 | {0.15,0.1125,0.075}, 150 | {1,0.75,0}, // 40 151 | {1,0.875,0.5}, 152 | {0.65,0.4875,0}, 153 | {0.65,0.5688,0.325}, 154 | {0.5,0.375,0}, 155 | {0.5,0.4375,0.25}, 156 | {0.3,0.225,0}, 157 | {0.3,0.2625,0.15}, 158 | {0.15,0.1125,0}, 159 | {0.15,0.1313,0.075}, 160 | {1,1,0}, // 50 161 | {1,1,0.5}, 162 | {0.65,0.65,0}, 163 | {0.65,0.65,0.325}, 164 | {0.5,0.5,0}, 165 | {0.5,0.5,0.25}, 166 | {0.3,0.3,0}, 167 | {0.3,0.3,0.15}, 168 | {0.15,0.15,0}, 169 | {0.15,0.15,0.075}, 170 | {0.75,1,0}, // 60 171 | {0.875,1,0.5}, 172 | {0.4875,0.65,0}, 173 | {0.5688,0.65,0.325}, 174 | {0.375,0.5,0}, 175 | {0.4375,0.5,0.25}, 176 | {0.225,0.3,0}, 177 | {0.2625,0.3,0.15}, 178 | {0.1125,0.15,0}, 179 | {0.1313,0.15,0.075}, 180 | {0.5,1,0}, // 70 181 | {0.75,1,0.5}, 182 | {0.325,0.65,0}, 183 | {0.4875,0.65,0.325}, 184 | {0.25,0.5,0}, 185 | {0.375,0.5,0.25}, 186 | {0.15,0.3,0}, 187 | {0.225,0.3,0.15}, 188 | {0.075,0.15,0}, 189 | {0.1125,0.15,0.075}, 190 | {0.25,1,0}, // 80 191 | {0.625,1,0.5}, 192 | {0.1625,0.65,0}, 193 | {0.4063,0.65,0.325}, 194 | {0.125,0.5,0}, 195 | {0.3125,0.5,0.25}, 196 | {0.075,0.3,0}, 197 | {0.1875,0.3,0.15}, 198 | {0.0375,0.15,0}, 199 | {0.0938,0.15,0.075}, 200 | {0,1,0}, // 90 201 | {0.5,1,0.5}, 202 | {0,0.65,0}, 203 | {0.325,0.65,0.325}, 204 | {0,0.5,0}, 205 | {0.25,0.5,0.25}, 206 | {0,0.3,0}, 207 | {0.15,0.3,0.15}, 208 | {0,0.15,0}, 209 | {0.075,0.15,0.075}, 210 | {0,1,0.25}, // 100 211 | {0.5,1,0.625}, 212 | {0,0.65,0.1625}, 213 | {0.325,0.65,0.4063}, 214 | {0,0.5,0.125}, 215 | {0.25,0.5,0.3125}, 216 | {0,0.3,0.075}, 217 | {0.15,0.3,0.1875}, 218 | {0,0.15,0.0375}, 219 | {0.075,0.15,0.0938}, 220 | {0,1,0.5}, // 110 221 | {0.5,1,0.75}, 222 | {0,0.65,0.325}, 223 | {0.325,0.65,0.4875}, 224 | {0,0.5,0.25}, 225 | {0.25,0.5,0.375}, 226 | {0,0.3,0.15}, 227 | {0.15,0.3,0.225}, 228 | {0,0.15,0.075}, 229 | {0.075,0.15,0.1125}, 230 | {0,1,0.75}, // 120 231 | {0.5,1,0.875}, 232 | {0,0.65,0.4875}, 233 | {0.325,0.65,0.5688}, 234 | {0,0.5,0.375}, 235 | {0.25,0.5,0.4375}, 236 | {0,0.3,0.225}, 237 | {0.15,0.3,0.2625}, 238 | {0,0.15,0.1125}, 239 | {0.075,0.15,0.1313}, 240 | {0,1,1}, // 130 241 | {0.5,1,1}, 242 | {0,0.65,0.65}, 243 | {0.325,0.65,0.65}, 244 | {0,0.5,0.5}, 245 | {0.25,0.5,0.5}, 246 | {0,0.3,0.3}, 247 | {0.15,0.3,0.3}, 248 | {0,0.15,0.15}, 249 | {0.075,0.15,0.15}, 250 | {0,0.75,1}, // 140 251 | {0.5,0.875,1}, 252 | {0,0.4875,0.65}, 253 | {0.325,0.5688,0.65}, 254 | {0,0.375,0.5}, 255 | {0.25,0.4375,0.5}, 256 | {0,0.225,0.3}, 257 | {0.15,0.2625,0.3}, 258 | {0,0.1125,0.15}, 259 | {0.075,0.1313,0.15}, 260 | {0,0.5,1}, // 150 261 | {0.5,0.75,1}, 262 | {0,0.325,0.65}, 263 | {0.325,0.4875,0.65}, 264 | {0,0.25,0.5}, 265 | {0.25,0.375,0.5}, 266 | {0,0.15,0.3}, 267 | {0.15,0.225,0.3}, 268 | {0,0.075,0.15}, 269 | {0.075,0.1125,0.15}, 270 | {0,0.25,1}, // 160 271 | {0.5,0.625,1}, 272 | {0,0.1625,0.65}, 273 | {0.325,0.4063,0.65}, 274 | {0,0.125,0.5}, 275 | {0.25,0.3125,0.5}, 276 | {0,0.075,0.3}, 277 | {0.15,0.1875,0.3}, 278 | {0,0.0375,0.15}, 279 | {0.075,0.0938,0.15}, 280 | {0,0,1}, // 170 281 | {0.5,0.5,1}, 282 | {0,0,0.65}, 283 | {0.325,0.325,0.65}, 284 | {0,0,0.5}, 285 | {0.25,0.25,0.5}, 286 | {0,0,0.3}, 287 | {0.15,0.15,0.3}, 288 | {0,0,0.15}, 289 | {0.075,0.075,0.15}, 290 | {0.25,0,1}, // 180 291 | {0.625,0.5,1}, 292 | {0.1625,0,0.65}, 293 | {0.4063,0.325,0.65}, 294 | {0.125,0,0.5}, 295 | {0.3125,0.25,0.5}, 296 | {0.075,0,0.3}, 297 | {0.1875,0.15,0.3}, 298 | {0.0375,0,0.15}, 299 | {0.0938,0.075,0.15}, 300 | {0.5,0,1}, // 190 301 | {0.75,0.5,1}, 302 | {0.325,0,0.65}, 303 | {0.4875,0.325,0.65}, 304 | {0.25,0,0.5}, 305 | {0.375,0.25,0.5}, 306 | {0.15,0,0.3}, 307 | {0.225,0.15,0.3}, 308 | {0.075,0,0.15}, 309 | {0.1125,0.075,0.15}, 310 | {0.75,0,1}, // 200 311 | {0.875,0.5,1}, 312 | {0.4875,0,0.65}, 313 | {0.5688,0.325,0.65}, 314 | {0.375,0,0.5}, 315 | {0.4375,0.25,0.5}, 316 | {0.225,0,0.3}, 317 | {0.2625,0.15,0.3}, 318 | {0.1125,0,0.15}, 319 | {0.1313,0.075,0.15}, 320 | {1,0,1}, // 210 321 | {1,0.5,1}, 322 | {0.65,0,0.65}, 323 | {0.65,0.325,0.65}, 324 | {0.5,0,0.5}, 325 | {0.5,0.25,0.5}, 326 | {0.3,0,0.3}, 327 | {0.3,0.15,0.3}, 328 | {0.15,0,0.15}, 329 | {0.15,0.075,0.15}, 330 | {1,0,0.75}, // 220 331 | {1,0.5,0.875}, 332 | {0.65,0,0.4875}, 333 | {0.65,0.325,0.5688}, 334 | {0.5,0,0.375}, 335 | {0.5,0.25,0.4375}, 336 | {0.3,0,0.225}, 337 | {0.3,0.15,0.2625}, 338 | {0.15,0,0.1125}, 339 | {0.15,0.075,0.1313}, 340 | {1,0,0.5}, // 230 341 | {1,0.5,0.75}, 342 | {0.65,0,0.325}, 343 | {0.65,0.325,0.4875}, 344 | {0.5,0,0.25}, 345 | {0.5,0.25,0.375}, 346 | {0.3,0,0.15}, 347 | {0.3,0.15,0.225}, 348 | {0.15,0,0.075}, 349 | {0.15,0.075,0.1125}, 350 | {1,0,0.25}, // 240 351 | {1,0.5,0.625}, 352 | {0.65,0,0.1625}, 353 | {0.65,0.325,0.4063}, 354 | {0.5,0,0.125}, 355 | {0.5,0.25,0.3125}, 356 | {0.3,0,0.075}, 357 | {0.3,0.15,0.1875}, 358 | {0.15,0,0.0375}, 359 | {0.15,0.075,0.0938}, 360 | {0.33,0.33,0.33}, // 250 361 | {0.464,0.464,0.464}, 362 | {0.598,0.598,0.598}, 363 | {0.732,0.732,0.732}, 364 | {0.866,0.866,0.866}, 365 | {1,1,1} // 255 366 | } 367 | ; 368 | 369 | 370 | // AutoCAD VERSION aliases 371 | #define DL_VERSION_R12 DL_Codes::AC1009 372 | #define DL_VERSION_LT2 DL_Codes::AC1009 373 | #define DL_VERSION_R13 DL_Codes::AC1012 // not supported yet 374 | #define DL_VERSION_LT95 DL_Codes::AC1012 // not supported yet 375 | #define DL_VERSION_R14 DL_Codes::AC1014 // not supported yet 376 | #define DL_VERSION_LT97 DL_Codes::AC1014 // not supported yet 377 | #define DL_VERSION_LT98 DL_Codes::AC1014 // not supported yet 378 | #define DL_VERSION_2000 DL_Codes::AC1015 379 | #define DL_VERSION_2002 DL_Codes::AC1015 380 | 381 | 382 | // DXF Group Codes: 383 | 384 | // Strings 385 | #define DL_STRGRP_START 0 386 | #define DL_STRGRP_END 9 387 | 388 | // Coordinates 389 | #define DL_CRDGRP_START 10 390 | #define DL_CRDGRP_END 19 391 | 392 | // Real values 393 | #define DL_RLGRP_START 38 394 | #define DL_RLGRP_END 59 395 | 396 | // Short integer values 397 | #define DL_SHOGRP_START 60 398 | #define DL_SHOGRP_END 79 399 | 400 | // New in Release 13, 401 | #define DL_SUBCLASS 100 402 | 403 | // More coordinates 404 | #define DL_CRD2GRP_START 210 405 | #define DL_CRD2GRP_END 239 406 | 407 | // Extended data strings 408 | #define DL_ESTRGRP_START 1000 409 | #define DL_ESTRGRP_END 1009 410 | 411 | // Extended data reals 412 | #define DL_ERLGRP_START 1010 413 | #define DL_ERLGRP_END 1059 414 | 415 | 416 | #define DL_Y8_COORD_CODE 28 417 | #define DL_Z0_COORD_CODE 30 418 | #define DL_Z8_COORD_CODE 38 419 | 420 | #define DL_POINT_COORD_CODE 10 421 | #define DL_INSERT_COORD_CODE 10 422 | 423 | #define DL_CRD2GRP_START 210 424 | #define DL_CRD2GRP_END 239 425 | 426 | #define DL_THICKNESS 39 427 | #define DL_FIRST_REAL_CODE THICKNESS 428 | #define DL_LAST_REAL_CODE 59 429 | #define DL_FIRST_INT_CODE 60 430 | #define DL_ATTFLAGS_CODE 70 431 | #define DL_PLINE_FLAGS_CODE 70 432 | #define DL_LAYER_FLAGS_CODE 70 433 | #define DL_FLD_LEN_CODE 73 // Inside ATTRIB resbuf 434 | #define DL_LAST_INT_CODE 79 435 | #define DL_X_EXTRU_CODE 210 436 | #define DL_Y_EXTRU_CODE 220 437 | #define DL_Z_EXTRU_CODE 230 438 | #define DL_COMMENT_CODE 999 439 | 440 | // Start and endpoints of a line 441 | #define DL_LINE_START_CODE 10 // Followed by x coord 442 | #define DL_LINE_END_CODE 11 // Followed by x coord 443 | 444 | // Some codes used by blocks 445 | #define DL_BLOCK_FLAGS_CODE 70 // An int containing flags 446 | #define DL_BLOCK_BASE_CODE 10 // Origin of block definition 447 | #define DL_XREF_DEPENDENT 16 // If a block contains an XREF 448 | #define DL_XREF_RESOLVED 32 // If a XREF resolved ok 449 | #define DL_REFERENCED 64 // If a block is ref'd in DWG 450 | 451 | #define DL_XSCALE_CODE 41 452 | #define DL_YSCALE_CODE 42 453 | #define DL_ANGLE_CODE 50 454 | #define DL_INS_POINT_CODE 10 // Followed by x of ins pnt 455 | #define DL_NAME2_CODE 3 // Second appearance of name 456 | 457 | // Some codes used by circle entities 458 | #define DL_CENTER_CODE 10 // Followed by x of center 459 | #define DL_RADIUS_CODE 40 // Followd by radius of circle 460 | 461 | #define DL_COND_OP_CODE -4 // Conditional op,ads_ssget 462 | 463 | // When using ads_buildlist you MUST use RTDXF0 instead of these 464 | #define DL_ENTITY_TYPE_CODE 0 // Then there is LINE, 3DFACE.. 465 | #define DL_SES_CODE 0 // Start End String Code 466 | #define DL_FILE_SEP_CODE 0 // File separator 467 | #define DL_SOT_CODE 0 // Start Of Table 468 | #define DL_TEXTVAL_CODE 1 469 | #define DL_NAME_CODE 2 470 | #define DL_BLOCK_NAME_CODE 2 471 | #define DL_SECTION_NAME_CODE 2 472 | #define DL_ENT_HAND_CODE 5 // What follows is hexa string 473 | #define DL_TXT_STYLE_CODE 7 // Inside attributes 474 | #define DL_LAYER_NAME_CODE 8 // What follows is layer name 475 | #define DL_FIRST_XCOORD_CODE 10 // Group code x of 1st coord 476 | #define DL_FIRST_YCOORD_CODE 20 // Group code y of 1st coord 477 | #define DL_FIRST_ZCOORD_CODE 30 // Group code z of 1st coord 478 | #define DL_L_START_CODE 10 479 | #define DL_L_END_CODE 11 480 | #define DL_TXTHI_CODE 40 481 | #define DL_SCALE_X_CODE 41 482 | #define DL_SCALE_Y_CODE 42 483 | #define DL_SCALE_Z_CODE 43 484 | #define DL_BULGE_CODE 42 // Used in PLINE verts for arcs 485 | #define DL_ROTATION_CODE 50 486 | #define DL_COLOUR_CODE 62 // What follows is a color int 487 | #define DL_LTYPE_CODE 6 // What follows is a linetype 488 | 489 | 490 | // Attribute flags 491 | #define DL_ATTS_FOLLOW_CODE 66 492 | #define DL_ATT_TAG_CODE 2 493 | #define DL_ATT_VAL_CODE 1 494 | #define DL_ATT_FLAGS_CODE 70 // 4 1 bit flags as follows... 495 | #define DL_ATT_INVIS_FLAG 1 496 | #define DL_ATT_CONST_FLAG 2 497 | #define DL_ATT_VERIFY_FLAG 4 // Prompt and verify 498 | #define DL_ATT_PRESET_FLAG 8 // No prompt and no verify 499 | 500 | // PLINE defines 501 | // Flags 502 | #define DL_OPEN_PLINE 0x00 503 | #define DL_CLOSED_PLINE 0x01 504 | #define DL_POLYLINE3D 0x80 505 | #define DL_PFACE_MESH 0x40 506 | #define DL_PGON_MESH 0x10 507 | // Vertices follow entity, required in POLYLINES 508 | #define DL_VERTS_FOLLOW_CODE 66 // Value should always be 1 509 | #define DL_VERTEX_COORD_CODE 10 510 | 511 | 512 | // LAYER flags 513 | #define DL_FROZEN 1 514 | #define DL_FROZEN_BY_DEF 2 515 | #define DL_LOCKED 4 516 | #define DL_OBJECT_USED 64 // Object is ref'd in the dwg 517 | 518 | #define DL_BLOCK_EN_CODE -2 // Block entity definition 519 | #define DL_E_NAME -1 // Entity name 520 | 521 | // Extended data codes 522 | #define DL_EXTD_SENTINEL (-3) 523 | #define DL_EXTD_STR 1000 524 | #define DL_EXTD_APP_NAME 1001 525 | #define DL_EXTD_CTL_STR 1002 526 | #define DL_EXTD_LYR_STR 1003 527 | #define DL_EXTD_CHUNK 1004 528 | #define DL_EXTD_HANDLE 1005 529 | #define DL_EXTD_POINT 1010 530 | #define DL_EXTD_POS 1011 531 | #define DL_EXTD_DISP 1012 532 | #define DL_EXTD_DIR 1013 533 | #define DL_EXTD_FLOAT 1040 534 | #define DL_EXTD_DIST 1041 535 | #define DL_EXTD_SCALE 1042 536 | #define DL_EXTD_INT16 1070 537 | #define DL_EXTD_INT32 1071 538 | 539 | // UCS codes for use in ads_trans 540 | #define DL_WCS_TRANS_CODE 0 541 | #define DL_UCS_TRANS_CODE 1 542 | #define DL_DCS_TRANS_CODE 2 543 | #define DL_PCS_TRANS_CODE 3 544 | 545 | #endif 546 | 547 | --------------------------------------------------------------------------------