From cb3716ffb584fe0f593b6f1669a8efdba1305104 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 29 Mar 2016 02:16:55 +1000 Subject: Added my version of libg3d and friends. --- .../libg3d-0.0.8/plugins/import/imp_dxf/Makefile | 523 +++++++++++++++++++++ .../plugins/import/imp_dxf/Makefile.am | 28 ++ .../plugins/import/imp_dxf/Makefile.in | 523 +++++++++++++++++++++ .../libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.c | 291 ++++++++++++ .../libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.h | 53 +++ .../plugins/import/imp_dxf/imp_dxf_callbacks.c | 349 ++++++++++++++ .../plugins/import/imp_dxf/imp_dxf_callbacks.h | 36 ++ .../plugins/import/imp_dxf/imp_dxf_chunks.h | 196 ++++++++ .../plugins/import/imp_dxf/imp_dxf_color.c | 130 +++++ .../plugins/import/imp_dxf/imp_dxf_color.h | 29 ++ .../plugins/import/imp_dxf/imp_dxf_def.h | 51 ++ .../plugins/import/imp_dxf/imp_dxf_entities.h | 70 +++ .../plugins/import/imp_dxf/imp_dxf_prop.c | 128 +++++ .../plugins/import/imp_dxf/imp_dxf_prop.h | 40 ++ .../plugins/import/imp_dxf/imp_dxf_section.c | 233 +++++++++ .../plugins/import/imp_dxf/imp_dxf_section.h | 34 ++ .../plugins/import/imp_dxf/imp_dxf_types.h | 78 +++ .../plugins/import/imp_dxf/imp_dxf_vars.h | 64 +++ 18 files changed, 2856 insertions(+) create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.am create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.in create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_chunks.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_def.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_entities.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_types.h create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_vars.h (limited to 'src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf') diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile new file mode 100644 index 0000000..8b8a6ed --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile @@ -0,0 +1,523 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# plugins/import/imp_dxf/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/libg3d +pkglibdir = $(libdir)/libg3d +pkgincludedir = $(includedir)/libg3d +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +subdir = plugins/import/imp_dxf +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/g3d/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pluginimpdir)" +pluginimpLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pluginimp_LTLIBRARIES) +imp_dxf_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_imp_dxf_la_OBJECTS = imp_dxf.lo imp_dxf_callbacks.lo \ + imp_dxf_section.lo imp_dxf_color.lo imp_dxf_prop.lo +imp_dxf_la_OBJECTS = $(am_imp_dxf_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(imp_dxf_la_SOURCES) +DIST_SOURCES = $(imp_dxf_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf +AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader +AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DBG_CFLAGS = -O2 +DEBUG = 0 +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +F77 = +FFLAGS = +GDKPIXBUF_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +GDKPIXBUF_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 +GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include +GLIB_GENMARSHAL = glib-genmarshal +GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +GLIB_MKENUMS = glib-mkenums +GOBJECT_QUERY = gobject-query +GREP = /bin/grep +GTKDOC_CHECK = /usr/bin/gtkdoc-check +GTK_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 +HTML_DIR = ${datadir}/gtk-doc/html +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LEX = flex +LEXLIB = -lfl +LEX_OUTPUT_ROOT = lex.yy +LIBGSF_CFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libgsf-1 +LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 +LIBOBJS = +LIBS = -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet +LIBXML2_CFLAGS = -I/usr/include/libxml2 +LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +LN_S = ln -s +LTLIBOBJS = +LTVERSION = 0:8:0 +MAGIC_LIBS = -lmagic +MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo +MATH_LIBS = -lm +MKDIR_P = /bin/mkdir -p +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libg3d +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /usr/bin/pkg-config +PLUGINS_LDFLAGS = -avoid-version -export-dynamic +RANLIB = ranlib +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +VERSION = 0.0.8 +XML2_CONFIG = /usr/bin/xml2-config +XML_CPPFLAGS = -I/usr/include/libxml2 +XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +Z_CFLAGS = +Z_LIBS = -lz +abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf +abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf +abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_builddir = ../../.. +top_srcdir = ../../.. +pluginimpdir = $(pkglibdir)/plugins/import +pluginimp_LTLIBRARIES = \ + imp_dxf.la + +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + -O2 -DDEBUG=0 \ + -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include + +INCLUDES = -I$(top_srcdir)/include +AM_LDFLAGS = \ + -no-undefined -module \ + -avoid-version -export-dynamic + +imp_dxf_la_SOURCES = imp_dxf.c imp_dxf.h \ + imp_dxf_types.h imp_dxf_def.h imp_dxf_vars.h \ + imp_dxf_entities.h imp_dxf_chunks.h \ + imp_dxf_callbacks.c imp_dxf_callbacks.h \ + imp_dxf_section.c imp_dxf_section.h \ + imp_dxf_color.c imp_dxf_color.h \ + imp_dxf_prop.c imp_dxf_prop.h + +imp_dxf_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginimpLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ + done + +clean-pluginimpLTLIBRARIES: + -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +imp_dxf.la: $(imp_dxf_la_OBJECTS) $(imp_dxf_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimpdir) $(imp_dxf_la_OBJECTS) $(imp_dxf_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/imp_dxf.Plo +include ./$(DEPDIR)/imp_dxf_callbacks.Plo +include ./$(DEPDIR)/imp_dxf_color.Plo +include ./$(DEPDIR)/imp_dxf_prop.Plo +include ./$(DEPDIR)/imp_dxf_section.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pluginimpdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginimpLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginimpLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.am new file mode 100644 index 0000000..a370a73 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.am @@ -0,0 +1,28 @@ +pluginimpdir = $(pkglibdir)/plugins/import + +pluginimp_LTLIBRARIES = \ + imp_dxf.la + +LIBTOOL += --quiet + +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ + @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/include + +AM_LDFLAGS = \ + -no-undefined -module \ + @PLUGINS_LDFLAGS@ + +imp_dxf_la_SOURCES = imp_dxf.c imp_dxf.h \ + imp_dxf_types.h imp_dxf_def.h imp_dxf_vars.h \ + imp_dxf_entities.h imp_dxf_chunks.h \ + imp_dxf_callbacks.c imp_dxf_callbacks.h \ + imp_dxf_section.c imp_dxf_section.h \ + imp_dxf_color.c imp_dxf_color.h \ + imp_dxf_prop.c imp_dxf_prop.h +imp_dxf_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.in new file mode 100644 index 0000000..f9f23a4 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/Makefile.in @@ -0,0 +1,523 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/import/imp_dxf +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/g3d/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pluginimpdir)" +pluginimpLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pluginimp_LTLIBRARIES) +imp_dxf_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_imp_dxf_la_OBJECTS = imp_dxf.lo imp_dxf_callbacks.lo \ + imp_dxf_section.lo imp_dxf_color.lo imp_dxf_prop.lo +imp_dxf_la_OBJECTS = $(am_imp_dxf_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(imp_dxf_la_SOURCES) +DIST_SOURCES = $(imp_dxf_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBG_CFLAGS = @DBG_CFLAGS@ +DEBUG = @DEBUG@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ +GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ +LIBGSF_LIBS = @LIBGSF_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ --quiet +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LTVERSION = @LTVERSION@ +MAGIC_LIBS = @MAGIC_LIBS@ +MAKEINFO = @MAKEINFO@ +MATH_LIBS = @MATH_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pluginimpdir = $(pkglibdir)/plugins/import +pluginimp_LTLIBRARIES = \ + imp_dxf.la + +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ + @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/include +AM_LDFLAGS = \ + -no-undefined -module \ + @PLUGINS_LDFLAGS@ + +imp_dxf_la_SOURCES = imp_dxf.c imp_dxf.h \ + imp_dxf_types.h imp_dxf_def.h imp_dxf_vars.h \ + imp_dxf_entities.h imp_dxf_chunks.h \ + imp_dxf_callbacks.c imp_dxf_callbacks.h \ + imp_dxf_section.c imp_dxf_section.h \ + imp_dxf_color.c imp_dxf_color.h \ + imp_dxf_prop.c imp_dxf_prop.h + +imp_dxf_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginimpLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ + done + +clean-pluginimpLTLIBRARIES: + -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) + @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +imp_dxf.la: $(imp_dxf_la_OBJECTS) $(imp_dxf_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimpdir) $(imp_dxf_la_OBJECTS) $(imp_dxf_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_callbacks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_prop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_section.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pluginimpdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginimpLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginimpLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.c new file mode 100644 index 0000000..1b08d6e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.c @@ -0,0 +1,291 @@ +/* $Id: imp_dxf.c 256 2008-09-04 12:02:58Z mmmaddd $ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "imp_dxf.h" +#include "imp_dxf_section.h" +#include "imp_dxf_def.h" + +static void dxf_cleanup(DxfGlobalData *global); + +EAPI +gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, + G3DModel *model, gpointer user_data) +{ + gchar binmagic[22]; + G3DObject *object; + G3DMaterial *material; + DxfGlobalData *global; + G3DMatrix rmatrix[16]; + + global = g_new0(DxfGlobalData, 1); + global->context = context; + global->model = model; + global->stream = stream; + global->blocks = g_hash_table_new(g_str_hash, g_str_equal); + + setlocale(LC_NUMERIC, "C"); + + if((g3d_stream_read(stream, binmagic, 22) == 22) && + (strncmp(binmagic, "AutoCAD Binary DXF", 18) == 0)) + global->binary = TRUE; + else { + setlocale(LC_NUMERIC, "C"); + g3d_stream_seek(stream, 0, G_SEEK_SET); + } + + object = g_new0(G3DObject, 1); + object->name = g_strdup("DXF Object"); + model->objects = g_slist_append(model->objects, object); + + material = g3d_material_new(); + material->name = g_strdup("default material"); + material->flags |= G3D_FLAG_MAT_TWOSIDE; + object->materials = g_slist_append(object->materials, material); + + while(!g3d_stream_eof(stream)) { + int retval = dxf_read_section(global, object); + if(retval != TRUE) { + if(retval == 0xE0F) { + g3d_matrix_identity(rmatrix); + g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix); + g3d_model_transform(model, rmatrix); + dxf_cleanup(global); + return TRUE; + } + g_printerr("error in section..\n"); + dxf_cleanup(global); + return FALSE; + } + } + + g3d_matrix_identity(rmatrix); + g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix); + g3d_model_transform(model, rmatrix); + dxf_cleanup(global); + + return TRUE; +} + +EAPI +gchar *plugin_description(void) +{ + return g_strdup("AutoCAD models."); +} + +EAPI +gchar **plugin_extensions(void) +{ + return g_strsplit("dxf", ":", 0); +} + +/*****************************************************************************/ + +static void dxf_cleanup(DxfGlobalData *global) +{ + g_hash_table_destroy(global->blocks); + g_free(global); +} + +gboolean dxf_read_section(DxfGlobalData *global, G3DObject *object) +{ + gint grpcode; + gchar val_str[DXF_MAX_LINE + 1]; + + grpcode = dxf_read_code(global); + if(grpcode != 0) { +#if DEBUG > 0 + g_printerr("unexpected group code: %d (0 expected)\n", grpcode); +#endif + return FALSE; + } + dxf_read_string(global, val_str); + if(strcmp("EOF", val_str) == 0) + return 0xE0F; + if(strcmp("SECTION", val_str) != 0) { +#if DEBUG > 0 + g_printerr("SECTION expected, found: %s\n", val_str); +#endif + return FALSE; + } + grpcode = dxf_read_code(global); + if(grpcode != 2) { +#if DEBUG > 0 + g_printerr("unexpected group code: %d (2 expected)\n", grpcode); +#endif + return FALSE; + } + dxf_read_string(global, val_str); + + if(strcmp(val_str, "HEADER") == 0) + return dxf_section_HEADER(global); + else if(strcmp(val_str, "TABLES") == 0) + return dxf_section_TABLES(global); + else if(strcmp(val_str, "ENTITIES") == 0) + return dxf_section_ENTITIES(global); + else if(strcmp(val_str, "BLOCKS") == 0) + return dxf_section_BLOCKS(global); + else if(strcmp(val_str, "OBJECTS") == 0) + return dxf_section_OBJECTS(global); + else if(strcmp(val_str, "CLASSES") == 0) + return dxf_section_CLASSES(global); + else { +#if DEBUG > 0 + g_printerr("unknown section '%s', skipping...\n", val_str); +#endif + dxf_skip_section(global); + } + return TRUE; +} + +gchar *dxf_read_string(DxfGlobalData *global, gchar *value) +{ + if(global->binary) { + int pos = 0; + int c; + do + { + c = g3d_stream_read_int8(global->stream); + value[pos] = (char)c; + pos++; + } while(c != '\0'); + return value; + } else { + gchar line[DXF_MAX_LINE + 1]; + + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + line[DXF_MAX_LINE] = '\0'; + if(sscanf(line, "%s", value) == 1) + return g_strchomp(value); + if(sscanf(line, " %s", value) == 1) + return g_strchomp(value); + return NULL; + } +} + +gint32 dxf_read_code(DxfGlobalData *global) +{ + gint32 val = DXF_CODE_INVALID; + gchar line[DXF_MAX_LINE + 1]; + + if(global->binary) + return g3d_stream_read_int8(global->stream); + else { + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + if((sscanf(line, "%d", &val) != 1) && + (sscanf(line, " %d", &val) != 1)) + return DXF_CODE_INVALID; + if(val == 999) { /* comment */ + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + return dxf_read_code(global); + } + return val; + } +} + +gint32 dxf_read_int16(DxfGlobalData *global) +{ + if(global->binary) + return g3d_stream_read_int16_le(global->stream); + else + { + gint32 val; + gchar line[DXF_MAX_LINE]; + + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + if(sscanf(line, "%i", &val) == 1) + return val; + if(sscanf(line, " %i", &val) == 1) + return val; + else + return DXF_CODE_INVALID; + } +} + +gint32 dxf_read_int32(DxfGlobalData *global) +{ + if(global->binary) + return g3d_stream_read_int32_le(global->stream); + else + { + gint32 val; + gchar line[DXF_MAX_LINE]; + + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + if(sscanf(line, "%i", &val) == 1) + return val; + if(sscanf(line, " %i", &val) == 1) + return val; + else + return DXF_CODE_INVALID; + } +} + +gdouble dxf_read_float64(DxfGlobalData *global) +{ + if(global->binary) + return g3d_stream_read_double_le(global->stream); + else + { + gdouble val; + gchar line[DXF_MAX_LINE]; + + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + if(sscanf(line, "%lf", &val) == 1) + return val; + if(sscanf(line, " %lf", &val) == 1) + return val; + else + return 0.0; + } +} + +gboolean dxf_skip_section(DxfGlobalData *global) +{ + gchar c, buf[7], line[DXF_MAX_LINE]; + gsize read; + + while(!g3d_stream_eof(global->stream)) + if(global->binary) { + do { c = g3d_stream_read_int8(global->stream); } while(c != 0); + read = g3d_stream_read(global->stream, buf, 7); + if((read == 7) && (strncmp(buf, "ENDSEC", 6) == 0)) + return TRUE; + else + g3d_stream_seek(global->stream, -read, G_SEEK_CUR); + } else { + g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); + if(strncmp(line, "ENDSEC", 6) == 0) + return TRUE; + } + return TRUE; +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.h new file mode 100644 index 0000000..8c0cc1d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf.h @@ -0,0 +1,53 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_H +#define _IMP_DXF_H + +#include +#include + +#include "imp_dxf_types.h" + +#define DXF_TEST_ENDSEC(str) \ + if(strcmp((str), "ENDSEC") == 0) return TRUE; + +#define DXF_HANDLE_UNKNOWN(global, key, str, section) \ + if(global->binary) { \ + g_warning("imp_dxf: unhandled key %d in section %s @ %#x", \ + key, section, (guint32)g3d_stream_tell(global->stream)); \ + return FALSE; \ + } else { \ + g3d_stream_read_line(global->stream, str, DXF_MAX_LINE); \ + g_debug(\ + "imp_dxf: skipping line %d (section %s, key %d):\n\t\"%s\"\n", \ + g3d_stream_line(global->stream), section, key, str); \ + } + +gint32 dxf_read_section(DxfGlobalData *global, G3DObject *object); +gint32 dxf_read_code(DxfGlobalData *global); +gchar *dxf_read_string(DxfGlobalData *global, gchar *value); +gint32 dxf_read_int16(DxfGlobalData *global); +gint32 dxf_read_int32(DxfGlobalData *global); +gdouble dxf_read_float64(DxfGlobalData *global); +gboolean dxf_skip_section(DxfGlobalData *global); + +#endif diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.c new file mode 100644 index 0000000..c7a6e7c --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.c @@ -0,0 +1,349 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include +#include + +/* need a way to detect non-set float values */ +#ifndef FP_NAN +# ifdef HUGE +# define FP_NAN HUGE +# else +# define FP_NAN 3.40282347e+38F +# endif +#endif + +#include +#include +#include +#include + +#include "imp_dxf.h" +#include "imp_dxf_callbacks.h" +#include "imp_dxf_vars.h" +#include "imp_dxf_def.h" +#include "imp_dxf_prop.h" +#include "imp_dxf_color.h" + +static gboolean dxf_str_in_array(gchar **array, const gchar *needle) +{ + gchar **p = array; + while(*p != NULL) { + if(strcmp(*p, needle) == 0) + return TRUE; + p ++; + } + return FALSE; +} + +#define DXF_VAR_DEBUG 2 + +gboolean dxf_debug_var(DxfGlobalData *global, DxfLocalData *local) +{ + gint32 key; + gint16 i16; + gchar str[DXF_MAX_LINE + 1], strval[DXF_MAX_LINE + 1]; + gdouble x, y, z; + + dxf_read_string(global, str); + if(dxf_str_in_array(dxf_vars_vector3d, str)) { + key = dxf_read_code(global); /* 10 */ + x = dxf_read_float64(global); + key = dxf_read_code(global); /* 20 */ + y = dxf_read_float64(global); + key = dxf_read_code(global); /* 30 */ + z = dxf_read_float64(global); +#if DEBUG > DXF_VAR_DEBUG + g_debug("DXF: [v3d] %s: %.2f, %.2f, %.2f", str, x, y, z); +#endif + } else if(dxf_str_in_array(dxf_vars_vector2d, str)) { + key = dxf_read_code(global); /* 10 */ + x = dxf_read_float64(global); + key = dxf_read_code(global); /* 20 */ + y = dxf_read_float64(global); +#if DEBUG > DXF_VAR_DEBUG + g_debug("DXF: [v2d] %s: %.2f, %.2f", str, x, y); +#endif + } else { + key = dxf_read_code(global); + switch(key) { + case 1: case 2: case 3: case 4: + case 5: case 6: case 7: case 8: + /* string */ + dxf_read_string(global, strval); +#if DEBUG > DXF_VAR_DEBUG + g_debug("DXF: [str] %s: %s", str, strval); +#endif + break; + case 40: + case 50: + x = dxf_read_float64(global); +#if DEBUG > DXF_VAR_DEBUG + g_debug("DXF: [dbl] %s: %.2f", str, x); +#endif + break; + case 62: + case 70: + case 280: + case 290: /* FIXME: boolean */ + case 370: + case 380: + /* 16-bit integer */ + i16 = dxf_read_int16(global); +#if DEBUG > DXF_VAR_DEBUG + g_debug("DXF: [i16] %s: %d", str, i16); +#endif + break; + default: + DXF_HANDLE_UNKNOWN(global, key, strval, "** VARIABLE **"); + break; + } + } + return TRUE; +} + +static inline void dxf_object_append(DxfGlobalData *global, + DxfLocalData *local, G3DObject *object) +{ + if(local->edata->block) + local->edata->block->objects = g_slist_append( + local->edata->block->objects, object); + else + global->model->objects = g_slist_append(global->model->objects, + object); +} + +gboolean dxf_e_3DFACE(DxfGlobalData *global, DxfLocalData *local) +{ + G3DObject *object; + G3DFace *face; + G3DMaterial *material; + gint32 key, i, j, col; + gboolean quad; + + col = dxf_prop_get_int(local->eprop, 62, 254); + material = dxf_color_get_material(global->model, col); + if(material == NULL) + material = local->edata->material; + + object = g_slist_nth_data(global->model->objects, 0); + local->edata->object = object; + local->edata->polyline_flags = 0; + + quad = (dxf_prop_get_dbl(local->eprop, 13, FP_NAN) != FP_NAN); + + face = g_new0(G3DFace, 1); + face->material = material; + face->vertex_count = quad ? 4 : 3; + face->vertex_indices = g_new0(guint32, face->vertex_count); + local->edata->vertex_offset = object->vertex_count; + for(i = 0; i < face->vertex_count; i ++) + face->vertex_indices[i] = local->edata->vertex_offset + i; + + object->vertex_count += face->vertex_count; + object->vertex_data = g_realloc(object->vertex_data, + object->vertex_count * 3 * sizeof(G3DFloat)); + object->faces = g_slist_prepend(object->faces, face); + + for(i = 0; i < face->vertex_count; i ++) { + for(j = 0; j < 3; j ++) { + key = (j + 1) * 10 + i; + object->vertex_data[(local->edata->vertex_offset + i) * 3 + j] = + dxf_prop_get_dbl(local->eprop, key, 0.0); +#if DEBUG > 2 + g_debug("| 3DFACE: data[%d = o + %d * 3 + %d] = prop[%d] = %.2f", + (local->edata->vertex_offset + i) * 3 + j, + i, j, key, + object->vertex_data[ + (local->edata->vertex_offset + i) * 3 + j]); +#endif + } + } + return TRUE; +} + +gboolean dxf_e_BLOCK(DxfGlobalData *global, DxfLocalData *local) +{ + G3DObject *object; + const gchar *name; + + name = dxf_prop_get_str(local->eprop, 2, NULL); + if(local->sid == DXF_ID_BLOCKS) { + object = g_new0(G3DObject, 1); + object->hide = TRUE; + object->name = name ? g_strdup(name) : + g_strdup_printf("unnamed block @ line %d", + g3d_stream_line(global->stream)); + local->edata->block = object; + global->model->objects = g_slist_append(global->model->objects, + object); + if(name) + g_hash_table_insert(global->blocks, object->name, object); + } + return TRUE; +} + +gboolean dxf_e_ENDBLK(DxfGlobalData *global, DxfLocalData *local) +{ + local->edata->block = NULL; + return TRUE; +} + +gboolean dxf_e_INSERT(DxfGlobalData *global, DxfLocalData *local) +{ + G3DObject *block, *object, *subobject; + GSList *item; + const gchar *name; + G3DFloat matrix[16]; + + name = dxf_prop_get_str(local->eprop, 2, "*** error ***"); + block = g_hash_table_lookup(global->blocks, name); + if(block) { + object = g_new0(G3DObject, 1); + object->name = g_strdup_printf("copy of %s", name); + for(item = block->objects; item != NULL; item = item->next) { + subobject = g3d_object_duplicate(item->data); + object->objects = g_slist_append(object->objects, subobject); + } + global->model->objects = g_slist_append(global->model->objects, + object); + local->edata->object = object; + local->edata->vertex_offset = 0; + + /* scale */ + g3d_matrix_identity(matrix); + g3d_matrix_scale( + dxf_prop_get_dbl(local->eprop, 41, 1.0), + dxf_prop_get_dbl(local->eprop, 42, 1.0), + dxf_prop_get_dbl(local->eprop, 43, 1.0), + matrix); + g3d_object_transform(object, matrix); + + /* rotate */ + g3d_matrix_identity(matrix); + g3d_matrix_rotate( + dxf_prop_get_dbl(local->eprop, 50, 0.0), + dxf_prop_get_dbl(local->eprop, 210, 0.0), + dxf_prop_get_dbl(local->eprop, 220, 0.0), + dxf_prop_get_dbl(local->eprop, 230, 1.0), + matrix); + g3d_object_transform(object, matrix); + + /* translate */ + g3d_matrix_identity(matrix); + g3d_matrix_translate( + dxf_prop_get_dbl(local->eprop, 10, 0.0), + dxf_prop_get_dbl(local->eprop, 20, 0.0), + dxf_prop_get_dbl(local->eprop, 30, 0.0), + matrix); + g3d_object_transform(object, matrix); + } + return TRUE; +} + +gboolean dxf_e_POLYLINE(DxfGlobalData *global, DxfLocalData *local) +{ + G3DObject *object = NULL; + G3DMaterial *material; + guint32 flags; + gint32 m, n, col; + + col = dxf_prop_get_int(local->eprop, 62, 254); + material = dxf_color_get_material(global->model, col); + if(material == NULL) + material = local->edata->material; + + flags = dxf_prop_get_int(local->eprop, 70, 0); + if(flags & DXF_POLY_POLYFACE) { + object = g_new0(G3DObject, 1); + object->name = g_strdup_printf("POLYFACE @ line %d", + g3d_stream_line(global->stream)); + object->vertex_count = dxf_prop_get_int(local->eprop, 71, 0); + object->vertex_data = g_new0(G3DFloat, 3 * object->vertex_count); + } else if(flags & DXF_POLY_3D_POLYMESH) { + m = dxf_prop_get_int(local->eprop, 71, 0); + n = dxf_prop_get_int(local->eprop, 72, 0); + object = g3d_primitive_mesh(n, m, + (flags & DXF_POLY_CLOSED), + (flags & DXF_POLY_N_CLOSED), + material); + object->name = g_strdup_printf("3D POLYMESH %d x %d @ line %d", + m, n, g3d_stream_line(global->stream)); + } + + if(object) + dxf_object_append(global, local, object); + + local->edata->object = object; + local->edata->vertex_offset = 0; + local->edata->polyline_flags = flags; + local->edata->tmp_i1 = 0; + return TRUE; +} + +gboolean dxf_e_VERTEX(DxfGlobalData *global, DxfLocalData *local) +{ + G3DObject *object = local->edata->object; + G3DFace *face; + G3DMaterial *material; + guint32 index, flags; + gint32 i, col; + + if(object == NULL) + return TRUE; + + index = local->edata->vertex_offset + local->edata->tmp_i1; + + if(local->edata->polyline_flags & DXF_POLY_3D_POLYMESH) { + g_return_val_if_fail(index < object->vertex_count, FALSE); + for(i = 0; i < 3; i ++) + object->vertex_data[index * 3 + i] = dxf_prop_get_dbl(local->eprop, + 10 * (i + 1), 0.0); + local->edata->tmp_i1 ++; + } else if(local->edata->polyline_flags & DXF_POLY_POLYFACE) { + flags = dxf_prop_get_int(local->eprop, 70, 0); + if(flags & 64) { /* vertex coords */ + g_return_val_if_fail(index < object->vertex_count, FALSE); + for(i = 0; i < 3; i ++) + object->vertex_data[index * 3 + i] = dxf_prop_get_dbl( + local->eprop, 10 * (i + 1), 0.0); + local->edata->tmp_i1 ++; + } + if(flags & 128) { + col = dxf_prop_get_int(local->eprop, 62, 254); + material = dxf_color_get_material(global->model, col); + if(material == NULL) + material = local->edata->material; + + face = g_new0(G3DFace, 1); + face->material = material; + face->vertex_count = + dxf_prop_get_int(local->eprop, 74, 0) ? 4 : 3; + face->vertex_indices = g_new0(guint32, face->vertex_count); + for(i = 0; i < face->vertex_count; i ++) + face->vertex_indices[i] = + MAX(ABS(dxf_prop_get_int(local->eprop, 71 + i, 0)) - 1, 0); + object->faces = g_slist_prepend(object->faces, face); + } + } + + return TRUE; +} diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.h new file mode 100644 index 0000000..3e84fc3 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_callbacks.h @@ -0,0 +1,36 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_CALLBACKS_H +#define _IMP_DXF_CALLBACKS_H + +#include "imp_dxf_types.h" + +gboolean dxf_debug_var(DxfGlobalData *global, DxfLocalData *local); + +gboolean dxf_e_3DFACE(DxfGlobalData *global, DxfLocalData *local); +gboolean dxf_e_BLOCK(DxfGlobalData *global, DxfLocalData *local); +gboolean dxf_e_ENDBLK(DxfGlobalData *global, DxfLocalData *local); +gboolean dxf_e_INSERT(DxfGlobalData *global, DxfLocalData *local); +gboolean dxf_e_POLYLINE(DxfGlobalData *global, DxfLocalData *local); +gboolean dxf_e_VERTEX(DxfGlobalData *global, DxfLocalData *local); + +#endif /* _IMP_DXF_CALLBACKS_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_chunks.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_chunks.h new file mode 100644 index 0000000..4382888 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_chunks.h @@ -0,0 +1,196 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_CHUNKS_H +#define _IMP_DXF_CHUNKS_H + +#include "imp_dxf_callbacks.h" +#include "imp_dxf_types.h" +#include "imp_dxf_def.h" + +static DxfChunkInfo dxf_chunks[] = { + /* app: <0 */ + /* string: 0-9 */ + { 0, "entity type", DXF_T_EMPTY }, + { 1, "primary text value", DXF_T_STRING }, + { 2, "name", DXF_T_STRING }, + { 3, "other text (3)", DXF_T_STRING }, + { 4, "other text (4)", DXF_T_STRING }, + { 5, "entity handle", DXF_T_STRING }, + { 6, "linetype name", DXF_T_STRING }, + { 7, "text style name", DXF_T_STRING }, + { 8, "layer name", DXF_T_STRING }, + { 9, "variable name identifier", DXF_T_UNKNOWN }, + /* double precision 3D point value: 10-39 */ + { 10, "primary point, X value", DXF_T_FLOAT64 }, + { 11, "point #2, X value", DXF_T_FLOAT64 }, + { 12, "point #3, X value", DXF_T_FLOAT64 }, + { 13, "point #4, X value", DXF_T_FLOAT64 }, + { 14, "point #5, X value", DXF_T_FLOAT64 }, + { 15, "point #6, X value", DXF_T_FLOAT64 }, + { 16, "point #7, X value", DXF_T_FLOAT64 }, + { 17, "point #8, X value", DXF_T_FLOAT64 }, + { 18, "point #9, X value", DXF_T_FLOAT64 }, + { 19, "point #10, X value", DXF_T_FLOAT64 }, + { 20, "primary point, Y value", DXF_T_FLOAT64 }, + { 21, "point #2, Y value", DXF_T_FLOAT64 }, + { 22, "point #3, Y value", DXF_T_FLOAT64 }, + { 23, "point #4, Y value", DXF_T_FLOAT64 }, + { 24, "point #5, Y value", DXF_T_FLOAT64 }, + { 25, "point #6, Y value", DXF_T_FLOAT64 }, + { 26, "point #7, Y value", DXF_T_FLOAT64 }, + { 27, "point #8, Y value", DXF_T_FLOAT64 }, + { 28, "point #9, Y value", DXF_T_FLOAT64 }, + { 29, "point #10, Y value", DXF_T_FLOAT64 }, + { 30, "primary point, Z value", DXF_T_FLOAT64 }, + { 31, "point #2, Z value", DXF_T_FLOAT64 }, + { 32, "point #3, Z value", DXF_T_FLOAT64 }, + { 33, "point #4, Z value", DXF_T_FLOAT64 }, + { 34, "point #5, Z value", DXF_T_FLOAT64 }, + { 35, "point #6, Z value", DXF_T_FLOAT64 }, + { 36, "point #7, Z value", DXF_T_FLOAT64 }, + { 37, "point #8, Z value", DXF_T_FLOAT64 }, + { 38, "point #9, Z value", DXF_T_FLOAT64 }, + { 39, "point #10, Z value", DXF_T_FLOAT64 }, + /* double precision floating-point value: 40-59 */ + { 40, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 41, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 42, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 43, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 44, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 45, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 46, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 47, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 48, "linetype scale dbl-prec fp value", DXF_T_FLOAT64 }, + { 49, "repeated dbl-prec fp value", DXF_T_FLOAT64 }, + { 50, "angle", DXF_T_FLOAT64 }, + { 51, "angle", DXF_T_FLOAT64 }, + { 52, "angle", DXF_T_FLOAT64 }, + /* 16-bit integer value: 60-79 */ + { 60, "entity visibility", DXF_T_INT16 }, + { 62, "color number", DXF_T_INT16 }, + { 65, "integer value, 16-bit", DXF_T_INT16 }, + { 66, "entities follow", DXF_T_INT16 }, + { 67, "space", DXF_T_INT16 }, + { 68, "APP: viewport not visible", DXF_T_INT16 }, + { 69, "APP: viewport identification number", DXF_T_INT16 }, + { 70, "integer value, 16-bit", DXF_T_INT16 }, + { 71, "integer value, 16-bit", DXF_T_INT16 }, + { 72, "integer value, 16-bit", DXF_T_INT16 }, + { 73, "integer value, 16-bit", DXF_T_INT16 }, + { 74, "integer value, 16-bit", DXF_T_INT16 }, + { 75, "integer value, 16-bit", DXF_T_INT16 }, + { 76, "integer value, 16-bit", DXF_T_INT16 }, + { 77, "integer value, 16-bit", DXF_T_INT16 }, + { 78, "integer value, 16-bit", DXF_T_INT16 }, + { 79, "integer value, 16-bit", DXF_T_INT16 }, + /* 32-bit integer value: 90-99 */ + { 90, "integer value, 32-bit", DXF_T_INT32 }, + { 91, "integer value, 32-bit", DXF_T_INT32 }, + + { 100, "subclass data marker", DXF_T_STRING }, + { 102, "control string", DXF_T_STRING }, + { 105, "DIMVAR object handle", DXF_T_STRING }, + + { 110, "UCS origin, X value", DXF_T_FLOAT64 }, + { 111, "UCS X-axis, X value", DXF_T_FLOAT64 }, + { 112, "UCS Y-axis, X value", DXF_T_FLOAT64 }, + { 120, "UCS origin, Y value", DXF_T_FLOAT64 }, + { 121, "UCS X-axis, Y value", DXF_T_FLOAT64 }, + { 122, "UCS Y-axis, Y value", DXF_T_FLOAT64 }, + { 130, "UCS origin, Z value", DXF_T_FLOAT64 }, + { 131, "UCS X-axis, Z value", DXF_T_FLOAT64 }, + { 132, "UCS Y-axis, Z value", DXF_T_FLOAT64 }, + + /* double precision floating-point value: 140-149 */ + { 140, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 141, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 142, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 143, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 144, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 145, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 146, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 147, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 148, "double-precision floating-point value", DXF_T_FLOAT64 }, + { 149, "double-precision floating-point value", DXF_T_FLOAT64 }, + /* 16-bit integer value: 170-179 */ + { 170, "integer value, 16-bit", DXF_T_INT16 }, + { 171, "integer value, 16-bit", DXF_T_INT16 }, + { 172, "integer value, 16-bit", DXF_T_INT16 }, + + { 210, "extrusion direction, X value", DXF_T_FLOAT64 }, + { 220, "extrusion direction, Y value", DXF_T_FLOAT64 }, + { 230, "extrusion direction, Z value", DXF_T_FLOAT64 }, + /* 16-bit integer value: 270-279 */ + { 270, "integer value, 16-bit", DXF_T_INT16 }, + { 271, "integer value, 16-bit", DXF_T_INT16 }, + { 272, "integer value, 16-bit", DXF_T_INT16 }, + { 273, "integer value, 16-bit", DXF_T_INT16 }, + { 274, "integer value, 16-bit", DXF_T_INT16 }, + { 275, "integer value, 16-bit", DXF_T_INT16 }, + { 276, "integer value, 16-bit", DXF_T_INT16 }, + { 277, "integer value, 16-bit", DXF_T_INT16 }, + { 278, "integer value, 16-bit", DXF_T_INT16 }, + { 279, "integer value, 16-bit", DXF_T_INT16 }, + /* 16-bit integer value: 280-289 */ + { 280, "integer value, 16-bit", DXF_T_INT16 }, + { 281, "integer value, 16-bit", DXF_T_INT16 }, + { 282, "integer value, 16-bit", DXF_T_INT16 }, + { 283, "integer value, 16-bit", DXF_T_INT16 }, + { 284, "integer value, 16-bit", DXF_T_INT16 }, + { 285, "integer value, 16-bit", DXF_T_INT16 }, + { 286, "integer value, 16-bit", DXF_T_INT16 }, + { 287, "integer value, 16-bit", DXF_T_INT16 }, + { 288, "integer value, 16-bit", DXF_T_INT16 }, + { 289, "integer value, 16-bit", DXF_T_INT16 }, + + /* boolean flag value: 290-299 */ + + { 330, "softpointer handle", DXF_T_STRING }, + { 331, "softpointer handle", DXF_T_STRING }, + { 340, "hardpointer handle", DXF_T_STRING }, + { 350, "softowner handle", DXF_T_STRING }, + + { 370, "lineweight enum value", DXF_T_INT16 }, + + { 390, "PlotStyleName handle", DXF_T_STRING }, + + { 420, "integer value, 32-bit", DXF_T_INT32 }, + + { 1000, "ASCII string", DXF_T_STRING }, + { 1001, "registered application name", DXF_T_STRING }, + { 1002, "extended data control string", DXF_T_STRING }, + + { 1010, "extended data point, X value", DXF_T_FLOAT64 }, + { 1011, "extended 3D world space, X value", DXF_T_FLOAT64 }, + { 1020, "extended data point, Y value", DXF_T_FLOAT64 }, + { 1021, "extended 3D world space, Y value", DXF_T_FLOAT64 }, + { 1030, "extended data point, Z value", DXF_T_FLOAT64 }, + { 1031, "extended 3D world space, Z value", DXF_T_FLOAT64 }, + { 1040, "extended data dbl-prec fp value", DXF_T_FLOAT64 }, + { 1041, "extended data distance value", DXF_T_FLOAT64 }, + { 1070, "extended data 16-bit integer", DXF_T_INT16 }, + { 1071, "extended data 32-bit integer", DXF_T_INT32 }, + + { DXF_CODE_INVALID, NULL, DXF_T_UNKNOWN }, +}; + +#endif /* _IMP_DXF_CHUNKS_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.c new file mode 100644 index 0000000..6ffdf87 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.c @@ -0,0 +1,130 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include + +#include +#include + +static G3DMaterial *get_material(G3DModel *model, const gchar *cname) +{ + G3DMaterial *material; + GSList *item; + + for(item = model->materials; item != NULL; item = item->next) { + material = item->data; + if(strcmp(material->name, cname) == 0) + return material; + } + return NULL; +} + +#define DXF_COL_SET(rx, gx, bx) \ + material->r = ((G3DFloat)(rx) / 255.0); \ + material->g = ((G3DFloat)(gx) / 255.0); \ + material->b = ((G3DFloat)(bx) / 255.0); + +/* + * based on GPL code from + * http://wiki.inkscape.org/wiki/index.php/SOC_Accepted_Proposals + */ +static gboolean set_aci(G3DMaterial *material, gint32 aci) +{ + G3DFloat r, g, b, h, s, l, m; + gint32 mod10; + + if((aci < 10) || (aci > 249)) { + switch(aci) { + case 0: DXF_COL_SET(0x00, 0x00, 0x00); break; + case 1: DXF_COL_SET(0xFF, 0x00, 0x00); break; + case 2: DXF_COL_SET(0xFF, 0xFF, 0x00); break; + case 3: DXF_COL_SET(0x00, 0xFF, 0x00); break; + case 4: DXF_COL_SET(0x00, 0xFF, 0xFF); break; + case 5: DXF_COL_SET(0x00, 0x00, 0xFF); break; + case 6: DXF_COL_SET(0xFF, 0x00, 0xFF); break; + case 7: DXF_COL_SET(0xFF, 0xFF, 0xFF); break; + case 8: DXF_COL_SET(0x80, 0x80, 0x80); break; + case 9: DXF_COL_SET(0xC0, 0xC0, 0xC0); break; + + case 250: DXF_COL_SET(0x33, 0x33, 0x33); break; + case 251: DXF_COL_SET(0x5B, 0x5B, 0x5B); break; + case 252: DXF_COL_SET(0x84, 0x84, 0x84); break; + case 253: DXF_COL_SET(0xAD, 0xAD, 0xAD); break; + case 254: DXF_COL_SET(0xD6, 0xD6, 0xD6); break; + case 255: DXF_COL_SET(0xFF, 0xFF, 0xFF); break; + default: break; + } + } else { + mod10 = aci % 10; + h = 1.5 * (aci - mod10 - 10); + s = ((aci % 2) ? 0.5 : 1.0); + if(mod10 < 2) l = 1.0; + else if(mod10 < 4) l = 0.8; + else if(mod10 < 6) l = 0.6; + else if(mod10 < 8) l = 0.5; + else l = 0.3; + + if(h <= 120) { + r = (120 - h) / 60; + g = h / 60; + b = 0; + } else if(h <= 240) { + r = 0; + g = (240 - h) / 60; + b = (h - 120) / 60; + } else if(h <= 360) { + r = (h - 240) / 60; + g = 0; + b = (360 - h) / 60; + } + r = MIN(r, 1.0); + g = MIN(g, 1.0); + b = MIN(b, 1.0); + m = MAX(r, MAX(g, b)); + material->r = (m - s * (m - r)) * l; + material->g = (m - s * (m - g)) * l; + material->b = (m - s * (m - b)) * l; + } + return TRUE; +} + +G3DMaterial *dxf_color_get_material(G3DModel *model, gint32 aci) +{ + gchar *cname; + G3DMaterial *material; + + cname = g_strdup_printf("color #%d", ABS(aci)); + material = get_material(model, cname); + if(material != NULL) { + g_free(cname); + return material; + } + material = g3d_material_new(); + material->name = cname; + model->materials = g_slist_append(model->materials, material); + set_aci(material, ABS(aci)); +#if DEBUG > 0 + g_debug("| color: %.2f %.2f %.2f", material->r, material->g, material->b); +#endif + + return material; +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.h new file mode 100644 index 0000000..18d09f0 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_color.h @@ -0,0 +1,29 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_COLOR_H +#define _IMP_DXF_COLOR_H + +#include + +G3DMaterial *dxf_color_get_material(G3DModel *model, gint32 aci); + +#endif /* _IMP_DXF_COLOR_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_def.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_def.h new file mode 100644 index 0000000..d64d2ab --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_def.h @@ -0,0 +1,51 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_DEF_H +#define _IMP_DXF_DEF_H + +#define DXF_MAX_LINE 512 +#define DXF_CODE_INVALID 0xDEADBEEF + +#define DXF_ID_HEADER 0x00FF0000 +#define DXF_ID_TABLES 0x00FF0001 +#define DXF_ID_ENTITIES 0x00FF0002 +#define DXF_ID_BLOCKS 0x00FF0003 +#define DXF_ID_OBJECTS 0x00FF0004 +#define DXF_ID_CLASSES 0x00FF0005 + +#define DXF_E_3DFACE 0x0001 +#define DXF_E_POLYLINE 0x0002 +#define DXF_E_VERTEX 0x0003 +#define DXF_E_BLOCK 0x0004 +#define DXF_E_INSERT 0x0005 +#define DXF_E_OTHER 0xFFFF + +#define DXF_POLY_CLOSED 1 +#define DXF_POLY_CURVE_FIT_ADDED 2 +#define DXF_POLY_SPLINE_FIT_ADDED 4 +#define DXF_POLY_3D_POLYLINE 8 +#define DXF_POLY_3D_POLYMESH 16 +#define DXF_POLY_N_CLOSED 32 +#define DXF_POLY_POLYFACE 64 +#define DXF_POLY_LT_PATTERN 128 + +#endif /* _IMP_DXF_DEF_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_entities.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_entities.h new file mode 100644 index 0000000..2e8a0ee --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_entities.h @@ -0,0 +1,70 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_ENTITIES_H +#define _IMP_DXF_ENTITIES_H + +#include "imp_dxf_types.h" +#include "imp_dxf_def.h" +#include "imp_dxf_callbacks.h" + +static DxfEntityInfo dxf_entities[] = { + { "3DFACE", "3D face", DXF_E_3DFACE, dxf_e_3DFACE }, + { "POLYLINE", "Polyline", DXF_E_POLYLINE, dxf_e_POLYLINE }, + { "VERTEX", "Vertex", DXF_E_VERTEX, dxf_e_VERTEX }, + + { "BLOCK", "block", DXF_E_BLOCK, dxf_e_BLOCK }, + { "ENDBLK", "end of block", DXF_E_OTHER, dxf_e_ENDBLK }, + { "INSERT", "insert block reference", DXF_E_INSERT, dxf_e_INSERT }, + + { "3DLINE", "3D line", DXF_E_OTHER, NULL }, + { "ACDBDICTIONARYWDFLT", "unknown", DXF_E_OTHER, NULL }, + { "ACDBPLACEHOLDER", "unknown", DXF_E_OTHER, NULL }, + { "APPID", "application ID", DXF_E_OTHER, NULL }, + { "ARC", "arc", DXF_E_OTHER, NULL }, + { "ATTDEF", "attribute definition", DXF_E_OTHER, NULL }, + { "ATTRIB", "attribute", DXF_E_OTHER, NULL }, + { "BLOCK_RECORD", "block record", DXF_E_OTHER, NULL }, + { "CIRCLE", "circle", DXF_E_OTHER, NULL }, + { "CLASS", "class", DXF_E_OTHER, NULL }, + { "DICTIONARY", "dictionary", DXF_E_OTHER, NULL }, + { "DIMSTYLE", "unknown", DXF_E_OTHER, NULL }, + { "ENDTAB", "end of table", DXF_E_OTHER, NULL }, + { "LAYER", "layer", DXF_E_OTHER, NULL }, + { "LAYOUT", "layout", DXF_E_OTHER, NULL }, + { "LINE", "line", DXF_E_OTHER, NULL }, + { "LTYPE", "line type", DXF_E_OTHER, NULL }, + { "LWPOLYLINE", "unknown", DXF_E_OTHER, NULL }, + { "MLINESTYLE", "unknown", DXF_E_OTHER, NULL }, + { "POINT", "point", DXF_E_OTHER, NULL }, + { "SEQEND", "end of sequence", DXF_E_OTHER, NULL }, + { "SPLINE", "spline curve", DXF_E_OTHER, NULL }, + { "STYLE", "style", DXF_E_OTHER, NULL }, + { "TABLE", "table", DXF_E_OTHER, NULL }, + { "UCS", "UCS", DXF_E_OTHER, NULL }, + { "VIEW", "view", DXF_E_OTHER, NULL }, + { "VIEWPORT", "viewport", DXF_E_OTHER, NULL }, + { "VPORT", "viewport", DXF_E_OTHER, NULL }, + + { NULL, NULL, 0, NULL } +}; + +#endif diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.c new file mode 100644 index 0000000..ce63334 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.c @@ -0,0 +1,128 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include "imp_dxf_types.h" + +struct _DxfEntityProps { + GHashTable *hash; +}; + +typedef struct { + gint32 key; + DxfChunkType type; + union { + gint32 ival; + gdouble dval; + gchar *strval; + } u; +} DxfEProp; + +DxfEntityProps *dxf_prop_create(void) +{ + DxfEntityProps *eprop; + + eprop = g_new0(DxfEntityProps, 1); + eprop->hash = g_hash_table_new(g_int_hash, g_int_equal); + + return eprop; +} + +static gboolean remove_p(gpointer key, gpointer value, gpointer user_data) +{ + DxfEProp *p = value; + if(p->type == DXF_T_STRING) + g_free(p->u.strval); + g_free(p); + return TRUE; +} + +void dxf_prop_cleanup(DxfEntityProps *eprop) +{ + g_hash_table_foreach_remove(eprop->hash, remove_p, NULL); + g_hash_table_destroy(eprop->hash); + g_free(eprop); +} + +static DxfEProp *prop_get(DxfEntityProps *eprop, gint32 key) +{ + DxfEProp *p; + + p = g_hash_table_lookup(eprop->hash, &key); + if(p) + return p; + p = g_new0(DxfEProp, 1); + p->key = key; + g_hash_table_insert(eprop->hash, &(p->key), p); + return p; +} + +gboolean dxf_prop_set_int(DxfEntityProps *eprop, gint32 key, gint32 i) +{ + DxfEProp *p = prop_get(eprop, key); + p->type = DXF_T_INT32; + p->u.ival = i; + return TRUE; +} + +gboolean dxf_prop_set_dbl(DxfEntityProps *eprop, gint32 key, gdouble dbl) +{ + DxfEProp *p = prop_get(eprop, key); + p->type = DXF_T_FLOAT64; + p->u.dval = dbl; + return TRUE; +} + +gboolean dxf_prop_set_str(DxfEntityProps *eprop, gint32 key, + const gchar *str) +{ + DxfEProp *p = prop_get(eprop, key); + p->type = DXF_T_STRING; + if(p->u.strval) + g_free(p->u.strval); + p->u.strval = g_strdup(str); + return TRUE; +} + +gint32 dxf_prop_get_int(DxfEntityProps *eprop, gint32 key, gint32 dfl) +{ + DxfEProp *p = g_hash_table_lookup(eprop->hash, &key); + if(p) + return p->u.ival; + return dfl; +} + +gdouble dxf_prop_get_dbl(DxfEntityProps *eprop, gint32 key, gdouble dfl) +{ + DxfEProp *p = g_hash_table_lookup(eprop->hash, &key); + if(p) + return p->u.dval; + return dfl; +} + +const gchar *dxf_prop_get_str(DxfEntityProps *eprop, gint32 key, + const gchar *dfl) +{ + DxfEProp *p = g_hash_table_lookup(eprop->hash, &key); + if(p) + return p->u.strval; + return dfl; +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.h new file mode 100644 index 0000000..224f69a --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_prop.h @@ -0,0 +1,40 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_PROP_H +#define _IMP_DXF_PROP_H + +#include "imp_dxf_types.h" + +DxfEntityProps *dxf_prop_create(void); +void dxf_prop_cleanup(DxfEntityProps *eprop); + +gboolean dxf_prop_set_int(DxfEntityProps *eprop, gint32 key, gint32 i); +gboolean dxf_prop_set_dbl(DxfEntityProps *eprop, gint32 key, gdouble dbl); +gboolean dxf_prop_set_str(DxfEntityProps *eprop, gint32 key, + const gchar *str); + +gint32 dxf_prop_get_int(DxfEntityProps *eprop, gint32 key, gint32 dfl); +gdouble dxf_prop_get_dbl(DxfEntityProps *eprop, gint32 key, gdouble dfl); +const gchar *dxf_prop_get_str(DxfEntityProps *eprop, gint32 key, + const gchar *dfl); + +#endif /* _IMP_DXF_PROP_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.c new file mode 100644 index 0000000..39cd155 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.c @@ -0,0 +1,233 @@ +/* $Id: imp_dxf_section.c 312 2008-11-17 18:28:56Z mmmaddd $ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include +#include + +#include + +#include "imp_dxf.h" +#include "imp_dxf_prop.h" +#include "imp_dxf_chunks.h" +#include "imp_dxf_entities.h" + +static DxfChunkInfo *dxf_get_chunk_info(DxfChunkInfo *chunks, gint32 id) +{ + guint32 i; + + for(i = 0; chunks[i].id != DXF_CODE_INVALID; i ++) + if(chunks[i].id == id) + return &(chunks[i]); + return NULL; +} + +static DxfEntityInfo *dxf_get_entity_info(const gchar *str) +{ + guint32 i; + + for(i = 0; dxf_entities[i].name != NULL; i ++) + if(strcmp(dxf_entities[i].name, str) == 0) + return &(dxf_entities[i]); +#if DEBUG > 0 + g_debug("unknown entity: %s", str); +#endif + return NULL; +} + +static gboolean dxf_entity_finalize(DxfGlobalData *global, guint32 sid, + DxfEntityData *edata, DxfEntityInfo *einfo, DxfEntityProps *eprop) +{ + DxfLocalData *local; + + if(einfo->callback) { + local = g_new0(DxfLocalData, 1); + local->sid = sid; + local->eid = einfo->id; + local->edata = edata; + local->eprop = eprop; + + einfo->callback(global, local); + + g_free(local); + } + return TRUE; +} + +static gboolean dxf_read_chunk(DxfGlobalData *global, DxfChunkInfo *cinfo, + DxfEntityProps *eprop) +{ + gint32 i; + gdouble dbl; + gchar str[DXF_MAX_LINE + 1]; + + switch(cinfo->type) { + case DXF_T_UNKNOWN: + if(cinfo->id == 9) /* variable name */ + return dxf_debug_var(global, NULL); + break; + case DXF_T_EMPTY: + return TRUE; + break; + case DXF_T_INT16: + i = dxf_read_int16(global); + dxf_prop_set_int(eprop, cinfo->id, i); + break; + case DXF_T_INT32: + i = dxf_read_int32(global); + dxf_prop_set_int(eprop, cinfo->id, i); + break; + case DXF_T_FLOAT64: + dbl = dxf_read_float64(global); + dxf_prop_set_dbl(eprop, cinfo->id, dbl); + break; + case DXF_T_STRING: + dxf_read_string(global, str); + dxf_prop_set_str(eprop, cinfo->id, str); + break; + } + return TRUE; +} + +static gboolean dxf_parse_chunks(DxfGlobalData *global, DxfChunkInfo *chunks, + gint32 parentid, const gchar *section) +{ + gint32 key; + DxfChunkInfo *chunk_info; + DxfEntityData *edata; + DxfEntityInfo *einfo = NULL; + DxfEntityProps *eprop = NULL; + gchar str[DXF_MAX_LINE + 1]; + G3DFloat pcnt, prev_pcnt = 0.0; + +#if DEBUG > 0 + g_debug("\\[%s]", section); +#endif + + edata = g_new0(DxfEntityData, 1); + + if((strcmp(section, "ENTITIES") == 0) || + (strcmp(section, "BLOCKS") == 0)) { + edata->object = g_slist_nth_data(global->model->objects, 0); + edata->material = g_slist_nth_data(edata->object->materials, 0); + } + + while(TRUE) { + key = dxf_read_code(global); + chunk_info = dxf_get_chunk_info(chunks, key); + + if(key == DXF_CODE_INVALID) { + g_free(edata); + return FALSE; + } + + if(key == 0) { /* new entity or end of section */ + if(einfo) { + dxf_entity_finalize(global, parentid, edata, einfo, eprop); + dxf_prop_cleanup(eprop); + eprop = NULL; + } + dxf_read_string(global, str); + DXF_TEST_ENDSEC(str); + einfo = dxf_get_entity_info(str); + eprop = dxf_prop_create(); +#if DEBUG > 0 + g_debug("| entity: %s", str); +#endif + } + +#if DEBUG > 0 + if(chunk_info) + g_debug("\\ %s[%+4d]: %s%s%s (line %d)", + key ? " " : "", + key, chunk_info->description, + key ? "" : ": ", + key ? "" : str, + g3d_stream_line(global->stream)); + else + g_warning("unknown chunk type %d in line %d", key, + g3d_stream_line(global->stream)); +#endif + + if(chunk_info) { + dxf_read_chunk(global, chunk_info, eprop); + } /* chunk_info */ + else { + DXF_HANDLE_UNKNOWN(global, key, str, section); + } + + pcnt = (G3DFloat)g3d_stream_tell(global->stream) / + (G3DFloat)g3d_stream_size(global->stream); + if((pcnt - prev_pcnt) > 0.01) { + prev_pcnt = pcnt; + g3d_context_update_progress_bar(global->context, pcnt, TRUE); + } + g3d_context_update_interface(global->context); + } /* endless loop */ + + g_free(edata); + return FALSE; +} + +gboolean dxf_section_HEADER(DxfGlobalData *global) +{ +#if 0 + return dxf_parse_chunks(global, dxf_chunks, DXF_ID_HEADER, "HEADER"); +#else + return dxf_skip_section(global); +#endif +} + +gboolean dxf_section_ENTITIES(DxfGlobalData *global) +{ + return dxf_parse_chunks(global, dxf_chunks, DXF_ID_ENTITIES, "ENTITIES"); +} + +gboolean dxf_section_BLOCKS(DxfGlobalData *global) +{ + return dxf_parse_chunks(global, dxf_chunks, DXF_ID_BLOCKS, "BLOCKS"); +} + +gboolean dxf_section_TABLES(DxfGlobalData *global) +{ +#if 0 + return dxf_parse_chunks(global, dxf_chunks, DXF_ID_TABLES, "TABLES"); +#else + return dxf_skip_section(global); +#endif +} + +gboolean dxf_section_OBJECTS(DxfGlobalData *global) +{ +#if 0 + return dxf_parse_chunks(global, dxf_chunks, DXF_ID_OBJECTS, "OBJECTS"); +#else + return dxf_skip_section(global); +#endif +} + +gboolean dxf_section_CLASSES(DxfGlobalData *global) +{ +#if 0 + return dxf_parse_chunks(global, dxf_chunks, DXF_ID_CLASSES, "TABLES"); +#else + return dxf_skip_section(global); +#endif +} diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.h new file mode 100644 index 0000000..3adb9c3 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_section.h @@ -0,0 +1,34 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_SECTION_H +#define _IMP_DXF_SECTION_H + +#include "imp_dxf_types.h" + +gboolean dxf_section_HEADER(DxfGlobalData *global); +gboolean dxf_section_TABLES(DxfGlobalData *global); +gboolean dxf_section_BLOCKS(DxfGlobalData *global); +gboolean dxf_section_ENTITIES(DxfGlobalData *global); +gboolean dxf_section_OBJECTS(DxfGlobalData *global); +gboolean dxf_section_CLASSES(DxfGlobalData *global); + +#endif /* _IMP_DXF_SECTION_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_types.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_types.h new file mode 100644 index 0000000..7be6036 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_types.h @@ -0,0 +1,78 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_TYPES_H +#define _IMP_DXF_TYPES_H + +#include + +typedef struct { + G3DContext *context; + G3DModel *model; + G3DStream *stream; + gboolean binary; + GHashTable *blocks; +} DxfGlobalData; + +typedef struct { + G3DObject *object; + G3DObject *block; + G3DMaterial *material; + guint32 vertex_offset; + guint32 tmp_i1; + guint32 polyline_flags; +} DxfEntityData; + +typedef struct _DxfEntityProps DxfEntityProps; + +typedef struct { + gint32 id; + guint32 sid; /* section id */ + guint32 eid; /* entity id */ + DxfEntityData *edata; + DxfEntityProps *eprop; +} DxfLocalData; + +typedef gboolean (* DxfCallback)(DxfGlobalData *, DxfLocalData *); + +typedef struct { + const gchar *name; + const gchar *description; + guint32 id; + DxfCallback callback; +} DxfEntityInfo; + +typedef enum { + DXF_T_UNKNOWN, + DXF_T_EMPTY, + DXF_T_INT16, + DXF_T_INT32, + DXF_T_FLOAT64, + DXF_T_STRING +} DxfChunkType; + +typedef struct { + gint32 id; + const gchar *description; + DxfChunkType type; +} DxfChunkInfo; + +#endif /* _IMP_DXF_TYPES_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_vars.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_vars.h new file mode 100644 index 0000000..a8ea174 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf/imp_dxf_vars.h @@ -0,0 +1,64 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _IMP_DXF_VARS_H +#define _IMP_DXF_VARS_H + +#include + +static gchar *dxf_vars_vector2d[] = { + "$AXISUNIT", + "$LIMMAX", + "$LIMMIN", + "$PLIMMIN", + "$PLIMMAX", + NULL +}; + +static gchar *dxf_vars_vector3d[] = { + "$EXTMIN", + "$EXTMAX", + "$INSBASE", + "$PEXTMAX", + "$PEXTMIN", + "$PINSBASE", + "$PUCSORG", + "$PUCSORGBACK", + "$PUCSORGBOTTOM", + "$PUCSORGFRONT", + "$PUCSORGLEFT", + "$PUCSORGRIGHT", + "$PUCSORGTOP", + "$PUCSXDIR", + "$PUCSYDIR", + "$UCSORG", + "$UCSORGBACK", + "$UCSORGBOTTOM", + "$UCSORGFRONT", + "$UCSORGLEFT", + "$UCSORGRIGHT", + "$UCSORGTOP", + "$UCSXDIR", + "$UCSYDIR", + NULL +}; + +#endif -- cgit v1.1