diff options
author | David Walter Seikel | 2016-03-29 02:16:55 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-03-29 02:16:55 +1000 |
commit | cb3716ffb584fe0f593b6f1669a8efdba1305104 (patch) | |
tree | 5d1ebc4b6fc17b30f4b34e7e64a2d9514893459b /src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf | |
parent | Add Prosody build script. (diff) | |
download | SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.zip SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.gz SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.bz2 SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.xz |
Added my version of libg3d and friends.
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf')
18 files changed, 2856 insertions, 0 deletions
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 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # plugins/import/imp_dxf/Makefile. Generated from Makefile.in by configure. | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | ||
6 | # This Makefile.in is free software; the Free Software Foundation | ||
7 | # gives unlimited permission to copy and/or distribute it, | ||
8 | # with or without modifications, as long as this notice is preserved. | ||
9 | |||
10 | # This program is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
13 | # PARTICULAR PURPOSE. | ||
14 | |||
15 | |||
16 | |||
17 | |||
18 | pkgdatadir = $(datadir)/libg3d | ||
19 | pkglibdir = $(libdir)/libg3d | ||
20 | pkgincludedir = $(includedir)/libg3d | ||
21 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
22 | install_sh_DATA = $(install_sh) -c -m 644 | ||
23 | install_sh_PROGRAM = $(install_sh) -c | ||
24 | install_sh_SCRIPT = $(install_sh) -c | ||
25 | INSTALL_HEADER = $(INSTALL_DATA) | ||
26 | transform = $(program_transform_name) | ||
27 | NORMAL_INSTALL = : | ||
28 | PRE_INSTALL = : | ||
29 | POST_INSTALL = : | ||
30 | NORMAL_UNINSTALL = : | ||
31 | PRE_UNINSTALL = : | ||
32 | POST_UNINSTALL = : | ||
33 | build_triplet = x86_64-unknown-linux-gnu | ||
34 | host_triplet = x86_64-unknown-linux-gnu | ||
35 | subdir = plugins/import/imp_dxf | ||
36 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
37 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
38 | am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ | ||
39 | $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ | ||
40 | $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
41 | $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ | ||
42 | $(top_srcdir)/configure.in | ||
43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
44 | $(ACLOCAL_M4) | ||
45 | mkinstalldirs = $(install_sh) -d | ||
46 | CONFIG_HEADER = $(top_builddir)/include/g3d/config.h | ||
47 | CONFIG_CLEAN_FILES = | ||
48 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
49 | am__vpath_adj = case $$p in \ | ||
50 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
51 | *) f=$$p;; \ | ||
52 | esac; | ||
53 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; | ||
54 | am__installdirs = "$(DESTDIR)$(pluginimpdir)" | ||
55 | pluginimpLTLIBRARIES_INSTALL = $(INSTALL) | ||
56 | LTLIBRARIES = $(pluginimp_LTLIBRARIES) | ||
57 | imp_dxf_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_dxf_la_OBJECTS = imp_dxf.lo imp_dxf_callbacks.lo \ | ||
59 | imp_dxf_section.lo imp_dxf_color.lo imp_dxf_prop.lo | ||
60 | imp_dxf_la_OBJECTS = $(am_imp_dxf_la_OBJECTS) | ||
61 | DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d | ||
62 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
63 | am__depfiles_maybe = depfiles | ||
64 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
65 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
66 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
67 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
68 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
69 | CCLD = $(CC) | ||
70 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
71 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
72 | $(LDFLAGS) -o $@ | ||
73 | SOURCES = $(imp_dxf_la_SOURCES) | ||
74 | DIST_SOURCES = $(imp_dxf_la_SOURCES) | ||
75 | ETAGS = etags | ||
76 | CTAGS = ctags | ||
77 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
78 | ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 | ||
79 | AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar | ||
80 | AR = ar | ||
81 | AS = as | ||
82 | AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf | ||
83 | AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader | ||
84 | AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 | ||
85 | AWK = gawk | ||
86 | CC = gcc | ||
87 | CCDEPMODE = depmode=gcc3 | ||
88 | CFLAGS = -g -O2 | ||
89 | CPP = gcc -E | ||
90 | CPPFLAGS = | ||
91 | CXX = g++ | ||
92 | CXXCPP = g++ -E | ||
93 | CXXDEPMODE = depmode=gcc3 | ||
94 | CXXFLAGS = -g -O2 | ||
95 | CYGPATH_W = echo | ||
96 | DBG_CFLAGS = -O2 | ||
97 | DEBUG = 0 | ||
98 | DEFS = -DHAVE_CONFIG_H | ||
99 | DEPDIR = .deps | ||
100 | DLLTOOL = dlltool | ||
101 | ECHO = echo | ||
102 | ECHO_C = | ||
103 | ECHO_N = -n | ||
104 | ECHO_T = | ||
105 | EGREP = /bin/grep -E | ||
106 | EXEEXT = | ||
107 | F77 = | ||
108 | FFLAGS = | ||
109 | 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 | ||
110 | 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 | ||
111 | GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
112 | GLIB_GENMARSHAL = glib-genmarshal | ||
113 | GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
114 | GLIB_MKENUMS = glib-mkenums | ||
115 | GOBJECT_QUERY = gobject-query | ||
116 | GREP = /bin/grep | ||
117 | GTKDOC_CHECK = /usr/bin/gtkdoc-check | ||
118 | 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 | ||
119 | 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 | ||
120 | HTML_DIR = ${datadir}/gtk-doc/html | ||
121 | INSTALL = /usr/bin/install -c | ||
122 | INSTALL_DATA = ${INSTALL} -m 644 | ||
123 | INSTALL_PROGRAM = ${INSTALL} | ||
124 | INSTALL_SCRIPT = ${INSTALL} | ||
125 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s | ||
126 | LDFLAGS = | ||
127 | LEX = flex | ||
128 | LEXLIB = -lfl | ||
129 | LEX_OUTPUT_ROOT = lex.yy | ||
130 | 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 | ||
131 | LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 | ||
132 | LIBOBJS = | ||
133 | LIBS = -lm | ||
134 | LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet | ||
135 | LIBXML2_CFLAGS = -I/usr/include/libxml2 | ||
136 | LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
137 | LN_S = ln -s | ||
138 | LTLIBOBJS = | ||
139 | LTVERSION = 0:8:0 | ||
140 | MAGIC_LIBS = -lmagic | ||
141 | MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo | ||
142 | MATH_LIBS = -lm | ||
143 | MKDIR_P = /bin/mkdir -p | ||
144 | OBJDUMP = objdump | ||
145 | OBJEXT = o | ||
146 | PACKAGE = libg3d | ||
147 | PACKAGE_BUGREPORT = | ||
148 | PACKAGE_NAME = | ||
149 | PACKAGE_STRING = | ||
150 | PACKAGE_TARNAME = | ||
151 | PACKAGE_VERSION = | ||
152 | PATH_SEPARATOR = : | ||
153 | PKG_CONFIG = /usr/bin/pkg-config | ||
154 | PLUGINS_LDFLAGS = -avoid-version -export-dynamic | ||
155 | RANLIB = ranlib | ||
156 | SET_MAKE = | ||
157 | SHELL = /bin/bash | ||
158 | STRIP = strip | ||
159 | VERSION = 0.0.8 | ||
160 | XML2_CONFIG = /usr/bin/xml2-config | ||
161 | XML_CPPFLAGS = -I/usr/include/libxml2 | ||
162 | XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
163 | Z_CFLAGS = | ||
164 | Z_LIBS = -lz | ||
165 | abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf | ||
166 | abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_dxf | ||
167 | abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
168 | abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
169 | ac_ct_CC = gcc | ||
170 | ac_ct_CXX = g++ | ||
171 | ac_ct_F77 = | ||
172 | am__include = include | ||
173 | am__leading_dot = . | ||
174 | am__quote = | ||
175 | am__tar = ${AMTAR} chof - "$$tardir" | ||
176 | am__untar = ${AMTAR} xf - | ||
177 | bindir = ${exec_prefix}/bin | ||
178 | build = x86_64-unknown-linux-gnu | ||
179 | build_alias = | ||
180 | build_cpu = x86_64 | ||
181 | build_os = linux-gnu | ||
182 | build_vendor = unknown | ||
183 | builddir = . | ||
184 | datadir = ${datarootdir} | ||
185 | datarootdir = ${prefix}/share | ||
186 | docdir = ${datarootdir}/doc/${PACKAGE} | ||
187 | dvidir = ${docdir} | ||
188 | exec_prefix = ${prefix} | ||
189 | host = x86_64-unknown-linux-gnu | ||
190 | host_alias = | ||
191 | host_cpu = x86_64 | ||
192 | host_os = linux-gnu | ||
193 | host_vendor = unknown | ||
194 | htmldir = ${docdir} | ||
195 | includedir = ${prefix}/include | ||
196 | infodir = ${datarootdir}/info | ||
197 | install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh | ||
198 | libdir = ${exec_prefix}/lib | ||
199 | libexecdir = ${exec_prefix}/libexec | ||
200 | localedir = ${datarootdir}/locale | ||
201 | localstatedir = ${prefix}/var | ||
202 | mandir = ${datarootdir}/man | ||
203 | mkdir_p = /bin/mkdir -p | ||
204 | oldincludedir = /usr/include | ||
205 | pdfdir = ${docdir} | ||
206 | prefix = /usr/local | ||
207 | program_transform_name = s,x,x, | ||
208 | psdir = ${docdir} | ||
209 | sbindir = ${exec_prefix}/sbin | ||
210 | sharedstatedir = ${prefix}/com | ||
211 | srcdir = . | ||
212 | sysconfdir = ${prefix}/etc | ||
213 | target_alias = | ||
214 | top_builddir = ../../.. | ||
215 | top_srcdir = ../../.. | ||
216 | pluginimpdir = $(pkglibdir)/plugins/import | ||
217 | pluginimp_LTLIBRARIES = \ | ||
218 | imp_dxf.la | ||
219 | |||
220 | AM_CFLAGS = \ | ||
221 | -Wall -ansi -pedantic \ | ||
222 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
223 | -O2 -DDEBUG=0 \ | ||
224 | -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
225 | |||
226 | INCLUDES = -I$(top_srcdir)/include | ||
227 | AM_LDFLAGS = \ | ||
228 | -no-undefined -module \ | ||
229 | -avoid-version -export-dynamic | ||
230 | |||
231 | imp_dxf_la_SOURCES = imp_dxf.c imp_dxf.h \ | ||
232 | imp_dxf_types.h imp_dxf_def.h imp_dxf_vars.h \ | ||
233 | imp_dxf_entities.h imp_dxf_chunks.h \ | ||
234 | imp_dxf_callbacks.c imp_dxf_callbacks.h \ | ||
235 | imp_dxf_section.c imp_dxf_section.h \ | ||
236 | imp_dxf_color.c imp_dxf_color.h \ | ||
237 | imp_dxf_prop.c imp_dxf_prop.h | ||
238 | |||
239 | imp_dxf_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
240 | all: all-am | ||
241 | |||
242 | .SUFFIXES: | ||
243 | .SUFFIXES: .c .lo .o .obj | ||
244 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
245 | @for dep in $?; do \ | ||
246 | case '$(am__configure_deps)' in \ | ||
247 | *$$dep*) \ | ||
248 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
249 | && exit 0; \ | ||
250 | exit 1;; \ | ||
251 | esac; \ | ||
252 | done; \ | ||
253 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile'; \ | ||
254 | cd $(top_srcdir) && \ | ||
255 | $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile | ||
256 | .PRECIOUS: Makefile | ||
257 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
258 | @case '$?' in \ | ||
259 | *config.status*) \ | ||
260 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
261 | *) \ | ||
262 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
263 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
264 | esac; | ||
265 | |||
266 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
267 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
268 | |||
269 | $(top_srcdir)/configure: $(am__configure_deps) | ||
270 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
271 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
272 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
273 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
274 | @$(NORMAL_INSTALL) | ||
275 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
276 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
277 | if test -f $$p; then \ | ||
278 | f=$(am__strip_dir) \ | ||
279 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
280 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
281 | else :; fi; \ | ||
282 | done | ||
283 | |||
284 | uninstall-pluginimpLTLIBRARIES: | ||
285 | @$(NORMAL_UNINSTALL) | ||
286 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
287 | p=$(am__strip_dir) \ | ||
288 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
289 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
290 | done | ||
291 | |||
292 | clean-pluginimpLTLIBRARIES: | ||
293 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
294 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
295 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
296 | test "$$dir" != "$$p" || dir=.; \ | ||
297 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
298 | rm -f "$${dir}/so_locations"; \ | ||
299 | done | ||
300 | imp_dxf.la: $(imp_dxf_la_OBJECTS) $(imp_dxf_la_DEPENDENCIES) | ||
301 | $(LINK) -rpath $(pluginimpdir) $(imp_dxf_la_OBJECTS) $(imp_dxf_la_LIBADD) $(LIBS) | ||
302 | |||
303 | mostlyclean-compile: | ||
304 | -rm -f *.$(OBJEXT) | ||
305 | |||
306 | distclean-compile: | ||
307 | -rm -f *.tab.c | ||
308 | |||
309 | include ./$(DEPDIR)/imp_dxf.Plo | ||
310 | include ./$(DEPDIR)/imp_dxf_callbacks.Plo | ||
311 | include ./$(DEPDIR)/imp_dxf_color.Plo | ||
312 | include ./$(DEPDIR)/imp_dxf_prop.Plo | ||
313 | include ./$(DEPDIR)/imp_dxf_section.Plo | ||
314 | |||
315 | .c.o: | ||
316 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
317 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
318 | # source='$<' object='$@' libtool=no \ | ||
319 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
320 | # $(COMPILE) -c $< | ||
321 | |||
322 | .c.obj: | ||
323 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
324 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
325 | # source='$<' object='$@' libtool=no \ | ||
326 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
327 | # $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
328 | |||
329 | .c.lo: | ||
330 | $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
331 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
332 | # source='$<' object='$@' libtool=yes \ | ||
333 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
334 | # $(LTCOMPILE) -c -o $@ $< | ||
335 | |||
336 | mostlyclean-libtool: | ||
337 | -rm -f *.lo | ||
338 | |||
339 | clean-libtool: | ||
340 | -rm -rf .libs _libs | ||
341 | |||
342 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
343 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
344 | unique=`for i in $$list; do \ | ||
345 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
346 | done | \ | ||
347 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
348 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
349 | mkid -fID $$unique | ||
350 | tags: TAGS | ||
351 | |||
352 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
353 | $(TAGS_FILES) $(LISP) | ||
354 | tags=; \ | ||
355 | here=`pwd`; \ | ||
356 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
357 | unique=`for i in $$list; do \ | ||
358 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
359 | done | \ | ||
360 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
361 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
362 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
363 | test -n "$$unique" || unique=$$empty_fix; \ | ||
364 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
365 | $$tags $$unique; \ | ||
366 | fi | ||
367 | ctags: CTAGS | ||
368 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
369 | $(TAGS_FILES) $(LISP) | ||
370 | tags=; \ | ||
371 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
372 | unique=`for i in $$list; do \ | ||
373 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
374 | done | \ | ||
375 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
376 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
377 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
378 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
379 | $$tags $$unique | ||
380 | |||
381 | GTAGS: | ||
382 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
383 | && cd $(top_srcdir) \ | ||
384 | && gtags -i $(GTAGS_ARGS) $$here | ||
385 | |||
386 | distclean-tags: | ||
387 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
388 | |||
389 | distdir: $(DISTFILES) | ||
390 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
391 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
392 | list='$(DISTFILES)'; \ | ||
393 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
394 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
395 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
396 | case $$dist_files in \ | ||
397 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
398 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
399 | sort -u` ;; \ | ||
400 | esac; \ | ||
401 | for file in $$dist_files; do \ | ||
402 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
403 | if test -d $$d/$$file; then \ | ||
404 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
405 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
406 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
407 | fi; \ | ||
408 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
409 | else \ | ||
410 | test -f $(distdir)/$$file \ | ||
411 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
412 | || exit 1; \ | ||
413 | fi; \ | ||
414 | done | ||
415 | check-am: all-am | ||
416 | check: check-am | ||
417 | all-am: Makefile $(LTLIBRARIES) | ||
418 | installdirs: | ||
419 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
420 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
421 | done | ||
422 | install: install-am | ||
423 | install-exec: install-exec-am | ||
424 | install-data: install-data-am | ||
425 | uninstall: uninstall-am | ||
426 | |||
427 | install-am: all-am | ||
428 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
429 | |||
430 | installcheck: installcheck-am | ||
431 | install-strip: | ||
432 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
433 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
434 | `test -z '$(STRIP)' || \ | ||
435 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
436 | mostlyclean-generic: | ||
437 | |||
438 | clean-generic: | ||
439 | |||
440 | distclean-generic: | ||
441 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
442 | |||
443 | maintainer-clean-generic: | ||
444 | @echo "This command is intended for maintainers to use" | ||
445 | @echo "it deletes files that may require special tools to rebuild." | ||
446 | clean: clean-am | ||
447 | |||
448 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
449 | mostlyclean-am | ||
450 | |||
451 | distclean: distclean-am | ||
452 | -rm -rf ./$(DEPDIR) | ||
453 | -rm -f Makefile | ||
454 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
455 | distclean-tags | ||
456 | |||
457 | dvi: dvi-am | ||
458 | |||
459 | dvi-am: | ||
460 | |||
461 | html: html-am | ||
462 | |||
463 | info: info-am | ||
464 | |||
465 | info-am: | ||
466 | |||
467 | install-data-am: install-pluginimpLTLIBRARIES | ||
468 | |||
469 | install-dvi: install-dvi-am | ||
470 | |||
471 | install-exec-am: | ||
472 | |||
473 | install-html: install-html-am | ||
474 | |||
475 | install-info: install-info-am | ||
476 | |||
477 | install-man: | ||
478 | |||
479 | install-pdf: install-pdf-am | ||
480 | |||
481 | install-ps: install-ps-am | ||
482 | |||
483 | installcheck-am: | ||
484 | |||
485 | maintainer-clean: maintainer-clean-am | ||
486 | -rm -rf ./$(DEPDIR) | ||
487 | -rm -f Makefile | ||
488 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
489 | |||
490 | mostlyclean: mostlyclean-am | ||
491 | |||
492 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
493 | mostlyclean-libtool | ||
494 | |||
495 | pdf: pdf-am | ||
496 | |||
497 | pdf-am: | ||
498 | |||
499 | ps: ps-am | ||
500 | |||
501 | ps-am: | ||
502 | |||
503 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
504 | |||
505 | .MAKE: install-am install-strip | ||
506 | |||
507 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
508 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
509 | distclean-compile distclean-generic distclean-libtool \ | ||
510 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
511 | install install-am install-data install-data-am install-dvi \ | ||
512 | install-dvi-am install-exec install-exec-am install-html \ | ||
513 | install-html-am install-info install-info-am install-man \ | ||
514 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
515 | install-ps install-ps-am install-strip installcheck \ | ||
516 | installcheck-am installdirs maintainer-clean \ | ||
517 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
518 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
519 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
520 | |||
521 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
522 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
523 | .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 @@ | |||
1 | pluginimpdir = $(pkglibdir)/plugins/import | ||
2 | |||
3 | pluginimp_LTLIBRARIES = \ | ||
4 | imp_dxf.la | ||
5 | |||
6 | LIBTOOL += --quiet | ||
7 | |||
8 | AM_CFLAGS = \ | ||
9 | -Wall -ansi -pedantic \ | ||
10 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
11 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
12 | @GLIB_CFLAGS@ | ||
13 | |||
14 | INCLUDES = -I$(top_srcdir)/include | ||
15 | |||
16 | AM_LDFLAGS = \ | ||
17 | -no-undefined -module \ | ||
18 | @PLUGINS_LDFLAGS@ | ||
19 | |||
20 | imp_dxf_la_SOURCES = imp_dxf.c imp_dxf.h \ | ||
21 | imp_dxf_types.h imp_dxf_def.h imp_dxf_vars.h \ | ||
22 | imp_dxf_entities.h imp_dxf_chunks.h \ | ||
23 | imp_dxf_callbacks.c imp_dxf_callbacks.h \ | ||
24 | imp_dxf_section.c imp_dxf_section.h \ | ||
25 | imp_dxf_color.c imp_dxf_color.h \ | ||
26 | imp_dxf_prop.c imp_dxf_prop.h | ||
27 | imp_dxf_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ | ||
28 | |||
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 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | ||
6 | # This Makefile.in is free software; the Free Software Foundation | ||
7 | # gives unlimited permission to copy and/or distribute it, | ||
8 | # with or without modifications, as long as this notice is preserved. | ||
9 | |||
10 | # This program is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
13 | # PARTICULAR PURPOSE. | ||
14 | |||
15 | @SET_MAKE@ | ||
16 | |||
17 | VPATH = @srcdir@ | ||
18 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
19 | pkglibdir = $(libdir)/@PACKAGE@ | ||
20 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
21 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
22 | install_sh_DATA = $(install_sh) -c -m 644 | ||
23 | install_sh_PROGRAM = $(install_sh) -c | ||
24 | install_sh_SCRIPT = $(install_sh) -c | ||
25 | INSTALL_HEADER = $(INSTALL_DATA) | ||
26 | transform = $(program_transform_name) | ||
27 | NORMAL_INSTALL = : | ||
28 | PRE_INSTALL = : | ||
29 | POST_INSTALL = : | ||
30 | NORMAL_UNINSTALL = : | ||
31 | PRE_UNINSTALL = : | ||
32 | POST_UNINSTALL = : | ||
33 | build_triplet = @build@ | ||
34 | host_triplet = @host@ | ||
35 | subdir = plugins/import/imp_dxf | ||
36 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
37 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
38 | am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ | ||
39 | $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ | ||
40 | $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
41 | $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ | ||
42 | $(top_srcdir)/configure.in | ||
43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
44 | $(ACLOCAL_M4) | ||
45 | mkinstalldirs = $(install_sh) -d | ||
46 | CONFIG_HEADER = $(top_builddir)/include/g3d/config.h | ||
47 | CONFIG_CLEAN_FILES = | ||
48 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
49 | am__vpath_adj = case $$p in \ | ||
50 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
51 | *) f=$$p;; \ | ||
52 | esac; | ||
53 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; | ||
54 | am__installdirs = "$(DESTDIR)$(pluginimpdir)" | ||
55 | pluginimpLTLIBRARIES_INSTALL = $(INSTALL) | ||
56 | LTLIBRARIES = $(pluginimp_LTLIBRARIES) | ||
57 | imp_dxf_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_dxf_la_OBJECTS = imp_dxf.lo imp_dxf_callbacks.lo \ | ||
59 | imp_dxf_section.lo imp_dxf_color.lo imp_dxf_prop.lo | ||
60 | imp_dxf_la_OBJECTS = $(am_imp_dxf_la_OBJECTS) | ||
61 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d | ||
62 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
63 | am__depfiles_maybe = depfiles | ||
64 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
65 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
66 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
67 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
68 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
69 | CCLD = $(CC) | ||
70 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
71 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
72 | $(LDFLAGS) -o $@ | ||
73 | SOURCES = $(imp_dxf_la_SOURCES) | ||
74 | DIST_SOURCES = $(imp_dxf_la_SOURCES) | ||
75 | ETAGS = etags | ||
76 | CTAGS = ctags | ||
77 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
78 | ACLOCAL = @ACLOCAL@ | ||
79 | AMTAR = @AMTAR@ | ||
80 | AR = @AR@ | ||
81 | AS = @AS@ | ||
82 | AUTOCONF = @AUTOCONF@ | ||
83 | AUTOHEADER = @AUTOHEADER@ | ||
84 | AUTOMAKE = @AUTOMAKE@ | ||
85 | AWK = @AWK@ | ||
86 | CC = @CC@ | ||
87 | CCDEPMODE = @CCDEPMODE@ | ||
88 | CFLAGS = @CFLAGS@ | ||
89 | CPP = @CPP@ | ||
90 | CPPFLAGS = @CPPFLAGS@ | ||
91 | CXX = @CXX@ | ||
92 | CXXCPP = @CXXCPP@ | ||
93 | CXXDEPMODE = @CXXDEPMODE@ | ||
94 | CXXFLAGS = @CXXFLAGS@ | ||
95 | CYGPATH_W = @CYGPATH_W@ | ||
96 | DBG_CFLAGS = @DBG_CFLAGS@ | ||
97 | DEBUG = @DEBUG@ | ||
98 | DEFS = @DEFS@ | ||
99 | DEPDIR = @DEPDIR@ | ||
100 | DLLTOOL = @DLLTOOL@ | ||
101 | ECHO = @ECHO@ | ||
102 | ECHO_C = @ECHO_C@ | ||
103 | ECHO_N = @ECHO_N@ | ||
104 | ECHO_T = @ECHO_T@ | ||
105 | EGREP = @EGREP@ | ||
106 | EXEEXT = @EXEEXT@ | ||
107 | F77 = @F77@ | ||
108 | FFLAGS = @FFLAGS@ | ||
109 | GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ | ||
110 | GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ | ||
111 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
112 | GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ | ||
113 | GLIB_LIBS = @GLIB_LIBS@ | ||
114 | GLIB_MKENUMS = @GLIB_MKENUMS@ | ||
115 | GOBJECT_QUERY = @GOBJECT_QUERY@ | ||
116 | GREP = @GREP@ | ||
117 | GTKDOC_CHECK = @GTKDOC_CHECK@ | ||
118 | GTK_CFLAGS = @GTK_CFLAGS@ | ||
119 | GTK_LIBS = @GTK_LIBS@ | ||
120 | HTML_DIR = @HTML_DIR@ | ||
121 | INSTALL = @INSTALL@ | ||
122 | INSTALL_DATA = @INSTALL_DATA@ | ||
123 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
124 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
125 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
126 | LDFLAGS = @LDFLAGS@ | ||
127 | LEX = @LEX@ | ||
128 | LEXLIB = @LEXLIB@ | ||
129 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ | ||
130 | LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ | ||
131 | LIBGSF_LIBS = @LIBGSF_LIBS@ | ||
132 | LIBOBJS = @LIBOBJS@ | ||
133 | LIBS = @LIBS@ | ||
134 | LIBTOOL = @LIBTOOL@ --quiet | ||
135 | LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ | ||
136 | LIBXML2_LIBS = @LIBXML2_LIBS@ | ||
137 | LN_S = @LN_S@ | ||
138 | LTLIBOBJS = @LTLIBOBJS@ | ||
139 | LTVERSION = @LTVERSION@ | ||
140 | MAGIC_LIBS = @MAGIC_LIBS@ | ||
141 | MAKEINFO = @MAKEINFO@ | ||
142 | MATH_LIBS = @MATH_LIBS@ | ||
143 | MKDIR_P = @MKDIR_P@ | ||
144 | OBJDUMP = @OBJDUMP@ | ||
145 | OBJEXT = @OBJEXT@ | ||
146 | PACKAGE = @PACKAGE@ | ||
147 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
148 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
149 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
150 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
151 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
152 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
153 | PKG_CONFIG = @PKG_CONFIG@ | ||
154 | PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ | ||
155 | RANLIB = @RANLIB@ | ||
156 | SET_MAKE = @SET_MAKE@ | ||
157 | SHELL = @SHELL@ | ||
158 | STRIP = @STRIP@ | ||
159 | VERSION = @VERSION@ | ||
160 | XML2_CONFIG = @XML2_CONFIG@ | ||
161 | XML_CPPFLAGS = @XML_CPPFLAGS@ | ||
162 | XML_LIBS = @XML_LIBS@ | ||
163 | Z_CFLAGS = @Z_CFLAGS@ | ||
164 | Z_LIBS = @Z_LIBS@ | ||
165 | abs_builddir = @abs_builddir@ | ||
166 | abs_srcdir = @abs_srcdir@ | ||
167 | abs_top_builddir = @abs_top_builddir@ | ||
168 | abs_top_srcdir = @abs_top_srcdir@ | ||
169 | ac_ct_CC = @ac_ct_CC@ | ||
170 | ac_ct_CXX = @ac_ct_CXX@ | ||
171 | ac_ct_F77 = @ac_ct_F77@ | ||
172 | am__include = @am__include@ | ||
173 | am__leading_dot = @am__leading_dot@ | ||
174 | am__quote = @am__quote@ | ||
175 | am__tar = @am__tar@ | ||
176 | am__untar = @am__untar@ | ||
177 | bindir = @bindir@ | ||
178 | build = @build@ | ||
179 | build_alias = @build_alias@ | ||
180 | build_cpu = @build_cpu@ | ||
181 | build_os = @build_os@ | ||
182 | build_vendor = @build_vendor@ | ||
183 | builddir = @builddir@ | ||
184 | datadir = @datadir@ | ||
185 | datarootdir = @datarootdir@ | ||
186 | docdir = @docdir@ | ||
187 | dvidir = @dvidir@ | ||
188 | exec_prefix = @exec_prefix@ | ||
189 | host = @host@ | ||
190 | host_alias = @host_alias@ | ||
191 | host_cpu = @host_cpu@ | ||
192 | host_os = @host_os@ | ||
193 | host_vendor = @host_vendor@ | ||
194 | htmldir = @htmldir@ | ||
195 | includedir = @includedir@ | ||
196 | infodir = @infodir@ | ||
197 | install_sh = @install_sh@ | ||
198 | libdir = @libdir@ | ||
199 | libexecdir = @libexecdir@ | ||
200 | localedir = @localedir@ | ||
201 | localstatedir = @localstatedir@ | ||
202 | mandir = @mandir@ | ||
203 | mkdir_p = @mkdir_p@ | ||
204 | oldincludedir = @oldincludedir@ | ||
205 | pdfdir = @pdfdir@ | ||
206 | prefix = @prefix@ | ||
207 | program_transform_name = @program_transform_name@ | ||
208 | psdir = @psdir@ | ||
209 | sbindir = @sbindir@ | ||
210 | sharedstatedir = @sharedstatedir@ | ||
211 | srcdir = @srcdir@ | ||
212 | sysconfdir = @sysconfdir@ | ||
213 | target_alias = @target_alias@ | ||
214 | top_builddir = @top_builddir@ | ||
215 | top_srcdir = @top_srcdir@ | ||
216 | pluginimpdir = $(pkglibdir)/plugins/import | ||
217 | pluginimp_LTLIBRARIES = \ | ||
218 | imp_dxf.la | ||
219 | |||
220 | AM_CFLAGS = \ | ||
221 | -Wall -ansi -pedantic \ | ||
222 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
223 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
224 | @GLIB_CFLAGS@ | ||
225 | |||
226 | INCLUDES = -I$(top_srcdir)/include | ||
227 | AM_LDFLAGS = \ | ||
228 | -no-undefined -module \ | ||
229 | @PLUGINS_LDFLAGS@ | ||
230 | |||
231 | imp_dxf_la_SOURCES = imp_dxf.c imp_dxf.h \ | ||
232 | imp_dxf_types.h imp_dxf_def.h imp_dxf_vars.h \ | ||
233 | imp_dxf_entities.h imp_dxf_chunks.h \ | ||
234 | imp_dxf_callbacks.c imp_dxf_callbacks.h \ | ||
235 | imp_dxf_section.c imp_dxf_section.h \ | ||
236 | imp_dxf_color.c imp_dxf_color.h \ | ||
237 | imp_dxf_prop.c imp_dxf_prop.h | ||
238 | |||
239 | imp_dxf_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ | ||
240 | all: all-am | ||
241 | |||
242 | .SUFFIXES: | ||
243 | .SUFFIXES: .c .lo .o .obj | ||
244 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
245 | @for dep in $?; do \ | ||
246 | case '$(am__configure_deps)' in \ | ||
247 | *$$dep*) \ | ||
248 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
249 | && exit 0; \ | ||
250 | exit 1;; \ | ||
251 | esac; \ | ||
252 | done; \ | ||
253 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile'; \ | ||
254 | cd $(top_srcdir) && \ | ||
255 | $(AUTOMAKE) --gnu plugins/import/imp_dxf/Makefile | ||
256 | .PRECIOUS: Makefile | ||
257 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
258 | @case '$?' in \ | ||
259 | *config.status*) \ | ||
260 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
261 | *) \ | ||
262 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
263 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
264 | esac; | ||
265 | |||
266 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
267 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
268 | |||
269 | $(top_srcdir)/configure: $(am__configure_deps) | ||
270 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
271 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
272 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
273 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
274 | @$(NORMAL_INSTALL) | ||
275 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
276 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
277 | if test -f $$p; then \ | ||
278 | f=$(am__strip_dir) \ | ||
279 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
280 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
281 | else :; fi; \ | ||
282 | done | ||
283 | |||
284 | uninstall-pluginimpLTLIBRARIES: | ||
285 | @$(NORMAL_UNINSTALL) | ||
286 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
287 | p=$(am__strip_dir) \ | ||
288 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
289 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
290 | done | ||
291 | |||
292 | clean-pluginimpLTLIBRARIES: | ||
293 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
294 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
295 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
296 | test "$$dir" != "$$p" || dir=.; \ | ||
297 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
298 | rm -f "$${dir}/so_locations"; \ | ||
299 | done | ||
300 | imp_dxf.la: $(imp_dxf_la_OBJECTS) $(imp_dxf_la_DEPENDENCIES) | ||
301 | $(LINK) -rpath $(pluginimpdir) $(imp_dxf_la_OBJECTS) $(imp_dxf_la_LIBADD) $(LIBS) | ||
302 | |||
303 | mostlyclean-compile: | ||
304 | -rm -f *.$(OBJEXT) | ||
305 | |||
306 | distclean-compile: | ||
307 | -rm -f *.tab.c | ||
308 | |||
309 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf.Plo@am__quote@ | ||
310 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_callbacks.Plo@am__quote@ | ||
311 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_color.Plo@am__quote@ | ||
312 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_prop.Plo@am__quote@ | ||
313 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_dxf_section.Plo@am__quote@ | ||
314 | |||
315 | .c.o: | ||
316 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
317 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
318 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
319 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
320 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
321 | |||
322 | .c.obj: | ||
323 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
324 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
325 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
326 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
327 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
328 | |||
329 | .c.lo: | ||
330 | @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
331 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
332 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
333 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
334 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
335 | |||
336 | mostlyclean-libtool: | ||
337 | -rm -f *.lo | ||
338 | |||
339 | clean-libtool: | ||
340 | -rm -rf .libs _libs | ||
341 | |||
342 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
343 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
344 | unique=`for i in $$list; do \ | ||
345 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
346 | done | \ | ||
347 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
348 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
349 | mkid -fID $$unique | ||
350 | tags: TAGS | ||
351 | |||
352 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
353 | $(TAGS_FILES) $(LISP) | ||
354 | tags=; \ | ||
355 | here=`pwd`; \ | ||
356 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
357 | unique=`for i in $$list; do \ | ||
358 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
359 | done | \ | ||
360 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
361 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
362 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
363 | test -n "$$unique" || unique=$$empty_fix; \ | ||
364 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
365 | $$tags $$unique; \ | ||
366 | fi | ||
367 | ctags: CTAGS | ||
368 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
369 | $(TAGS_FILES) $(LISP) | ||
370 | tags=; \ | ||
371 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
372 | unique=`for i in $$list; do \ | ||
373 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
374 | done | \ | ||
375 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
376 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
377 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
378 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
379 | $$tags $$unique | ||
380 | |||
381 | GTAGS: | ||
382 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
383 | && cd $(top_srcdir) \ | ||
384 | && gtags -i $(GTAGS_ARGS) $$here | ||
385 | |||
386 | distclean-tags: | ||
387 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
388 | |||
389 | distdir: $(DISTFILES) | ||
390 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
391 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
392 | list='$(DISTFILES)'; \ | ||
393 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
394 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
395 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
396 | case $$dist_files in \ | ||
397 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
398 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
399 | sort -u` ;; \ | ||
400 | esac; \ | ||
401 | for file in $$dist_files; do \ | ||
402 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
403 | if test -d $$d/$$file; then \ | ||
404 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
405 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
406 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
407 | fi; \ | ||
408 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
409 | else \ | ||
410 | test -f $(distdir)/$$file \ | ||
411 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
412 | || exit 1; \ | ||
413 | fi; \ | ||
414 | done | ||
415 | check-am: all-am | ||
416 | check: check-am | ||
417 | all-am: Makefile $(LTLIBRARIES) | ||
418 | installdirs: | ||
419 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
420 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
421 | done | ||
422 | install: install-am | ||
423 | install-exec: install-exec-am | ||
424 | install-data: install-data-am | ||
425 | uninstall: uninstall-am | ||
426 | |||
427 | install-am: all-am | ||
428 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
429 | |||
430 | installcheck: installcheck-am | ||
431 | install-strip: | ||
432 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
433 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
434 | `test -z '$(STRIP)' || \ | ||
435 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
436 | mostlyclean-generic: | ||
437 | |||
438 | clean-generic: | ||
439 | |||
440 | distclean-generic: | ||
441 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
442 | |||
443 | maintainer-clean-generic: | ||
444 | @echo "This command is intended for maintainers to use" | ||
445 | @echo "it deletes files that may require special tools to rebuild." | ||
446 | clean: clean-am | ||
447 | |||
448 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
449 | mostlyclean-am | ||
450 | |||
451 | distclean: distclean-am | ||
452 | -rm -rf ./$(DEPDIR) | ||
453 | -rm -f Makefile | ||
454 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
455 | distclean-tags | ||
456 | |||
457 | dvi: dvi-am | ||
458 | |||
459 | dvi-am: | ||
460 | |||
461 | html: html-am | ||
462 | |||
463 | info: info-am | ||
464 | |||
465 | info-am: | ||
466 | |||
467 | install-data-am: install-pluginimpLTLIBRARIES | ||
468 | |||
469 | install-dvi: install-dvi-am | ||
470 | |||
471 | install-exec-am: | ||
472 | |||
473 | install-html: install-html-am | ||
474 | |||
475 | install-info: install-info-am | ||
476 | |||
477 | install-man: | ||
478 | |||
479 | install-pdf: install-pdf-am | ||
480 | |||
481 | install-ps: install-ps-am | ||
482 | |||
483 | installcheck-am: | ||
484 | |||
485 | maintainer-clean: maintainer-clean-am | ||
486 | -rm -rf ./$(DEPDIR) | ||
487 | -rm -f Makefile | ||
488 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
489 | |||
490 | mostlyclean: mostlyclean-am | ||
491 | |||
492 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
493 | mostlyclean-libtool | ||
494 | |||
495 | pdf: pdf-am | ||
496 | |||
497 | pdf-am: | ||
498 | |||
499 | ps: ps-am | ||
500 | |||
501 | ps-am: | ||
502 | |||
503 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
504 | |||
505 | .MAKE: install-am install-strip | ||
506 | |||
507 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
508 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
509 | distclean-compile distclean-generic distclean-libtool \ | ||
510 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
511 | install install-am install-data install-data-am install-dvi \ | ||
512 | install-dvi-am install-exec install-exec-am install-html \ | ||
513 | install-html-am install-info install-info-am install-man \ | ||
514 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
515 | install-ps install-ps-am install-strip installcheck \ | ||
516 | installcheck-am installdirs maintainer-clean \ | ||
517 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
518 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
519 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
520 | |||
521 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
522 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
523 | .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 @@ | |||
1 | /* $Id: imp_dxf.c 256 2008-09-04 12:02:58Z mmmaddd $ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #include <stdio.h> | ||
24 | #include <string.h> | ||
25 | #include <locale.h> | ||
26 | |||
27 | #include <g3d/types.h> | ||
28 | #include <g3d/stream.h> | ||
29 | #include <g3d/material.h> | ||
30 | #include <g3d/model.h> | ||
31 | #include <g3d/matrix.h> | ||
32 | |||
33 | #include "imp_dxf.h" | ||
34 | #include "imp_dxf_section.h" | ||
35 | #include "imp_dxf_def.h" | ||
36 | |||
37 | static void dxf_cleanup(DxfGlobalData *global); | ||
38 | |||
39 | EAPI | ||
40 | gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, | ||
41 | G3DModel *model, gpointer user_data) | ||
42 | { | ||
43 | gchar binmagic[22]; | ||
44 | G3DObject *object; | ||
45 | G3DMaterial *material; | ||
46 | DxfGlobalData *global; | ||
47 | G3DMatrix rmatrix[16]; | ||
48 | |||
49 | global = g_new0(DxfGlobalData, 1); | ||
50 | global->context = context; | ||
51 | global->model = model; | ||
52 | global->stream = stream; | ||
53 | global->blocks = g_hash_table_new(g_str_hash, g_str_equal); | ||
54 | |||
55 | setlocale(LC_NUMERIC, "C"); | ||
56 | |||
57 | if((g3d_stream_read(stream, binmagic, 22) == 22) && | ||
58 | (strncmp(binmagic, "AutoCAD Binary DXF", 18) == 0)) | ||
59 | global->binary = TRUE; | ||
60 | else { | ||
61 | setlocale(LC_NUMERIC, "C"); | ||
62 | g3d_stream_seek(stream, 0, G_SEEK_SET); | ||
63 | } | ||
64 | |||
65 | object = g_new0(G3DObject, 1); | ||
66 | object->name = g_strdup("DXF Object"); | ||
67 | model->objects = g_slist_append(model->objects, object); | ||
68 | |||
69 | material = g3d_material_new(); | ||
70 | material->name = g_strdup("default material"); | ||
71 | material->flags |= G3D_FLAG_MAT_TWOSIDE; | ||
72 | object->materials = g_slist_append(object->materials, material); | ||
73 | |||
74 | while(!g3d_stream_eof(stream)) { | ||
75 | int retval = dxf_read_section(global, object); | ||
76 | if(retval != TRUE) { | ||
77 | if(retval == 0xE0F) { | ||
78 | g3d_matrix_identity(rmatrix); | ||
79 | g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix); | ||
80 | g3d_model_transform(model, rmatrix); | ||
81 | dxf_cleanup(global); | ||
82 | return TRUE; | ||
83 | } | ||
84 | g_printerr("error in section..\n"); | ||
85 | dxf_cleanup(global); | ||
86 | return FALSE; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | g3d_matrix_identity(rmatrix); | ||
91 | g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix); | ||
92 | g3d_model_transform(model, rmatrix); | ||
93 | dxf_cleanup(global); | ||
94 | |||
95 | return TRUE; | ||
96 | } | ||
97 | |||
98 | EAPI | ||
99 | gchar *plugin_description(void) | ||
100 | { | ||
101 | return g_strdup("AutoCAD models."); | ||
102 | } | ||
103 | |||
104 | EAPI | ||
105 | gchar **plugin_extensions(void) | ||
106 | { | ||
107 | return g_strsplit("dxf", ":", 0); | ||
108 | } | ||
109 | |||
110 | /*****************************************************************************/ | ||
111 | |||
112 | static void dxf_cleanup(DxfGlobalData *global) | ||
113 | { | ||
114 | g_hash_table_destroy(global->blocks); | ||
115 | g_free(global); | ||
116 | } | ||
117 | |||
118 | gboolean dxf_read_section(DxfGlobalData *global, G3DObject *object) | ||
119 | { | ||
120 | gint grpcode; | ||
121 | gchar val_str[DXF_MAX_LINE + 1]; | ||
122 | |||
123 | grpcode = dxf_read_code(global); | ||
124 | if(grpcode != 0) { | ||
125 | #if DEBUG > 0 | ||
126 | g_printerr("unexpected group code: %d (0 expected)\n", grpcode); | ||
127 | #endif | ||
128 | return FALSE; | ||
129 | } | ||
130 | dxf_read_string(global, val_str); | ||
131 | if(strcmp("EOF", val_str) == 0) | ||
132 | return 0xE0F; | ||
133 | if(strcmp("SECTION", val_str) != 0) { | ||
134 | #if DEBUG > 0 | ||
135 | g_printerr("SECTION expected, found: %s\n", val_str); | ||
136 | #endif | ||
137 | return FALSE; | ||
138 | } | ||
139 | grpcode = dxf_read_code(global); | ||
140 | if(grpcode != 2) { | ||
141 | #if DEBUG > 0 | ||
142 | g_printerr("unexpected group code: %d (2 expected)\n", grpcode); | ||
143 | #endif | ||
144 | return FALSE; | ||
145 | } | ||
146 | dxf_read_string(global, val_str); | ||
147 | |||
148 | if(strcmp(val_str, "HEADER") == 0) | ||
149 | return dxf_section_HEADER(global); | ||
150 | else if(strcmp(val_str, "TABLES") == 0) | ||
151 | return dxf_section_TABLES(global); | ||
152 | else if(strcmp(val_str, "ENTITIES") == 0) | ||
153 | return dxf_section_ENTITIES(global); | ||
154 | else if(strcmp(val_str, "BLOCKS") == 0) | ||
155 | return dxf_section_BLOCKS(global); | ||
156 | else if(strcmp(val_str, "OBJECTS") == 0) | ||
157 | return dxf_section_OBJECTS(global); | ||
158 | else if(strcmp(val_str, "CLASSES") == 0) | ||
159 | return dxf_section_CLASSES(global); | ||
160 | else { | ||
161 | #if DEBUG > 0 | ||
162 | g_printerr("unknown section '%s', skipping...\n", val_str); | ||
163 | #endif | ||
164 | dxf_skip_section(global); | ||
165 | } | ||
166 | return TRUE; | ||
167 | } | ||
168 | |||
169 | gchar *dxf_read_string(DxfGlobalData *global, gchar *value) | ||
170 | { | ||
171 | if(global->binary) { | ||
172 | int pos = 0; | ||
173 | int c; | ||
174 | do | ||
175 | { | ||
176 | c = g3d_stream_read_int8(global->stream); | ||
177 | value[pos] = (char)c; | ||
178 | pos++; | ||
179 | } while(c != '\0'); | ||
180 | return value; | ||
181 | } else { | ||
182 | gchar line[DXF_MAX_LINE + 1]; | ||
183 | |||
184 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
185 | line[DXF_MAX_LINE] = '\0'; | ||
186 | if(sscanf(line, "%s", value) == 1) | ||
187 | return g_strchomp(value); | ||
188 | if(sscanf(line, " %s", value) == 1) | ||
189 | return g_strchomp(value); | ||
190 | return NULL; | ||
191 | } | ||
192 | } | ||
193 | |||
194 | gint32 dxf_read_code(DxfGlobalData *global) | ||
195 | { | ||
196 | gint32 val = DXF_CODE_INVALID; | ||
197 | gchar line[DXF_MAX_LINE + 1]; | ||
198 | |||
199 | if(global->binary) | ||
200 | return g3d_stream_read_int8(global->stream); | ||
201 | else { | ||
202 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
203 | if((sscanf(line, "%d", &val) != 1) && | ||
204 | (sscanf(line, " %d", &val) != 1)) | ||
205 | return DXF_CODE_INVALID; | ||
206 | if(val == 999) { /* comment */ | ||
207 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
208 | return dxf_read_code(global); | ||
209 | } | ||
210 | return val; | ||
211 | } | ||
212 | } | ||
213 | |||
214 | gint32 dxf_read_int16(DxfGlobalData *global) | ||
215 | { | ||
216 | if(global->binary) | ||
217 | return g3d_stream_read_int16_le(global->stream); | ||
218 | else | ||
219 | { | ||
220 | gint32 val; | ||
221 | gchar line[DXF_MAX_LINE]; | ||
222 | |||
223 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
224 | if(sscanf(line, "%i", &val) == 1) | ||
225 | return val; | ||
226 | if(sscanf(line, " %i", &val) == 1) | ||
227 | return val; | ||
228 | else | ||
229 | return DXF_CODE_INVALID; | ||
230 | } | ||
231 | } | ||
232 | |||
233 | gint32 dxf_read_int32(DxfGlobalData *global) | ||
234 | { | ||
235 | if(global->binary) | ||
236 | return g3d_stream_read_int32_le(global->stream); | ||
237 | else | ||
238 | { | ||
239 | gint32 val; | ||
240 | gchar line[DXF_MAX_LINE]; | ||
241 | |||
242 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
243 | if(sscanf(line, "%i", &val) == 1) | ||
244 | return val; | ||
245 | if(sscanf(line, " %i", &val) == 1) | ||
246 | return val; | ||
247 | else | ||
248 | return DXF_CODE_INVALID; | ||
249 | } | ||
250 | } | ||
251 | |||
252 | gdouble dxf_read_float64(DxfGlobalData *global) | ||
253 | { | ||
254 | if(global->binary) | ||
255 | return g3d_stream_read_double_le(global->stream); | ||
256 | else | ||
257 | { | ||
258 | gdouble val; | ||
259 | gchar line[DXF_MAX_LINE]; | ||
260 | |||
261 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
262 | if(sscanf(line, "%lf", &val) == 1) | ||
263 | return val; | ||
264 | if(sscanf(line, " %lf", &val) == 1) | ||
265 | return val; | ||
266 | else | ||
267 | return 0.0; | ||
268 | } | ||
269 | } | ||
270 | |||
271 | gboolean dxf_skip_section(DxfGlobalData *global) | ||
272 | { | ||
273 | gchar c, buf[7], line[DXF_MAX_LINE]; | ||
274 | gsize read; | ||
275 | |||
276 | while(!g3d_stream_eof(global->stream)) | ||
277 | if(global->binary) { | ||
278 | do { c = g3d_stream_read_int8(global->stream); } while(c != 0); | ||
279 | read = g3d_stream_read(global->stream, buf, 7); | ||
280 | if((read == 7) && (strncmp(buf, "ENDSEC", 6) == 0)) | ||
281 | return TRUE; | ||
282 | else | ||
283 | g3d_stream_seek(global->stream, -read, G_SEEK_CUR); | ||
284 | } else { | ||
285 | g3d_stream_read_line(global->stream, line, DXF_MAX_LINE); | ||
286 | if(strncmp(line, "ENDSEC", 6) == 0) | ||
287 | return TRUE; | ||
288 | } | ||
289 | return TRUE; | ||
290 | } | ||
291 | |||
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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_H | ||
23 | #define _IMP_DXF_H | ||
24 | |||
25 | #include <g3d/types.h> | ||
26 | #include <g3d/stream.h> | ||
27 | |||
28 | #include "imp_dxf_types.h" | ||
29 | |||
30 | #define DXF_TEST_ENDSEC(str) \ | ||
31 | if(strcmp((str), "ENDSEC") == 0) return TRUE; | ||
32 | |||
33 | #define DXF_HANDLE_UNKNOWN(global, key, str, section) \ | ||
34 | if(global->binary) { \ | ||
35 | g_warning("imp_dxf: unhandled key %d in section %s @ %#x", \ | ||
36 | key, section, (guint32)g3d_stream_tell(global->stream)); \ | ||
37 | return FALSE; \ | ||
38 | } else { \ | ||
39 | g3d_stream_read_line(global->stream, str, DXF_MAX_LINE); \ | ||
40 | g_debug(\ | ||
41 | "imp_dxf: skipping line %d (section %s, key %d):\n\t\"%s\"\n", \ | ||
42 | g3d_stream_line(global->stream), section, key, str); \ | ||
43 | } | ||
44 | |||
45 | gint32 dxf_read_section(DxfGlobalData *global, G3DObject *object); | ||
46 | gint32 dxf_read_code(DxfGlobalData *global); | ||
47 | gchar *dxf_read_string(DxfGlobalData *global, gchar *value); | ||
48 | gint32 dxf_read_int16(DxfGlobalData *global); | ||
49 | gint32 dxf_read_int32(DxfGlobalData *global); | ||
50 | gdouble dxf_read_float64(DxfGlobalData *global); | ||
51 | gboolean dxf_skip_section(DxfGlobalData *global); | ||
52 | |||
53 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #include <string.h> | ||
23 | #include <math.h> | ||
24 | |||
25 | /* need a way to detect non-set float values */ | ||
26 | #ifndef FP_NAN | ||
27 | # ifdef HUGE | ||
28 | # define FP_NAN HUGE | ||
29 | # else | ||
30 | # define FP_NAN 3.40282347e+38F | ||
31 | # endif | ||
32 | #endif | ||
33 | |||
34 | #include <g3d/face.h> | ||
35 | #include <g3d/object.h> | ||
36 | #include <g3d/matrix.h> | ||
37 | #include <g3d/primitive.h> | ||
38 | |||
39 | #include "imp_dxf.h" | ||
40 | #include "imp_dxf_callbacks.h" | ||
41 | #include "imp_dxf_vars.h" | ||
42 | #include "imp_dxf_def.h" | ||
43 | #include "imp_dxf_prop.h" | ||
44 | #include "imp_dxf_color.h" | ||
45 | |||
46 | static gboolean dxf_str_in_array(gchar **array, const gchar *needle) | ||
47 | { | ||
48 | gchar **p = array; | ||
49 | while(*p != NULL) { | ||
50 | if(strcmp(*p, needle) == 0) | ||
51 | return TRUE; | ||
52 | p ++; | ||
53 | } | ||
54 | return FALSE; | ||
55 | } | ||
56 | |||
57 | #define DXF_VAR_DEBUG 2 | ||
58 | |||
59 | gboolean dxf_debug_var(DxfGlobalData *global, DxfLocalData *local) | ||
60 | { | ||
61 | gint32 key; | ||
62 | gint16 i16; | ||
63 | gchar str[DXF_MAX_LINE + 1], strval[DXF_MAX_LINE + 1]; | ||
64 | gdouble x, y, z; | ||
65 | |||
66 | dxf_read_string(global, str); | ||
67 | if(dxf_str_in_array(dxf_vars_vector3d, str)) { | ||
68 | key = dxf_read_code(global); /* 10 */ | ||
69 | x = dxf_read_float64(global); | ||
70 | key = dxf_read_code(global); /* 20 */ | ||
71 | y = dxf_read_float64(global); | ||
72 | key = dxf_read_code(global); /* 30 */ | ||
73 | z = dxf_read_float64(global); | ||
74 | #if DEBUG > DXF_VAR_DEBUG | ||
75 | g_debug("DXF: [v3d] %s: %.2f, %.2f, %.2f", str, x, y, z); | ||
76 | #endif | ||
77 | } else if(dxf_str_in_array(dxf_vars_vector2d, str)) { | ||
78 | key = dxf_read_code(global); /* 10 */ | ||
79 | x = dxf_read_float64(global); | ||
80 | key = dxf_read_code(global); /* 20 */ | ||
81 | y = dxf_read_float64(global); | ||
82 | #if DEBUG > DXF_VAR_DEBUG | ||
83 | g_debug("DXF: [v2d] %s: %.2f, %.2f", str, x, y); | ||
84 | #endif | ||
85 | } else { | ||
86 | key = dxf_read_code(global); | ||
87 | switch(key) { | ||
88 | case 1: case 2: case 3: case 4: | ||
89 | case 5: case 6: case 7: case 8: | ||
90 | /* string */ | ||
91 | dxf_read_string(global, strval); | ||
92 | #if DEBUG > DXF_VAR_DEBUG | ||
93 | g_debug("DXF: [str] %s: %s", str, strval); | ||
94 | #endif | ||
95 | break; | ||
96 | case 40: | ||
97 | case 50: | ||
98 | x = dxf_read_float64(global); | ||
99 | #if DEBUG > DXF_VAR_DEBUG | ||
100 | g_debug("DXF: [dbl] %s: %.2f", str, x); | ||
101 | #endif | ||
102 | break; | ||
103 | case 62: | ||
104 | case 70: | ||
105 | case 280: | ||
106 | case 290: /* FIXME: boolean */ | ||
107 | case 370: | ||
108 | case 380: | ||
109 | /* 16-bit integer */ | ||
110 | i16 = dxf_read_int16(global); | ||
111 | #if DEBUG > DXF_VAR_DEBUG | ||
112 | g_debug("DXF: [i16] %s: %d", str, i16); | ||
113 | #endif | ||
114 | break; | ||
115 | default: | ||
116 | DXF_HANDLE_UNKNOWN(global, key, strval, "** VARIABLE **"); | ||
117 | break; | ||
118 | } | ||
119 | } | ||
120 | return TRUE; | ||
121 | } | ||
122 | |||
123 | static inline void dxf_object_append(DxfGlobalData *global, | ||
124 | DxfLocalData *local, G3DObject *object) | ||
125 | { | ||
126 | if(local->edata->block) | ||
127 | local->edata->block->objects = g_slist_append( | ||
128 | local->edata->block->objects, object); | ||
129 | else | ||
130 | global->model->objects = g_slist_append(global->model->objects, | ||
131 | object); | ||
132 | } | ||
133 | |||
134 | gboolean dxf_e_3DFACE(DxfGlobalData *global, DxfLocalData *local) | ||
135 | { | ||
136 | G3DObject *object; | ||
137 | G3DFace *face; | ||
138 | G3DMaterial *material; | ||
139 | gint32 key, i, j, col; | ||
140 | gboolean quad; | ||
141 | |||
142 | col = dxf_prop_get_int(local->eprop, 62, 254); | ||
143 | material = dxf_color_get_material(global->model, col); | ||
144 | if(material == NULL) | ||
145 | material = local->edata->material; | ||
146 | |||
147 | object = g_slist_nth_data(global->model->objects, 0); | ||
148 | local->edata->object = object; | ||
149 | local->edata->polyline_flags = 0; | ||
150 | |||
151 | quad = (dxf_prop_get_dbl(local->eprop, 13, FP_NAN) != FP_NAN); | ||
152 | |||
153 | face = g_new0(G3DFace, 1); | ||
154 | face->material = material; | ||
155 | face->vertex_count = quad ? 4 : 3; | ||
156 | face->vertex_indices = g_new0(guint32, face->vertex_count); | ||
157 | local->edata->vertex_offset = object->vertex_count; | ||
158 | for(i = 0; i < face->vertex_count; i ++) | ||
159 | face->vertex_indices[i] = local->edata->vertex_offset + i; | ||
160 | |||
161 | object->vertex_count += face->vertex_count; | ||
162 | object->vertex_data = g_realloc(object->vertex_data, | ||
163 | object->vertex_count * 3 * sizeof(G3DFloat)); | ||
164 | object->faces = g_slist_prepend(object->faces, face); | ||
165 | |||
166 | for(i = 0; i < face->vertex_count; i ++) { | ||
167 | for(j = 0; j < 3; j ++) { | ||
168 | key = (j + 1) * 10 + i; | ||
169 | object->vertex_data[(local->edata->vertex_offset + i) * 3 + j] = | ||
170 | dxf_prop_get_dbl(local->eprop, key, 0.0); | ||
171 | #if DEBUG > 2 | ||
172 | g_debug("| 3DFACE: data[%d = o + %d * 3 + %d] = prop[%d] = %.2f", | ||
173 | (local->edata->vertex_offset + i) * 3 + j, | ||
174 | i, j, key, | ||
175 | object->vertex_data[ | ||
176 | (local->edata->vertex_offset + i) * 3 + j]); | ||
177 | #endif | ||
178 | } | ||
179 | } | ||
180 | return TRUE; | ||
181 | } | ||
182 | |||
183 | gboolean dxf_e_BLOCK(DxfGlobalData *global, DxfLocalData *local) | ||
184 | { | ||
185 | G3DObject *object; | ||
186 | const gchar *name; | ||
187 | |||
188 | name = dxf_prop_get_str(local->eprop, 2, NULL); | ||
189 | if(local->sid == DXF_ID_BLOCKS) { | ||
190 | object = g_new0(G3DObject, 1); | ||
191 | object->hide = TRUE; | ||
192 | object->name = name ? g_strdup(name) : | ||
193 | g_strdup_printf("unnamed block @ line %d", | ||
194 | g3d_stream_line(global->stream)); | ||
195 | local->edata->block = object; | ||
196 | global->model->objects = g_slist_append(global->model->objects, | ||
197 | object); | ||
198 | if(name) | ||
199 | g_hash_table_insert(global->blocks, object->name, object); | ||
200 | } | ||
201 | return TRUE; | ||
202 | } | ||
203 | |||
204 | gboolean dxf_e_ENDBLK(DxfGlobalData *global, DxfLocalData *local) | ||
205 | { | ||
206 | local->edata->block = NULL; | ||
207 | return TRUE; | ||
208 | } | ||
209 | |||
210 | gboolean dxf_e_INSERT(DxfGlobalData *global, DxfLocalData *local) | ||
211 | { | ||
212 | G3DObject *block, *object, *subobject; | ||
213 | GSList *item; | ||
214 | const gchar *name; | ||
215 | G3DFloat matrix[16]; | ||
216 | |||
217 | name = dxf_prop_get_str(local->eprop, 2, "*** error ***"); | ||
218 | block = g_hash_table_lookup(global->blocks, name); | ||
219 | if(block) { | ||
220 | object = g_new0(G3DObject, 1); | ||
221 | object->name = g_strdup_printf("copy of %s", name); | ||
222 | for(item = block->objects; item != NULL; item = item->next) { | ||
223 | subobject = g3d_object_duplicate(item->data); | ||
224 | object->objects = g_slist_append(object->objects, subobject); | ||
225 | } | ||
226 | global->model->objects = g_slist_append(global->model->objects, | ||
227 | object); | ||
228 | local->edata->object = object; | ||
229 | local->edata->vertex_offset = 0; | ||
230 | |||
231 | /* scale */ | ||
232 | g3d_matrix_identity(matrix); | ||
233 | g3d_matrix_scale( | ||
234 | dxf_prop_get_dbl(local->eprop, 41, 1.0), | ||
235 | dxf_prop_get_dbl(local->eprop, 42, 1.0), | ||
236 | dxf_prop_get_dbl(local->eprop, 43, 1.0), | ||
237 | matrix); | ||
238 | g3d_object_transform(object, matrix); | ||
239 | |||
240 | /* rotate */ | ||
241 | g3d_matrix_identity(matrix); | ||
242 | g3d_matrix_rotate( | ||
243 | dxf_prop_get_dbl(local->eprop, 50, 0.0), | ||
244 | dxf_prop_get_dbl(local->eprop, 210, 0.0), | ||
245 | dxf_prop_get_dbl(local->eprop, 220, 0.0), | ||
246 | dxf_prop_get_dbl(local->eprop, 230, 1.0), | ||
247 | matrix); | ||
248 | g3d_object_transform(object, matrix); | ||
249 | |||
250 | /* translate */ | ||
251 | g3d_matrix_identity(matrix); | ||
252 | g3d_matrix_translate( | ||
253 | dxf_prop_get_dbl(local->eprop, 10, 0.0), | ||
254 | dxf_prop_get_dbl(local->eprop, 20, 0.0), | ||
255 | dxf_prop_get_dbl(local->eprop, 30, 0.0), | ||
256 | matrix); | ||
257 | g3d_object_transform(object, matrix); | ||
258 | } | ||
259 | return TRUE; | ||
260 | } | ||
261 | |||
262 | gboolean dxf_e_POLYLINE(DxfGlobalData *global, DxfLocalData *local) | ||
263 | { | ||
264 | G3DObject *object = NULL; | ||
265 | G3DMaterial *material; | ||
266 | guint32 flags; | ||
267 | gint32 m, n, col; | ||
268 | |||
269 | col = dxf_prop_get_int(local->eprop, 62, 254); | ||
270 | material = dxf_color_get_material(global->model, col); | ||
271 | if(material == NULL) | ||
272 | material = local->edata->material; | ||
273 | |||
274 | flags = dxf_prop_get_int(local->eprop, 70, 0); | ||
275 | if(flags & DXF_POLY_POLYFACE) { | ||
276 | object = g_new0(G3DObject, 1); | ||
277 | object->name = g_strdup_printf("POLYFACE @ line %d", | ||
278 | g3d_stream_line(global->stream)); | ||
279 | object->vertex_count = dxf_prop_get_int(local->eprop, 71, 0); | ||
280 | object->vertex_data = g_new0(G3DFloat, 3 * object->vertex_count); | ||
281 | } else if(flags & DXF_POLY_3D_POLYMESH) { | ||
282 | m = dxf_prop_get_int(local->eprop, 71, 0); | ||
283 | n = dxf_prop_get_int(local->eprop, 72, 0); | ||
284 | object = g3d_primitive_mesh(n, m, | ||
285 | (flags & DXF_POLY_CLOSED), | ||
286 | (flags & DXF_POLY_N_CLOSED), | ||
287 | material); | ||
288 | object->name = g_strdup_printf("3D POLYMESH %d x %d @ line %d", | ||
289 | m, n, g3d_stream_line(global->stream)); | ||
290 | } | ||
291 | |||
292 | if(object) | ||
293 | dxf_object_append(global, local, object); | ||
294 | |||
295 | local->edata->object = object; | ||
296 | local->edata->vertex_offset = 0; | ||
297 | local->edata->polyline_flags = flags; | ||
298 | local->edata->tmp_i1 = 0; | ||
299 | return TRUE; | ||
300 | } | ||
301 | |||
302 | gboolean dxf_e_VERTEX(DxfGlobalData *global, DxfLocalData *local) | ||
303 | { | ||
304 | G3DObject *object = local->edata->object; | ||
305 | G3DFace *face; | ||
306 | G3DMaterial *material; | ||
307 | guint32 index, flags; | ||
308 | gint32 i, col; | ||
309 | |||
310 | if(object == NULL) | ||
311 | return TRUE; | ||
312 | |||
313 | index = local->edata->vertex_offset + local->edata->tmp_i1; | ||
314 | |||
315 | if(local->edata->polyline_flags & DXF_POLY_3D_POLYMESH) { | ||
316 | g_return_val_if_fail(index < object->vertex_count, FALSE); | ||
317 | for(i = 0; i < 3; i ++) | ||
318 | object->vertex_data[index * 3 + i] = dxf_prop_get_dbl(local->eprop, | ||
319 | 10 * (i + 1), 0.0); | ||
320 | local->edata->tmp_i1 ++; | ||
321 | } else if(local->edata->polyline_flags & DXF_POLY_POLYFACE) { | ||
322 | flags = dxf_prop_get_int(local->eprop, 70, 0); | ||
323 | if(flags & 64) { /* vertex coords */ | ||
324 | g_return_val_if_fail(index < object->vertex_count, FALSE); | ||
325 | for(i = 0; i < 3; i ++) | ||
326 | object->vertex_data[index * 3 + i] = dxf_prop_get_dbl( | ||
327 | local->eprop, 10 * (i + 1), 0.0); | ||
328 | local->edata->tmp_i1 ++; | ||
329 | } | ||
330 | if(flags & 128) { | ||
331 | col = dxf_prop_get_int(local->eprop, 62, 254); | ||
332 | material = dxf_color_get_material(global->model, col); | ||
333 | if(material == NULL) | ||
334 | material = local->edata->material; | ||
335 | |||
336 | face = g_new0(G3DFace, 1); | ||
337 | face->material = material; | ||
338 | face->vertex_count = | ||
339 | dxf_prop_get_int(local->eprop, 74, 0) ? 4 : 3; | ||
340 | face->vertex_indices = g_new0(guint32, face->vertex_count); | ||
341 | for(i = 0; i < face->vertex_count; i ++) | ||
342 | face->vertex_indices[i] = | ||
343 | MAX(ABS(dxf_prop_get_int(local->eprop, 71 + i, 0)) - 1, 0); | ||
344 | object->faces = g_slist_prepend(object->faces, face); | ||
345 | } | ||
346 | } | ||
347 | |||
348 | return TRUE; | ||
349 | } | ||
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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_CALLBACKS_H | ||
23 | #define _IMP_DXF_CALLBACKS_H | ||
24 | |||
25 | #include "imp_dxf_types.h" | ||
26 | |||
27 | gboolean dxf_debug_var(DxfGlobalData *global, DxfLocalData *local); | ||
28 | |||
29 | gboolean dxf_e_3DFACE(DxfGlobalData *global, DxfLocalData *local); | ||
30 | gboolean dxf_e_BLOCK(DxfGlobalData *global, DxfLocalData *local); | ||
31 | gboolean dxf_e_ENDBLK(DxfGlobalData *global, DxfLocalData *local); | ||
32 | gboolean dxf_e_INSERT(DxfGlobalData *global, DxfLocalData *local); | ||
33 | gboolean dxf_e_POLYLINE(DxfGlobalData *global, DxfLocalData *local); | ||
34 | gboolean dxf_e_VERTEX(DxfGlobalData *global, DxfLocalData *local); | ||
35 | |||
36 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_CHUNKS_H | ||
23 | #define _IMP_DXF_CHUNKS_H | ||
24 | |||
25 | #include "imp_dxf_callbacks.h" | ||
26 | #include "imp_dxf_types.h" | ||
27 | #include "imp_dxf_def.h" | ||
28 | |||
29 | static DxfChunkInfo dxf_chunks[] = { | ||
30 | /* app: <0 */ | ||
31 | /* string: 0-9 */ | ||
32 | { 0, "entity type", DXF_T_EMPTY }, | ||
33 | { 1, "primary text value", DXF_T_STRING }, | ||
34 | { 2, "name", DXF_T_STRING }, | ||
35 | { 3, "other text (3)", DXF_T_STRING }, | ||
36 | { 4, "other text (4)", DXF_T_STRING }, | ||
37 | { 5, "entity handle", DXF_T_STRING }, | ||
38 | { 6, "linetype name", DXF_T_STRING }, | ||
39 | { 7, "text style name", DXF_T_STRING }, | ||
40 | { 8, "layer name", DXF_T_STRING }, | ||
41 | { 9, "variable name identifier", DXF_T_UNKNOWN }, | ||
42 | /* double precision 3D point value: 10-39 */ | ||
43 | { 10, "primary point, X value", DXF_T_FLOAT64 }, | ||
44 | { 11, "point #2, X value", DXF_T_FLOAT64 }, | ||
45 | { 12, "point #3, X value", DXF_T_FLOAT64 }, | ||
46 | { 13, "point #4, X value", DXF_T_FLOAT64 }, | ||
47 | { 14, "point #5, X value", DXF_T_FLOAT64 }, | ||
48 | { 15, "point #6, X value", DXF_T_FLOAT64 }, | ||
49 | { 16, "point #7, X value", DXF_T_FLOAT64 }, | ||
50 | { 17, "point #8, X value", DXF_T_FLOAT64 }, | ||
51 | { 18, "point #9, X value", DXF_T_FLOAT64 }, | ||
52 | { 19, "point #10, X value", DXF_T_FLOAT64 }, | ||
53 | { 20, "primary point, Y value", DXF_T_FLOAT64 }, | ||
54 | { 21, "point #2, Y value", DXF_T_FLOAT64 }, | ||
55 | { 22, "point #3, Y value", DXF_T_FLOAT64 }, | ||
56 | { 23, "point #4, Y value", DXF_T_FLOAT64 }, | ||
57 | { 24, "point #5, Y value", DXF_T_FLOAT64 }, | ||
58 | { 25, "point #6, Y value", DXF_T_FLOAT64 }, | ||
59 | { 26, "point #7, Y value", DXF_T_FLOAT64 }, | ||
60 | { 27, "point #8, Y value", DXF_T_FLOAT64 }, | ||
61 | { 28, "point #9, Y value", DXF_T_FLOAT64 }, | ||
62 | { 29, "point #10, Y value", DXF_T_FLOAT64 }, | ||
63 | { 30, "primary point, Z value", DXF_T_FLOAT64 }, | ||
64 | { 31, "point #2, Z value", DXF_T_FLOAT64 }, | ||
65 | { 32, "point #3, Z value", DXF_T_FLOAT64 }, | ||
66 | { 33, "point #4, Z value", DXF_T_FLOAT64 }, | ||
67 | { 34, "point #5, Z value", DXF_T_FLOAT64 }, | ||
68 | { 35, "point #6, Z value", DXF_T_FLOAT64 }, | ||
69 | { 36, "point #7, Z value", DXF_T_FLOAT64 }, | ||
70 | { 37, "point #8, Z value", DXF_T_FLOAT64 }, | ||
71 | { 38, "point #9, Z value", DXF_T_FLOAT64 }, | ||
72 | { 39, "point #10, Z value", DXF_T_FLOAT64 }, | ||
73 | /* double precision floating-point value: 40-59 */ | ||
74 | { 40, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
75 | { 41, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
76 | { 42, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
77 | { 43, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
78 | { 44, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
79 | { 45, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
80 | { 46, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
81 | { 47, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
82 | { 48, "linetype scale dbl-prec fp value", DXF_T_FLOAT64 }, | ||
83 | { 49, "repeated dbl-prec fp value", DXF_T_FLOAT64 }, | ||
84 | { 50, "angle", DXF_T_FLOAT64 }, | ||
85 | { 51, "angle", DXF_T_FLOAT64 }, | ||
86 | { 52, "angle", DXF_T_FLOAT64 }, | ||
87 | /* 16-bit integer value: 60-79 */ | ||
88 | { 60, "entity visibility", DXF_T_INT16 }, | ||
89 | { 62, "color number", DXF_T_INT16 }, | ||
90 | { 65, "integer value, 16-bit", DXF_T_INT16 }, | ||
91 | { 66, "entities follow", DXF_T_INT16 }, | ||
92 | { 67, "space", DXF_T_INT16 }, | ||
93 | { 68, "APP: viewport not visible", DXF_T_INT16 }, | ||
94 | { 69, "APP: viewport identification number", DXF_T_INT16 }, | ||
95 | { 70, "integer value, 16-bit", DXF_T_INT16 }, | ||
96 | { 71, "integer value, 16-bit", DXF_T_INT16 }, | ||
97 | { 72, "integer value, 16-bit", DXF_T_INT16 }, | ||
98 | { 73, "integer value, 16-bit", DXF_T_INT16 }, | ||
99 | { 74, "integer value, 16-bit", DXF_T_INT16 }, | ||
100 | { 75, "integer value, 16-bit", DXF_T_INT16 }, | ||
101 | { 76, "integer value, 16-bit", DXF_T_INT16 }, | ||
102 | { 77, "integer value, 16-bit", DXF_T_INT16 }, | ||
103 | { 78, "integer value, 16-bit", DXF_T_INT16 }, | ||
104 | { 79, "integer value, 16-bit", DXF_T_INT16 }, | ||
105 | /* 32-bit integer value: 90-99 */ | ||
106 | { 90, "integer value, 32-bit", DXF_T_INT32 }, | ||
107 | { 91, "integer value, 32-bit", DXF_T_INT32 }, | ||
108 | |||
109 | { 100, "subclass data marker", DXF_T_STRING }, | ||
110 | { 102, "control string", DXF_T_STRING }, | ||
111 | { 105, "DIMVAR object handle", DXF_T_STRING }, | ||
112 | |||
113 | { 110, "UCS origin, X value", DXF_T_FLOAT64 }, | ||
114 | { 111, "UCS X-axis, X value", DXF_T_FLOAT64 }, | ||
115 | { 112, "UCS Y-axis, X value", DXF_T_FLOAT64 }, | ||
116 | { 120, "UCS origin, Y value", DXF_T_FLOAT64 }, | ||
117 | { 121, "UCS X-axis, Y value", DXF_T_FLOAT64 }, | ||
118 | { 122, "UCS Y-axis, Y value", DXF_T_FLOAT64 }, | ||
119 | { 130, "UCS origin, Z value", DXF_T_FLOAT64 }, | ||
120 | { 131, "UCS X-axis, Z value", DXF_T_FLOAT64 }, | ||
121 | { 132, "UCS Y-axis, Z value", DXF_T_FLOAT64 }, | ||
122 | |||
123 | /* double precision floating-point value: 140-149 */ | ||
124 | { 140, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
125 | { 141, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
126 | { 142, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
127 | { 143, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
128 | { 144, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
129 | { 145, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
130 | { 146, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
131 | { 147, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
132 | { 148, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
133 | { 149, "double-precision floating-point value", DXF_T_FLOAT64 }, | ||
134 | /* 16-bit integer value: 170-179 */ | ||
135 | { 170, "integer value, 16-bit", DXF_T_INT16 }, | ||
136 | { 171, "integer value, 16-bit", DXF_T_INT16 }, | ||
137 | { 172, "integer value, 16-bit", DXF_T_INT16 }, | ||
138 | |||
139 | { 210, "extrusion direction, X value", DXF_T_FLOAT64 }, | ||
140 | { 220, "extrusion direction, Y value", DXF_T_FLOAT64 }, | ||
141 | { 230, "extrusion direction, Z value", DXF_T_FLOAT64 }, | ||
142 | /* 16-bit integer value: 270-279 */ | ||
143 | { 270, "integer value, 16-bit", DXF_T_INT16 }, | ||
144 | { 271, "integer value, 16-bit", DXF_T_INT16 }, | ||
145 | { 272, "integer value, 16-bit", DXF_T_INT16 }, | ||
146 | { 273, "integer value, 16-bit", DXF_T_INT16 }, | ||
147 | { 274, "integer value, 16-bit", DXF_T_INT16 }, | ||
148 | { 275, "integer value, 16-bit", DXF_T_INT16 }, | ||
149 | { 276, "integer value, 16-bit", DXF_T_INT16 }, | ||
150 | { 277, "integer value, 16-bit", DXF_T_INT16 }, | ||
151 | { 278, "integer value, 16-bit", DXF_T_INT16 }, | ||
152 | { 279, "integer value, 16-bit", DXF_T_INT16 }, | ||
153 | /* 16-bit integer value: 280-289 */ | ||
154 | { 280, "integer value, 16-bit", DXF_T_INT16 }, | ||
155 | { 281, "integer value, 16-bit", DXF_T_INT16 }, | ||
156 | { 282, "integer value, 16-bit", DXF_T_INT16 }, | ||
157 | { 283, "integer value, 16-bit", DXF_T_INT16 }, | ||
158 | { 284, "integer value, 16-bit", DXF_T_INT16 }, | ||
159 | { 285, "integer value, 16-bit", DXF_T_INT16 }, | ||
160 | { 286, "integer value, 16-bit", DXF_T_INT16 }, | ||
161 | { 287, "integer value, 16-bit", DXF_T_INT16 }, | ||
162 | { 288, "integer value, 16-bit", DXF_T_INT16 }, | ||
163 | { 289, "integer value, 16-bit", DXF_T_INT16 }, | ||
164 | |||
165 | /* boolean flag value: 290-299 */ | ||
166 | |||
167 | { 330, "softpointer handle", DXF_T_STRING }, | ||
168 | { 331, "softpointer handle", DXF_T_STRING }, | ||
169 | { 340, "hardpointer handle", DXF_T_STRING }, | ||
170 | { 350, "softowner handle", DXF_T_STRING }, | ||
171 | |||
172 | { 370, "lineweight enum value", DXF_T_INT16 }, | ||
173 | |||
174 | { 390, "PlotStyleName handle", DXF_T_STRING }, | ||
175 | |||
176 | { 420, "integer value, 32-bit", DXF_T_INT32 }, | ||
177 | |||
178 | { 1000, "ASCII string", DXF_T_STRING }, | ||
179 | { 1001, "registered application name", DXF_T_STRING }, | ||
180 | { 1002, "extended data control string", DXF_T_STRING }, | ||
181 | |||
182 | { 1010, "extended data point, X value", DXF_T_FLOAT64 }, | ||
183 | { 1011, "extended 3D world space, X value", DXF_T_FLOAT64 }, | ||
184 | { 1020, "extended data point, Y value", DXF_T_FLOAT64 }, | ||
185 | { 1021, "extended 3D world space, Y value", DXF_T_FLOAT64 }, | ||
186 | { 1030, "extended data point, Z value", DXF_T_FLOAT64 }, | ||
187 | { 1031, "extended 3D world space, Z value", DXF_T_FLOAT64 }, | ||
188 | { 1040, "extended data dbl-prec fp value", DXF_T_FLOAT64 }, | ||
189 | { 1041, "extended data distance value", DXF_T_FLOAT64 }, | ||
190 | { 1070, "extended data 16-bit integer", DXF_T_INT16 }, | ||
191 | { 1071, "extended data 32-bit integer", DXF_T_INT32 }, | ||
192 | |||
193 | { DXF_CODE_INVALID, NULL, DXF_T_UNKNOWN }, | ||
194 | }; | ||
195 | |||
196 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #include <string.h> | ||
23 | |||
24 | #include <g3d/types.h> | ||
25 | #include <g3d/material.h> | ||
26 | |||
27 | static G3DMaterial *get_material(G3DModel *model, const gchar *cname) | ||
28 | { | ||
29 | G3DMaterial *material; | ||
30 | GSList *item; | ||
31 | |||
32 | for(item = model->materials; item != NULL; item = item->next) { | ||
33 | material = item->data; | ||
34 | if(strcmp(material->name, cname) == 0) | ||
35 | return material; | ||
36 | } | ||
37 | return NULL; | ||
38 | } | ||
39 | |||
40 | #define DXF_COL_SET(rx, gx, bx) \ | ||
41 | material->r = ((G3DFloat)(rx) / 255.0); \ | ||
42 | material->g = ((G3DFloat)(gx) / 255.0); \ | ||
43 | material->b = ((G3DFloat)(bx) / 255.0); | ||
44 | |||
45 | /* | ||
46 | * based on GPL code from | ||
47 | * http://wiki.inkscape.org/wiki/index.php/SOC_Accepted_Proposals | ||
48 | */ | ||
49 | static gboolean set_aci(G3DMaterial *material, gint32 aci) | ||
50 | { | ||
51 | G3DFloat r, g, b, h, s, l, m; | ||
52 | gint32 mod10; | ||
53 | |||
54 | if((aci < 10) || (aci > 249)) { | ||
55 | switch(aci) { | ||
56 | case 0: DXF_COL_SET(0x00, 0x00, 0x00); break; | ||
57 | case 1: DXF_COL_SET(0xFF, 0x00, 0x00); break; | ||
58 | case 2: DXF_COL_SET(0xFF, 0xFF, 0x00); break; | ||
59 | case 3: DXF_COL_SET(0x00, 0xFF, 0x00); break; | ||
60 | case 4: DXF_COL_SET(0x00, 0xFF, 0xFF); break; | ||
61 | case 5: DXF_COL_SET(0x00, 0x00, 0xFF); break; | ||
62 | case 6: DXF_COL_SET(0xFF, 0x00, 0xFF); break; | ||
63 | case 7: DXF_COL_SET(0xFF, 0xFF, 0xFF); break; | ||
64 | case 8: DXF_COL_SET(0x80, 0x80, 0x80); break; | ||
65 | case 9: DXF_COL_SET(0xC0, 0xC0, 0xC0); break; | ||
66 | |||
67 | case 250: DXF_COL_SET(0x33, 0x33, 0x33); break; | ||
68 | case 251: DXF_COL_SET(0x5B, 0x5B, 0x5B); break; | ||
69 | case 252: DXF_COL_SET(0x84, 0x84, 0x84); break; | ||
70 | case 253: DXF_COL_SET(0xAD, 0xAD, 0xAD); break; | ||
71 | case 254: DXF_COL_SET(0xD6, 0xD6, 0xD6); break; | ||
72 | case 255: DXF_COL_SET(0xFF, 0xFF, 0xFF); break; | ||
73 | default: break; | ||
74 | } | ||
75 | } else { | ||
76 | mod10 = aci % 10; | ||
77 | h = 1.5 * (aci - mod10 - 10); | ||
78 | s = ((aci % 2) ? 0.5 : 1.0); | ||
79 | if(mod10 < 2) l = 1.0; | ||
80 | else if(mod10 < 4) l = 0.8; | ||
81 | else if(mod10 < 6) l = 0.6; | ||
82 | else if(mod10 < 8) l = 0.5; | ||
83 | else l = 0.3; | ||
84 | |||
85 | if(h <= 120) { | ||
86 | r = (120 - h) / 60; | ||
87 | g = h / 60; | ||
88 | b = 0; | ||
89 | } else if(h <= 240) { | ||
90 | r = 0; | ||
91 | g = (240 - h) / 60; | ||
92 | b = (h - 120) / 60; | ||
93 | } else if(h <= 360) { | ||
94 | r = (h - 240) / 60; | ||
95 | g = 0; | ||
96 | b = (360 - h) / 60; | ||
97 | } | ||
98 | r = MIN(r, 1.0); | ||
99 | g = MIN(g, 1.0); | ||
100 | b = MIN(b, 1.0); | ||
101 | m = MAX(r, MAX(g, b)); | ||
102 | material->r = (m - s * (m - r)) * l; | ||
103 | material->g = (m - s * (m - g)) * l; | ||
104 | material->b = (m - s * (m - b)) * l; | ||
105 | } | ||
106 | return TRUE; | ||
107 | } | ||
108 | |||
109 | G3DMaterial *dxf_color_get_material(G3DModel *model, gint32 aci) | ||
110 | { | ||
111 | gchar *cname; | ||
112 | G3DMaterial *material; | ||
113 | |||
114 | cname = g_strdup_printf("color #%d", ABS(aci)); | ||
115 | material = get_material(model, cname); | ||
116 | if(material != NULL) { | ||
117 | g_free(cname); | ||
118 | return material; | ||
119 | } | ||
120 | material = g3d_material_new(); | ||
121 | material->name = cname; | ||
122 | model->materials = g_slist_append(model->materials, material); | ||
123 | set_aci(material, ABS(aci)); | ||
124 | #if DEBUG > 0 | ||
125 | g_debug("| color: %.2f %.2f %.2f", material->r, material->g, material->b); | ||
126 | #endif | ||
127 | |||
128 | return material; | ||
129 | } | ||
130 | |||
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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_COLOR_H | ||
23 | #define _IMP_DXF_COLOR_H | ||
24 | |||
25 | #include <g3d/types.h> | ||
26 | |||
27 | G3DMaterial *dxf_color_get_material(G3DModel *model, gint32 aci); | ||
28 | |||
29 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_DEF_H | ||
23 | #define _IMP_DXF_DEF_H | ||
24 | |||
25 | #define DXF_MAX_LINE 512 | ||
26 | #define DXF_CODE_INVALID 0xDEADBEEF | ||
27 | |||
28 | #define DXF_ID_HEADER 0x00FF0000 | ||
29 | #define DXF_ID_TABLES 0x00FF0001 | ||
30 | #define DXF_ID_ENTITIES 0x00FF0002 | ||
31 | #define DXF_ID_BLOCKS 0x00FF0003 | ||
32 | #define DXF_ID_OBJECTS 0x00FF0004 | ||
33 | #define DXF_ID_CLASSES 0x00FF0005 | ||
34 | |||
35 | #define DXF_E_3DFACE 0x0001 | ||
36 | #define DXF_E_POLYLINE 0x0002 | ||
37 | #define DXF_E_VERTEX 0x0003 | ||
38 | #define DXF_E_BLOCK 0x0004 | ||
39 | #define DXF_E_INSERT 0x0005 | ||
40 | #define DXF_E_OTHER 0xFFFF | ||
41 | |||
42 | #define DXF_POLY_CLOSED 1 | ||
43 | #define DXF_POLY_CURVE_FIT_ADDED 2 | ||
44 | #define DXF_POLY_SPLINE_FIT_ADDED 4 | ||
45 | #define DXF_POLY_3D_POLYLINE 8 | ||
46 | #define DXF_POLY_3D_POLYMESH 16 | ||
47 | #define DXF_POLY_N_CLOSED 32 | ||
48 | #define DXF_POLY_POLYFACE 64 | ||
49 | #define DXF_POLY_LT_PATTERN 128 | ||
50 | |||
51 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_ENTITIES_H | ||
23 | #define _IMP_DXF_ENTITIES_H | ||
24 | |||
25 | #include "imp_dxf_types.h" | ||
26 | #include "imp_dxf_def.h" | ||
27 | #include "imp_dxf_callbacks.h" | ||
28 | |||
29 | static DxfEntityInfo dxf_entities[] = { | ||
30 | { "3DFACE", "3D face", DXF_E_3DFACE, dxf_e_3DFACE }, | ||
31 | { "POLYLINE", "Polyline", DXF_E_POLYLINE, dxf_e_POLYLINE }, | ||
32 | { "VERTEX", "Vertex", DXF_E_VERTEX, dxf_e_VERTEX }, | ||
33 | |||
34 | { "BLOCK", "block", DXF_E_BLOCK, dxf_e_BLOCK }, | ||
35 | { "ENDBLK", "end of block", DXF_E_OTHER, dxf_e_ENDBLK }, | ||
36 | { "INSERT", "insert block reference", DXF_E_INSERT, dxf_e_INSERT }, | ||
37 | |||
38 | { "3DLINE", "3D line", DXF_E_OTHER, NULL }, | ||
39 | { "ACDBDICTIONARYWDFLT", "unknown", DXF_E_OTHER, NULL }, | ||
40 | { "ACDBPLACEHOLDER", "unknown", DXF_E_OTHER, NULL }, | ||
41 | { "APPID", "application ID", DXF_E_OTHER, NULL }, | ||
42 | { "ARC", "arc", DXF_E_OTHER, NULL }, | ||
43 | { "ATTDEF", "attribute definition", DXF_E_OTHER, NULL }, | ||
44 | { "ATTRIB", "attribute", DXF_E_OTHER, NULL }, | ||
45 | { "BLOCK_RECORD", "block record", DXF_E_OTHER, NULL }, | ||
46 | { "CIRCLE", "circle", DXF_E_OTHER, NULL }, | ||
47 | { "CLASS", "class", DXF_E_OTHER, NULL }, | ||
48 | { "DICTIONARY", "dictionary", DXF_E_OTHER, NULL }, | ||
49 | { "DIMSTYLE", "unknown", DXF_E_OTHER, NULL }, | ||
50 | { "ENDTAB", "end of table", DXF_E_OTHER, NULL }, | ||
51 | { "LAYER", "layer", DXF_E_OTHER, NULL }, | ||
52 | { "LAYOUT", "layout", DXF_E_OTHER, NULL }, | ||
53 | { "LINE", "line", DXF_E_OTHER, NULL }, | ||
54 | { "LTYPE", "line type", DXF_E_OTHER, NULL }, | ||
55 | { "LWPOLYLINE", "unknown", DXF_E_OTHER, NULL }, | ||
56 | { "MLINESTYLE", "unknown", DXF_E_OTHER, NULL }, | ||
57 | { "POINT", "point", DXF_E_OTHER, NULL }, | ||
58 | { "SEQEND", "end of sequence", DXF_E_OTHER, NULL }, | ||
59 | { "SPLINE", "spline curve", DXF_E_OTHER, NULL }, | ||
60 | { "STYLE", "style", DXF_E_OTHER, NULL }, | ||
61 | { "TABLE", "table", DXF_E_OTHER, NULL }, | ||
62 | { "UCS", "UCS", DXF_E_OTHER, NULL }, | ||
63 | { "VIEW", "view", DXF_E_OTHER, NULL }, | ||
64 | { "VIEWPORT", "viewport", DXF_E_OTHER, NULL }, | ||
65 | { "VPORT", "viewport", DXF_E_OTHER, NULL }, | ||
66 | |||
67 | { NULL, NULL, 0, NULL } | ||
68 | }; | ||
69 | |||
70 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #include "imp_dxf_types.h" | ||
23 | |||
24 | struct _DxfEntityProps { | ||
25 | GHashTable *hash; | ||
26 | }; | ||
27 | |||
28 | typedef struct { | ||
29 | gint32 key; | ||
30 | DxfChunkType type; | ||
31 | union { | ||
32 | gint32 ival; | ||
33 | gdouble dval; | ||
34 | gchar *strval; | ||
35 | } u; | ||
36 | } DxfEProp; | ||
37 | |||
38 | DxfEntityProps *dxf_prop_create(void) | ||
39 | { | ||
40 | DxfEntityProps *eprop; | ||
41 | |||
42 | eprop = g_new0(DxfEntityProps, 1); | ||
43 | eprop->hash = g_hash_table_new(g_int_hash, g_int_equal); | ||
44 | |||
45 | return eprop; | ||
46 | } | ||
47 | |||
48 | static gboolean remove_p(gpointer key, gpointer value, gpointer user_data) | ||
49 | { | ||
50 | DxfEProp *p = value; | ||
51 | if(p->type == DXF_T_STRING) | ||
52 | g_free(p->u.strval); | ||
53 | g_free(p); | ||
54 | return TRUE; | ||
55 | } | ||
56 | |||
57 | void dxf_prop_cleanup(DxfEntityProps *eprop) | ||
58 | { | ||
59 | g_hash_table_foreach_remove(eprop->hash, remove_p, NULL); | ||
60 | g_hash_table_destroy(eprop->hash); | ||
61 | g_free(eprop); | ||
62 | } | ||
63 | |||
64 | static DxfEProp *prop_get(DxfEntityProps *eprop, gint32 key) | ||
65 | { | ||
66 | DxfEProp *p; | ||
67 | |||
68 | p = g_hash_table_lookup(eprop->hash, &key); | ||
69 | if(p) | ||
70 | return p; | ||
71 | p = g_new0(DxfEProp, 1); | ||
72 | p->key = key; | ||
73 | g_hash_table_insert(eprop->hash, &(p->key), p); | ||
74 | return p; | ||
75 | } | ||
76 | |||
77 | gboolean dxf_prop_set_int(DxfEntityProps *eprop, gint32 key, gint32 i) | ||
78 | { | ||
79 | DxfEProp *p = prop_get(eprop, key); | ||
80 | p->type = DXF_T_INT32; | ||
81 | p->u.ival = i; | ||
82 | return TRUE; | ||
83 | } | ||
84 | |||
85 | gboolean dxf_prop_set_dbl(DxfEntityProps *eprop, gint32 key, gdouble dbl) | ||
86 | { | ||
87 | DxfEProp *p = prop_get(eprop, key); | ||
88 | p->type = DXF_T_FLOAT64; | ||
89 | p->u.dval = dbl; | ||
90 | return TRUE; | ||
91 | } | ||
92 | |||
93 | gboolean dxf_prop_set_str(DxfEntityProps *eprop, gint32 key, | ||
94 | const gchar *str) | ||
95 | { | ||
96 | DxfEProp *p = prop_get(eprop, key); | ||
97 | p->type = DXF_T_STRING; | ||
98 | if(p->u.strval) | ||
99 | g_free(p->u.strval); | ||
100 | p->u.strval = g_strdup(str); | ||
101 | return TRUE; | ||
102 | } | ||
103 | |||
104 | gint32 dxf_prop_get_int(DxfEntityProps *eprop, gint32 key, gint32 dfl) | ||
105 | { | ||
106 | DxfEProp *p = g_hash_table_lookup(eprop->hash, &key); | ||
107 | if(p) | ||
108 | return p->u.ival; | ||
109 | return dfl; | ||
110 | } | ||
111 | |||
112 | gdouble dxf_prop_get_dbl(DxfEntityProps *eprop, gint32 key, gdouble dfl) | ||
113 | { | ||
114 | DxfEProp *p = g_hash_table_lookup(eprop->hash, &key); | ||
115 | if(p) | ||
116 | return p->u.dval; | ||
117 | return dfl; | ||
118 | } | ||
119 | |||
120 | const gchar *dxf_prop_get_str(DxfEntityProps *eprop, gint32 key, | ||
121 | const gchar *dfl) | ||
122 | { | ||
123 | DxfEProp *p = g_hash_table_lookup(eprop->hash, &key); | ||
124 | if(p) | ||
125 | return p->u.strval; | ||
126 | return dfl; | ||
127 | } | ||
128 | |||
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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_PROP_H | ||
23 | #define _IMP_DXF_PROP_H | ||
24 | |||
25 | #include "imp_dxf_types.h" | ||
26 | |||
27 | DxfEntityProps *dxf_prop_create(void); | ||
28 | void dxf_prop_cleanup(DxfEntityProps *eprop); | ||
29 | |||
30 | gboolean dxf_prop_set_int(DxfEntityProps *eprop, gint32 key, gint32 i); | ||
31 | gboolean dxf_prop_set_dbl(DxfEntityProps *eprop, gint32 key, gdouble dbl); | ||
32 | gboolean dxf_prop_set_str(DxfEntityProps *eprop, gint32 key, | ||
33 | const gchar *str); | ||
34 | |||
35 | gint32 dxf_prop_get_int(DxfEntityProps *eprop, gint32 key, gint32 dfl); | ||
36 | gdouble dxf_prop_get_dbl(DxfEntityProps *eprop, gint32 key, gdouble dfl); | ||
37 | const gchar *dxf_prop_get_str(DxfEntityProps *eprop, gint32 key, | ||
38 | const gchar *dfl); | ||
39 | |||
40 | #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 @@ | |||
1 | /* $Id: imp_dxf_section.c 312 2008-11-17 18:28:56Z mmmaddd $ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #include <string.h> | ||
23 | #include <math.h> | ||
24 | |||
25 | #include <g3d/context.h> | ||
26 | |||
27 | #include "imp_dxf.h" | ||
28 | #include "imp_dxf_prop.h" | ||
29 | #include "imp_dxf_chunks.h" | ||
30 | #include "imp_dxf_entities.h" | ||
31 | |||
32 | static DxfChunkInfo *dxf_get_chunk_info(DxfChunkInfo *chunks, gint32 id) | ||
33 | { | ||
34 | guint32 i; | ||
35 | |||
36 | for(i = 0; chunks[i].id != DXF_CODE_INVALID; i ++) | ||
37 | if(chunks[i].id == id) | ||
38 | return &(chunks[i]); | ||
39 | return NULL; | ||
40 | } | ||
41 | |||
42 | static DxfEntityInfo *dxf_get_entity_info(const gchar *str) | ||
43 | { | ||
44 | guint32 i; | ||
45 | |||
46 | for(i = 0; dxf_entities[i].name != NULL; i ++) | ||
47 | if(strcmp(dxf_entities[i].name, str) == 0) | ||
48 | return &(dxf_entities[i]); | ||
49 | #if DEBUG > 0 | ||
50 | g_debug("unknown entity: %s", str); | ||
51 | #endif | ||
52 | return NULL; | ||
53 | } | ||
54 | |||
55 | static gboolean dxf_entity_finalize(DxfGlobalData *global, guint32 sid, | ||
56 | DxfEntityData *edata, DxfEntityInfo *einfo, DxfEntityProps *eprop) | ||
57 | { | ||
58 | DxfLocalData *local; | ||
59 | |||
60 | if(einfo->callback) { | ||
61 | local = g_new0(DxfLocalData, 1); | ||
62 | local->sid = sid; | ||
63 | local->eid = einfo->id; | ||
64 | local->edata = edata; | ||
65 | local->eprop = eprop; | ||
66 | |||
67 | einfo->callback(global, local); | ||
68 | |||
69 | g_free(local); | ||
70 | } | ||
71 | return TRUE; | ||
72 | } | ||
73 | |||
74 | static gboolean dxf_read_chunk(DxfGlobalData *global, DxfChunkInfo *cinfo, | ||
75 | DxfEntityProps *eprop) | ||
76 | { | ||
77 | gint32 i; | ||
78 | gdouble dbl; | ||
79 | gchar str[DXF_MAX_LINE + 1]; | ||
80 | |||
81 | switch(cinfo->type) { | ||
82 | case DXF_T_UNKNOWN: | ||
83 | if(cinfo->id == 9) /* variable name */ | ||
84 | return dxf_debug_var(global, NULL); | ||
85 | break; | ||
86 | case DXF_T_EMPTY: | ||
87 | return TRUE; | ||
88 | break; | ||
89 | case DXF_T_INT16: | ||
90 | i = dxf_read_int16(global); | ||
91 | dxf_prop_set_int(eprop, cinfo->id, i); | ||
92 | break; | ||
93 | case DXF_T_INT32: | ||
94 | i = dxf_read_int32(global); | ||
95 | dxf_prop_set_int(eprop, cinfo->id, i); | ||
96 | break; | ||
97 | case DXF_T_FLOAT64: | ||
98 | dbl = dxf_read_float64(global); | ||
99 | dxf_prop_set_dbl(eprop, cinfo->id, dbl); | ||
100 | break; | ||
101 | case DXF_T_STRING: | ||
102 | dxf_read_string(global, str); | ||
103 | dxf_prop_set_str(eprop, cinfo->id, str); | ||
104 | break; | ||
105 | } | ||
106 | return TRUE; | ||
107 | } | ||
108 | |||
109 | static gboolean dxf_parse_chunks(DxfGlobalData *global, DxfChunkInfo *chunks, | ||
110 | gint32 parentid, const gchar *section) | ||
111 | { | ||
112 | gint32 key; | ||
113 | DxfChunkInfo *chunk_info; | ||
114 | DxfEntityData *edata; | ||
115 | DxfEntityInfo *einfo = NULL; | ||
116 | DxfEntityProps *eprop = NULL; | ||
117 | gchar str[DXF_MAX_LINE + 1]; | ||
118 | G3DFloat pcnt, prev_pcnt = 0.0; | ||
119 | |||
120 | #if DEBUG > 0 | ||
121 | g_debug("\\[%s]", section); | ||
122 | #endif | ||
123 | |||
124 | edata = g_new0(DxfEntityData, 1); | ||
125 | |||
126 | if((strcmp(section, "ENTITIES") == 0) || | ||
127 | (strcmp(section, "BLOCKS") == 0)) { | ||
128 | edata->object = g_slist_nth_data(global->model->objects, 0); | ||
129 | edata->material = g_slist_nth_data(edata->object->materials, 0); | ||
130 | } | ||
131 | |||
132 | while(TRUE) { | ||
133 | key = dxf_read_code(global); | ||
134 | chunk_info = dxf_get_chunk_info(chunks, key); | ||
135 | |||
136 | if(key == DXF_CODE_INVALID) { | ||
137 | g_free(edata); | ||
138 | return FALSE; | ||
139 | } | ||
140 | |||
141 | if(key == 0) { /* new entity or end of section */ | ||
142 | if(einfo) { | ||
143 | dxf_entity_finalize(global, parentid, edata, einfo, eprop); | ||
144 | dxf_prop_cleanup(eprop); | ||
145 | eprop = NULL; | ||
146 | } | ||
147 | dxf_read_string(global, str); | ||
148 | DXF_TEST_ENDSEC(str); | ||
149 | einfo = dxf_get_entity_info(str); | ||
150 | eprop = dxf_prop_create(); | ||
151 | #if DEBUG > 0 | ||
152 | g_debug("| entity: %s", str); | ||
153 | #endif | ||
154 | } | ||
155 | |||
156 | #if DEBUG > 0 | ||
157 | if(chunk_info) | ||
158 | g_debug("\\ %s[%+4d]: %s%s%s (line %d)", | ||
159 | key ? " " : "", | ||
160 | key, chunk_info->description, | ||
161 | key ? "" : ": ", | ||
162 | key ? "" : str, | ||
163 | g3d_stream_line(global->stream)); | ||
164 | else | ||
165 | g_warning("unknown chunk type %d in line %d", key, | ||
166 | g3d_stream_line(global->stream)); | ||
167 | #endif | ||
168 | |||
169 | if(chunk_info) { | ||
170 | dxf_read_chunk(global, chunk_info, eprop); | ||
171 | } /* chunk_info */ | ||
172 | else { | ||
173 | DXF_HANDLE_UNKNOWN(global, key, str, section); | ||
174 | } | ||
175 | |||
176 | pcnt = (G3DFloat)g3d_stream_tell(global->stream) / | ||
177 | (G3DFloat)g3d_stream_size(global->stream); | ||
178 | if((pcnt - prev_pcnt) > 0.01) { | ||
179 | prev_pcnt = pcnt; | ||
180 | g3d_context_update_progress_bar(global->context, pcnt, TRUE); | ||
181 | } | ||
182 | g3d_context_update_interface(global->context); | ||
183 | } /* endless loop */ | ||
184 | |||
185 | g_free(edata); | ||
186 | return FALSE; | ||
187 | } | ||
188 | |||
189 | gboolean dxf_section_HEADER(DxfGlobalData *global) | ||
190 | { | ||
191 | #if 0 | ||
192 | return dxf_parse_chunks(global, dxf_chunks, DXF_ID_HEADER, "HEADER"); | ||
193 | #else | ||
194 | return dxf_skip_section(global); | ||
195 | #endif | ||
196 | } | ||
197 | |||
198 | gboolean dxf_section_ENTITIES(DxfGlobalData *global) | ||
199 | { | ||
200 | return dxf_parse_chunks(global, dxf_chunks, DXF_ID_ENTITIES, "ENTITIES"); | ||
201 | } | ||
202 | |||
203 | gboolean dxf_section_BLOCKS(DxfGlobalData *global) | ||
204 | { | ||
205 | return dxf_parse_chunks(global, dxf_chunks, DXF_ID_BLOCKS, "BLOCKS"); | ||
206 | } | ||
207 | |||
208 | gboolean dxf_section_TABLES(DxfGlobalData *global) | ||
209 | { | ||
210 | #if 0 | ||
211 | return dxf_parse_chunks(global, dxf_chunks, DXF_ID_TABLES, "TABLES"); | ||
212 | #else | ||
213 | return dxf_skip_section(global); | ||
214 | #endif | ||
215 | } | ||
216 | |||
217 | gboolean dxf_section_OBJECTS(DxfGlobalData *global) | ||
218 | { | ||
219 | #if 0 | ||
220 | return dxf_parse_chunks(global, dxf_chunks, DXF_ID_OBJECTS, "OBJECTS"); | ||
221 | #else | ||
222 | return dxf_skip_section(global); | ||
223 | #endif | ||
224 | } | ||
225 | |||
226 | gboolean dxf_section_CLASSES(DxfGlobalData *global) | ||
227 | { | ||
228 | #if 0 | ||
229 | return dxf_parse_chunks(global, dxf_chunks, DXF_ID_CLASSES, "TABLES"); | ||
230 | #else | ||
231 | return dxf_skip_section(global); | ||
232 | #endif | ||
233 | } | ||
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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_SECTION_H | ||
23 | #define _IMP_DXF_SECTION_H | ||
24 | |||
25 | #include "imp_dxf_types.h" | ||
26 | |||
27 | gboolean dxf_section_HEADER(DxfGlobalData *global); | ||
28 | gboolean dxf_section_TABLES(DxfGlobalData *global); | ||
29 | gboolean dxf_section_BLOCKS(DxfGlobalData *global); | ||
30 | gboolean dxf_section_ENTITIES(DxfGlobalData *global); | ||
31 | gboolean dxf_section_OBJECTS(DxfGlobalData *global); | ||
32 | gboolean dxf_section_CLASSES(DxfGlobalData *global); | ||
33 | |||
34 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_TYPES_H | ||
23 | #define _IMP_DXF_TYPES_H | ||
24 | |||
25 | #include <g3d/types.h> | ||
26 | |||
27 | typedef struct { | ||
28 | G3DContext *context; | ||
29 | G3DModel *model; | ||
30 | G3DStream *stream; | ||
31 | gboolean binary; | ||
32 | GHashTable *blocks; | ||
33 | } DxfGlobalData; | ||
34 | |||
35 | typedef struct { | ||
36 | G3DObject *object; | ||
37 | G3DObject *block; | ||
38 | G3DMaterial *material; | ||
39 | guint32 vertex_offset; | ||
40 | guint32 tmp_i1; | ||
41 | guint32 polyline_flags; | ||
42 | } DxfEntityData; | ||
43 | |||
44 | typedef struct _DxfEntityProps DxfEntityProps; | ||
45 | |||
46 | typedef struct { | ||
47 | gint32 id; | ||
48 | guint32 sid; /* section id */ | ||
49 | guint32 eid; /* entity id */ | ||
50 | DxfEntityData *edata; | ||
51 | DxfEntityProps *eprop; | ||
52 | } DxfLocalData; | ||
53 | |||
54 | typedef gboolean (* DxfCallback)(DxfGlobalData *, DxfLocalData *); | ||
55 | |||
56 | typedef struct { | ||
57 | const gchar *name; | ||
58 | const gchar *description; | ||
59 | guint32 id; | ||
60 | DxfCallback callback; | ||
61 | } DxfEntityInfo; | ||
62 | |||
63 | typedef enum { | ||
64 | DXF_T_UNKNOWN, | ||
65 | DXF_T_EMPTY, | ||
66 | DXF_T_INT16, | ||
67 | DXF_T_INT32, | ||
68 | DXF_T_FLOAT64, | ||
69 | DXF_T_STRING | ||
70 | } DxfChunkType; | ||
71 | |||
72 | typedef struct { | ||
73 | gint32 id; | ||
74 | const gchar *description; | ||
75 | DxfChunkType type; | ||
76 | } DxfChunkInfo; | ||
77 | |||
78 | #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 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _IMP_DXF_VARS_H | ||
23 | #define _IMP_DXF_VARS_H | ||
24 | |||
25 | #include <glib.h> | ||
26 | |||
27 | static gchar *dxf_vars_vector2d[] = { | ||
28 | "$AXISUNIT", | ||
29 | "$LIMMAX", | ||
30 | "$LIMMIN", | ||
31 | "$PLIMMIN", | ||
32 | "$PLIMMAX", | ||
33 | NULL | ||
34 | }; | ||
35 | |||
36 | static gchar *dxf_vars_vector3d[] = { | ||
37 | "$EXTMIN", | ||
38 | "$EXTMAX", | ||
39 | "$INSBASE", | ||
40 | "$PEXTMAX", | ||
41 | "$PEXTMIN", | ||
42 | "$PINSBASE", | ||
43 | "$PUCSORG", | ||
44 | "$PUCSORGBACK", | ||
45 | "$PUCSORGBOTTOM", | ||
46 | "$PUCSORGFRONT", | ||
47 | "$PUCSORGLEFT", | ||
48 | "$PUCSORGRIGHT", | ||
49 | "$PUCSORGTOP", | ||
50 | "$PUCSXDIR", | ||
51 | "$PUCSYDIR", | ||
52 | "$UCSORG", | ||
53 | "$UCSORGBACK", | ||
54 | "$UCSORGBOTTOM", | ||
55 | "$UCSORGFRONT", | ||
56 | "$UCSORGLEFT", | ||
57 | "$UCSORGRIGHT", | ||
58 | "$UCSORGTOP", | ||
59 | "$UCSXDIR", | ||
60 | "$UCSYDIR", | ||
61 | NULL | ||
62 | }; | ||
63 | |||
64 | #endif | ||