Skip to content

Commit

Permalink
complete read/write support for ellipse
Browse files Browse the repository at this point in the history
  • Loading branch information
Rallaz committed Nov 19, 2012
1 parent fce038a commit 50cf21d
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 22 deletions.
160 changes: 160 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,163 @@
Author: Rallaz <[email protected]>
Date: Mon Sep 10 17:39:05 2012 +0200

vports, text bugs & update to 0.5.4

Author: Rallaz <[email protected]>
Date: Wed Aug 15 12:11:14 2012 +0200

complete update autotools

Author: Rallaz <[email protected]>
Date: Wed Aug 15 11:46:52 2012 +0200

update autotools

Author: Rallaz <[email protected]>
Date: Tue Aug 14 19:27:52 2012 +0200

updated to version 0.5.2

Author: Rallaz <[email protected]>
Date: Tue Aug 14 19:27:12 2012 +0200

patch for textstyle and dimstyle

Author: Rallaz <[email protected]>
Date: Mon Jun 11 20:59:29 2012 +0200

a bit more write header

Author: Rallaz <[email protected]>
Date: Mon Jun 11 08:33:25 2012 +0200

solve bug reading empty string

Author: Rallaz <[email protected]>
Date: Fri Jun 8 18:01:51 2012 +0200

added VPORT, v0.5.0 reached

Author: Rallaz <[email protected]>
Date: Wed Jun 6 17:39:04 2012 +0200

complete text style table

Author: Rallaz <[email protected]>
Date: Tue Jun 5 21:00:46 2012 +0200

start VPORT, STYLE, add viewport & complete dimstyle

Author: Rallaz <[email protected]>
Date: Tue May 29 18:27:04 2012 +0200

solve bug reading text into 90/270 deg.

Author: Rallaz <[email protected]>
Date: Fri May 25 19:27:00 2012 +0200

overflow in drw_textcodec.cpp

Author: Rallaz <[email protected]>
Date: Fri May 25 18:57:40 2012 +0200

polyline bug & correct configure

Author: Rallaz <[email protected]>
Date: Thu May 24 19:14:58 2012 +0200

missing files & complete dimstyle v12

Author: Rallaz <[email protected]>
Date: Thu May 10 19:55:58 2012 +0200

updated to 0.4.2 locale support

Author: Rallaz <[email protected]>
Date: Thu Apr 19 20:54:39 2012 +0200

update to 0.4 ray, xline, polyline

Author: Rallaz <[email protected]>
Date: Tue Apr 17 17:06:27 2012 +0200

write leader support & update to v0.3.1

Author: Rallaz <[email protected]>
Date: Thu Apr 12 20:29:53 2012 +0200

added write image support

Author: Rallaz <[email protected]>
Date: Thu Apr 5 13:11:51 2012 +0200

update to v0.3.0, blocks texts & splines

Author: Rallaz <[email protected]>
Date: Fri Mar 30 19:44:07 2012 +0200

Added write spline support

Author: Rallaz <[email protected]>
Date: Thu Mar 22 20:59:03 2012 +0100

added support for write more than v2000

Author: Rallaz <[email protected]>
Date: Wed Feb 1 20:00:40 2012 +0100

corect bugs in mtext angle & layer plot flag

Author: Rallaz <[email protected]>
Date: Wed Feb 1 19:41:15 2012 +0100

writer: start supportig versions

Author: Rallaz <[email protected]>
Date: Wed Jan 4 13:42:42 2012 +0100

deleted some autogenerated files

Author: Rallaz <[email protected]>
Date: Wed Jan 4 13:36:07 2012 +0100

Added autotools build system

Author: Rallaz <[email protected]>
Date: Wed Jan 4 11:25:45 2012 +0100

write header support, not handled all vars

Author: Rallaz <[email protected]>
Date: Wed Jan 4 10:03:00 2012 +0100

writer bug thanks to Dongxu Li

Author: Rallaz <[email protected]>
Date: Wed Dec 21 19:48:37 2011 +0100

added ability to apply extrusion

Author: Rallaz <[email protected]>
Date: Sun Dec 18 13:50:47 2011 +0100

:remove little bug in makefile

Author: Rallaz <[email protected]>
Date: Sun Dec 18 13:42:43 2011 +0100

update makefile

Author: Rallaz <[email protected]>
Date: Sun Dec 18 13:09:17 2011 +0100

added read of dimensions, leader & header vars

Author: Rallaz <[email protected]>
Date: Tue Dec 13 19:03:45 2011 +0100

added read image & polyline loop in hatch

Author: Rallaz <[email protected]>
Date: Mon Dec 12 21:02:53 2011 +0100

Expand Down
23 changes: 12 additions & 11 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for libdxfrw 0.5.3.
# Generated by GNU Autoconf 2.68 for libdxfrw 0.5.5.
#
# Report bugs to <https://sourceforge.net/projects/libdxfrw/>.
#
Expand Down Expand Up @@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libdxfrw'
PACKAGE_TARNAME='libdxfrw'
PACKAGE_VERSION='0.5.3'
PACKAGE_STRING='libdxfrw 0.5.3'
PACKAGE_VERSION='0.5.5'
PACKAGE_STRING='libdxfrw 0.5.5'
PACKAGE_BUGREPORT='https://sourceforge.net/projects/libdxfrw/'
PACKAGE_URL=''

Expand Down Expand Up @@ -1301,7 +1301,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libdxfrw 0.5.3 to adapt to many kinds of systems.
\`configure' configures libdxfrw 0.5.5 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1371,7 +1371,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libdxfrw 0.5.3:";;
short | recursive ) echo "Configuration of libdxfrw 0.5.5:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1475,7 +1475,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libdxfrw configure 0.5.3
libdxfrw configure 0.5.5
generated by GNU Autoconf 2.68

Copyright (C) 2010 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2019,7 +2019,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by libdxfrw $as_me 0.5.3, which was
It was created by libdxfrw $as_me 0.5.5, which was
generated by GNU Autoconf 2.68. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -2834,7 +2834,7 @@ fi

# Define the identity of the package.
PACKAGE='libdxfrw'
VERSION='0.5.3'
VERSION='0.5.5'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -14989,8 +14989,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# 6. If any interfaces have been removed since the last public release,
# then set age to 0.
#
#AGE.CURRENT.REVISION
LIBRARY_CURRENT=5
LIBRARY_REVISION=3
LIBRARY_REVISION=5
LIBRARY_AGE=0


Expand Down Expand Up @@ -15864,7 +15865,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libdxfrw $as_me 0.5.3, which was
This file was extended by libdxfrw $as_me 0.5.5, which was
generated by GNU Autoconf 2.68. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -15921,7 +15922,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libdxfrw config.status 0.5.3
libdxfrw config.status 0.5.5
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"

Expand Down
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([libdxfrw], [0.5.4], [https://sourceforge.net/projects/libdxfrw/])
AC_INIT([libdxfrw], [0.5.5], [https://sourceforge.net/projects/libdxfrw/])
AM_INIT_AUTOMAKE([foreign -Wall -Werror dist-bzip2])
AC_CONFIG_SRCDIR([src/drw_interface.h])

Expand Down Expand Up @@ -34,8 +34,9 @@ AC_CONFIG_MACRO_DIR([m4])
# 6. If any interfaces have been removed since the last public release,
# then set age to 0.
#
#AGE.CURRENT.REVISION
LIBRARY_CURRENT=5
LIBRARY_REVISION=4
LIBRARY_REVISION=5
LIBRARY_AGE=0

AC_SUBST(LIBRARY_CURRENT)dnl
Expand Down
8 changes: 6 additions & 2 deletions src/drw_entities.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,24 @@ class DRW_Arc : public DRW_Circle {
//! Class to handle ellipse entity
/*!
* Class to handle ellipse and elliptic arc entity
* Note: start/end parameter are in radians for ellipse entity but
* for hatch boundary are in degrees
* @author Rallaz
*/
class DRW_Ellipse : public DRW_Line {
public:
DRW_Ellipse() {
eType = DRW::ELLIPSE;
isccw = 1;
}

void parseCode(int code, dxfReader *reader);
void toPolyline(DRW_Polyline *pol);
public:
double ratio; /*!< ratio, code 40 */
double staparam; /*!< start parameter, code 41, 0.0 for full ellipse*/
double endparam; /*!< end parameter, code 42, 2*PI for full ellipse */
double staparam; /*!< start parameter, code 41, 0.0 for full ellipse*/
double endparam; /*!< end parameter, code 42, 2*PI for full ellipse */
double isccw; /*!< is counter clockwise arc?, only used in hatch, code 73 */
};

//! Class to handle trace entity
Expand Down
21 changes: 15 additions & 6 deletions src/libdxfrw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,18 @@ bool dxfRW::writeHatch(DRW_Hatch *ent){
writer->writeDouble(51, a->endangle);
writer->writeInt16(73, a->isccw);
break; }
case DRW::ELLIPSE:
//RLZ: elliptic arc boundary writeme
// writer->writeInt16(72, 3);
break;
case DRW::ELLIPSE: {
writer->writeInt16(72, 3);
DRW_Ellipse* a = (DRW_Ellipse*)loop->objlist.at(j);
writer->writeDouble(10, a->basePoint.x);
writer->writeDouble(20, a->basePoint.y);
writer->writeDouble(11, a->secPoint.x);
writer->writeDouble(21, a->secPoint.y);
writer->writeDouble(40, a->ratio);
writer->writeDouble(50, a->staparam);
writer->writeDouble(51, a->endparam);
writer->writeInt16(73, a->isccw);
break; }
case DRW::SPLINE:
//RLZ: spline boundary writeme
// writer->writeInt16(72, 4);
Expand All @@ -914,10 +922,11 @@ bool dxfRW::writeHatch(DRW_Hatch *ent){
writer->writeDouble(52, ent->angle);
writer->writeDouble(41, ent->scale);
writer->writeInt16(77, ent->doubleflag);
}
if (ent->deflines > 0){
writer->writeInt16(78, ent->deflines);
}
/* if (ent->deflines > 0){
writer->writeInt16(78, ent->deflines);
}*/
writer->writeInt16(98, 0);
} else {
//RLZ: TODO verify in acad12
Expand Down
2 changes: 1 addition & 1 deletion src/libdxfrw.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "drw_objects.h"
#include "drw_interface.h"

#define DRW_VERSION "0.5.4"
#define DRW_VERSION "0.5.5"

class dxfReader;
class dxfWriter;
Expand Down

0 comments on commit 50cf21d

Please sign in to comment.