diff options
Diffstat (limited to '')
6 files changed, 2231 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile new file mode 100644 index 0000000..9c0164a --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile | |||
@@ -0,0 +1,510 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # plugins/import/imp_leocad/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_leocad | ||
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_leocad_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_leocad_la_OBJECTS = imp_leocad.lo imp_leocad_library.lo | ||
59 | imp_leocad_la_OBJECTS = $(am_imp_leocad_la_OBJECTS) | ||
60 | DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d | ||
61 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
62 | am__depfiles_maybe = depfiles | ||
63 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
64 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
65 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
66 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
67 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
68 | CCLD = $(CC) | ||
69 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
70 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
71 | $(LDFLAGS) -o $@ | ||
72 | SOURCES = $(imp_leocad_la_SOURCES) | ||
73 | DIST_SOURCES = $(imp_leocad_la_SOURCES) | ||
74 | ETAGS = etags | ||
75 | CTAGS = ctags | ||
76 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
77 | ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 | ||
78 | AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar | ||
79 | AR = ar | ||
80 | AS = as | ||
81 | AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf | ||
82 | AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader | ||
83 | AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 | ||
84 | AWK = gawk | ||
85 | CC = gcc | ||
86 | CCDEPMODE = depmode=gcc3 | ||
87 | CFLAGS = -g -O2 | ||
88 | CPP = gcc -E | ||
89 | CPPFLAGS = | ||
90 | CXX = g++ | ||
91 | CXXCPP = g++ -E | ||
92 | CXXDEPMODE = depmode=gcc3 | ||
93 | CXXFLAGS = -g -O2 | ||
94 | CYGPATH_W = echo | ||
95 | DBG_CFLAGS = -O2 | ||
96 | DEBUG = 0 | ||
97 | DEFS = -DHAVE_CONFIG_H | ||
98 | DEPDIR = .deps | ||
99 | DLLTOOL = dlltool | ||
100 | ECHO = echo | ||
101 | ECHO_C = | ||
102 | ECHO_N = -n | ||
103 | ECHO_T = | ||
104 | EGREP = /bin/grep -E | ||
105 | EXEEXT = | ||
106 | F77 = | ||
107 | FFLAGS = | ||
108 | 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 | ||
109 | 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 | ||
110 | GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
111 | GLIB_GENMARSHAL = glib-genmarshal | ||
112 | GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
113 | GLIB_MKENUMS = glib-mkenums | ||
114 | GOBJECT_QUERY = gobject-query | ||
115 | GREP = /bin/grep | ||
116 | GTKDOC_CHECK = /usr/bin/gtkdoc-check | ||
117 | 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 | ||
118 | 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 | ||
119 | HTML_DIR = ${datadir}/gtk-doc/html | ||
120 | INSTALL = /usr/bin/install -c | ||
121 | INSTALL_DATA = ${INSTALL} -m 644 | ||
122 | INSTALL_PROGRAM = ${INSTALL} | ||
123 | INSTALL_SCRIPT = ${INSTALL} | ||
124 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s | ||
125 | LDFLAGS = | ||
126 | LEX = flex | ||
127 | LEXLIB = -lfl | ||
128 | LEX_OUTPUT_ROOT = lex.yy | ||
129 | 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 | ||
130 | LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 | ||
131 | LIBOBJS = | ||
132 | LIBS = -lm | ||
133 | LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet | ||
134 | LIBXML2_CFLAGS = -I/usr/include/libxml2 | ||
135 | LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
136 | LN_S = ln -s | ||
137 | LTLIBOBJS = | ||
138 | LTVERSION = 0:8:0 | ||
139 | MAGIC_LIBS = -lmagic | ||
140 | MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo | ||
141 | MATH_LIBS = -lm | ||
142 | MKDIR_P = /bin/mkdir -p | ||
143 | OBJDUMP = objdump | ||
144 | OBJEXT = o | ||
145 | PACKAGE = libg3d | ||
146 | PACKAGE_BUGREPORT = | ||
147 | PACKAGE_NAME = | ||
148 | PACKAGE_STRING = | ||
149 | PACKAGE_TARNAME = | ||
150 | PACKAGE_VERSION = | ||
151 | PATH_SEPARATOR = : | ||
152 | PKG_CONFIG = /usr/bin/pkg-config | ||
153 | PLUGINS_LDFLAGS = -avoid-version -export-dynamic | ||
154 | RANLIB = ranlib | ||
155 | SET_MAKE = | ||
156 | SHELL = /bin/bash | ||
157 | STRIP = strip | ||
158 | VERSION = 0.0.8 | ||
159 | XML2_CONFIG = /usr/bin/xml2-config | ||
160 | XML_CPPFLAGS = -I/usr/include/libxml2 | ||
161 | XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
162 | Z_CFLAGS = | ||
163 | Z_LIBS = -lz | ||
164 | abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad | ||
165 | abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad | ||
166 | abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
167 | abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
168 | ac_ct_CC = gcc | ||
169 | ac_ct_CXX = g++ | ||
170 | ac_ct_F77 = | ||
171 | am__include = include | ||
172 | am__leading_dot = . | ||
173 | am__quote = | ||
174 | am__tar = ${AMTAR} chof - "$$tardir" | ||
175 | am__untar = ${AMTAR} xf - | ||
176 | bindir = ${exec_prefix}/bin | ||
177 | build = x86_64-unknown-linux-gnu | ||
178 | build_alias = | ||
179 | build_cpu = x86_64 | ||
180 | build_os = linux-gnu | ||
181 | build_vendor = unknown | ||
182 | builddir = . | ||
183 | datadir = ${datarootdir} | ||
184 | datarootdir = ${prefix}/share | ||
185 | docdir = ${datarootdir}/doc/${PACKAGE} | ||
186 | dvidir = ${docdir} | ||
187 | exec_prefix = ${prefix} | ||
188 | host = x86_64-unknown-linux-gnu | ||
189 | host_alias = | ||
190 | host_cpu = x86_64 | ||
191 | host_os = linux-gnu | ||
192 | host_vendor = unknown | ||
193 | htmldir = ${docdir} | ||
194 | includedir = ${prefix}/include | ||
195 | infodir = ${datarootdir}/info | ||
196 | install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh | ||
197 | libdir = ${exec_prefix}/lib | ||
198 | libexecdir = ${exec_prefix}/libexec | ||
199 | localedir = ${datarootdir}/locale | ||
200 | localstatedir = ${prefix}/var | ||
201 | mandir = ${datarootdir}/man | ||
202 | mkdir_p = /bin/mkdir -p | ||
203 | oldincludedir = /usr/include | ||
204 | pdfdir = ${docdir} | ||
205 | prefix = /usr/local | ||
206 | program_transform_name = s,x,x, | ||
207 | psdir = ${docdir} | ||
208 | sbindir = ${exec_prefix}/sbin | ||
209 | sharedstatedir = ${prefix}/com | ||
210 | srcdir = . | ||
211 | sysconfdir = ${prefix}/etc | ||
212 | target_alias = | ||
213 | top_builddir = ../../.. | ||
214 | top_srcdir = ../../.. | ||
215 | pluginimpdir = $(pkglibdir)/plugins/import | ||
216 | pluginimp_LTLIBRARIES = imp_leocad.la | ||
217 | AM_CFLAGS = \ | ||
218 | -Wall -ansi -pedantic \ | ||
219 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
220 | -O2 -DDEBUG=0 \ | ||
221 | -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
222 | |||
223 | INCLUDES = -I$(top_srcdir)/include | ||
224 | AM_LDFLAGS = \ | ||
225 | -no-undefined -module \ | ||
226 | -avoid-version -export-dynamic | ||
227 | |||
228 | imp_leocad_la_SOURCES = imp_leocad.c imp_leocad_library.h imp_leocad_library.c | ||
229 | imp_leocad_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
230 | all: all-am | ||
231 | |||
232 | .SUFFIXES: | ||
233 | .SUFFIXES: .c .lo .o .obj | ||
234 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
235 | @for dep in $?; do \ | ||
236 | case '$(am__configure_deps)' in \ | ||
237 | *$$dep*) \ | ||
238 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
239 | && exit 0; \ | ||
240 | exit 1;; \ | ||
241 | esac; \ | ||
242 | done; \ | ||
243 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_leocad/Makefile'; \ | ||
244 | cd $(top_srcdir) && \ | ||
245 | $(AUTOMAKE) --gnu plugins/import/imp_leocad/Makefile | ||
246 | .PRECIOUS: Makefile | ||
247 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
248 | @case '$?' in \ | ||
249 | *config.status*) \ | ||
250 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
251 | *) \ | ||
252 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
253 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
254 | esac; | ||
255 | |||
256 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
257 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
258 | |||
259 | $(top_srcdir)/configure: $(am__configure_deps) | ||
260 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
261 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
262 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
263 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
264 | @$(NORMAL_INSTALL) | ||
265 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
266 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
267 | if test -f $$p; then \ | ||
268 | f=$(am__strip_dir) \ | ||
269 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
270 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
271 | else :; fi; \ | ||
272 | done | ||
273 | |||
274 | uninstall-pluginimpLTLIBRARIES: | ||
275 | @$(NORMAL_UNINSTALL) | ||
276 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
277 | p=$(am__strip_dir) \ | ||
278 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
279 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
280 | done | ||
281 | |||
282 | clean-pluginimpLTLIBRARIES: | ||
283 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
284 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
285 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
286 | test "$$dir" != "$$p" || dir=.; \ | ||
287 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
288 | rm -f "$${dir}/so_locations"; \ | ||
289 | done | ||
290 | imp_leocad.la: $(imp_leocad_la_OBJECTS) $(imp_leocad_la_DEPENDENCIES) | ||
291 | $(LINK) -rpath $(pluginimpdir) $(imp_leocad_la_OBJECTS) $(imp_leocad_la_LIBADD) $(LIBS) | ||
292 | |||
293 | mostlyclean-compile: | ||
294 | -rm -f *.$(OBJEXT) | ||
295 | |||
296 | distclean-compile: | ||
297 | -rm -f *.tab.c | ||
298 | |||
299 | include ./$(DEPDIR)/imp_leocad.Plo | ||
300 | include ./$(DEPDIR)/imp_leocad_library.Plo | ||
301 | |||
302 | .c.o: | ||
303 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
304 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
305 | # source='$<' object='$@' libtool=no \ | ||
306 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
307 | # $(COMPILE) -c $< | ||
308 | |||
309 | .c.obj: | ||
310 | $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
311 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
312 | # source='$<' object='$@' libtool=no \ | ||
313 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
314 | # $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
315 | |||
316 | .c.lo: | ||
317 | $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
318 | mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
319 | # source='$<' object='$@' libtool=yes \ | ||
320 | # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ | ||
321 | # $(LTCOMPILE) -c -o $@ $< | ||
322 | |||
323 | mostlyclean-libtool: | ||
324 | -rm -f *.lo | ||
325 | |||
326 | clean-libtool: | ||
327 | -rm -rf .libs _libs | ||
328 | |||
329 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
330 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
331 | unique=`for i in $$list; do \ | ||
332 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
333 | done | \ | ||
334 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
335 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
336 | mkid -fID $$unique | ||
337 | tags: TAGS | ||
338 | |||
339 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
340 | $(TAGS_FILES) $(LISP) | ||
341 | tags=; \ | ||
342 | here=`pwd`; \ | ||
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; nonempty = 1; } \ | ||
348 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
349 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
350 | test -n "$$unique" || unique=$$empty_fix; \ | ||
351 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
352 | $$tags $$unique; \ | ||
353 | fi | ||
354 | ctags: CTAGS | ||
355 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
356 | $(TAGS_FILES) $(LISP) | ||
357 | tags=; \ | ||
358 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
359 | unique=`for i in $$list; do \ | ||
360 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
361 | done | \ | ||
362 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
363 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
364 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
365 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
366 | $$tags $$unique | ||
367 | |||
368 | GTAGS: | ||
369 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
370 | && cd $(top_srcdir) \ | ||
371 | && gtags -i $(GTAGS_ARGS) $$here | ||
372 | |||
373 | distclean-tags: | ||
374 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
375 | |||
376 | distdir: $(DISTFILES) | ||
377 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
378 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
379 | list='$(DISTFILES)'; \ | ||
380 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
381 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
382 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
383 | case $$dist_files in \ | ||
384 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
385 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
386 | sort -u` ;; \ | ||
387 | esac; \ | ||
388 | for file in $$dist_files; do \ | ||
389 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
390 | if test -d $$d/$$file; then \ | ||
391 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
392 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
393 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
394 | fi; \ | ||
395 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
396 | else \ | ||
397 | test -f $(distdir)/$$file \ | ||
398 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
399 | || exit 1; \ | ||
400 | fi; \ | ||
401 | done | ||
402 | check-am: all-am | ||
403 | check: check-am | ||
404 | all-am: Makefile $(LTLIBRARIES) | ||
405 | installdirs: | ||
406 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
407 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
408 | done | ||
409 | install: install-am | ||
410 | install-exec: install-exec-am | ||
411 | install-data: install-data-am | ||
412 | uninstall: uninstall-am | ||
413 | |||
414 | install-am: all-am | ||
415 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
416 | |||
417 | installcheck: installcheck-am | ||
418 | install-strip: | ||
419 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
420 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
421 | `test -z '$(STRIP)' || \ | ||
422 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
423 | mostlyclean-generic: | ||
424 | |||
425 | clean-generic: | ||
426 | |||
427 | distclean-generic: | ||
428 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
429 | |||
430 | maintainer-clean-generic: | ||
431 | @echo "This command is intended for maintainers to use" | ||
432 | @echo "it deletes files that may require special tools to rebuild." | ||
433 | clean: clean-am | ||
434 | |||
435 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
436 | mostlyclean-am | ||
437 | |||
438 | distclean: distclean-am | ||
439 | -rm -rf ./$(DEPDIR) | ||
440 | -rm -f Makefile | ||
441 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
442 | distclean-tags | ||
443 | |||
444 | dvi: dvi-am | ||
445 | |||
446 | dvi-am: | ||
447 | |||
448 | html: html-am | ||
449 | |||
450 | info: info-am | ||
451 | |||
452 | info-am: | ||
453 | |||
454 | install-data-am: install-pluginimpLTLIBRARIES | ||
455 | |||
456 | install-dvi: install-dvi-am | ||
457 | |||
458 | install-exec-am: | ||
459 | |||
460 | install-html: install-html-am | ||
461 | |||
462 | install-info: install-info-am | ||
463 | |||
464 | install-man: | ||
465 | |||
466 | install-pdf: install-pdf-am | ||
467 | |||
468 | install-ps: install-ps-am | ||
469 | |||
470 | installcheck-am: | ||
471 | |||
472 | maintainer-clean: maintainer-clean-am | ||
473 | -rm -rf ./$(DEPDIR) | ||
474 | -rm -f Makefile | ||
475 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
476 | |||
477 | mostlyclean: mostlyclean-am | ||
478 | |||
479 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
480 | mostlyclean-libtool | ||
481 | |||
482 | pdf: pdf-am | ||
483 | |||
484 | pdf-am: | ||
485 | |||
486 | ps: ps-am | ||
487 | |||
488 | ps-am: | ||
489 | |||
490 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
491 | |||
492 | .MAKE: install-am install-strip | ||
493 | |||
494 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
495 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
496 | distclean-compile distclean-generic distclean-libtool \ | ||
497 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
498 | install install-am install-data install-data-am install-dvi \ | ||
499 | install-dvi-am install-exec install-exec-am install-html \ | ||
500 | install-html-am install-info install-info-am install-man \ | ||
501 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
502 | install-ps install-ps-am install-strip installcheck \ | ||
503 | installcheck-am installdirs maintainer-clean \ | ||
504 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
505 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
506 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
507 | |||
508 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
509 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
510 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile.am new file mode 100644 index 0000000..50b500a --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile.am | |||
@@ -0,0 +1,20 @@ | |||
1 | pluginimpdir = $(pkglibdir)/plugins/import | ||
2 | |||
3 | pluginimp_LTLIBRARIES = imp_leocad.la | ||
4 | |||
5 | AM_CFLAGS = \ | ||
6 | -Wall -ansi -pedantic \ | ||
7 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
8 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
9 | @GLIB_CFLAGS@ | ||
10 | |||
11 | INCLUDES = -I$(top_srcdir)/include | ||
12 | |||
13 | AM_LDFLAGS = \ | ||
14 | -no-undefined -module \ | ||
15 | @PLUGINS_LDFLAGS@ | ||
16 | |||
17 | LIBTOOL += --quiet | ||
18 | |||
19 | imp_leocad_la_SOURCES = imp_leocad.c imp_leocad_library.h imp_leocad_library.c | ||
20 | imp_leocad_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile.in new file mode 100644 index 0000000..8549398 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/Makefile.in | |||
@@ -0,0 +1,510 @@ | |||
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_leocad | ||
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_leocad_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la | ||
58 | am_imp_leocad_la_OBJECTS = imp_leocad.lo imp_leocad_library.lo | ||
59 | imp_leocad_la_OBJECTS = $(am_imp_leocad_la_OBJECTS) | ||
60 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d | ||
61 | depcomp = $(SHELL) $(top_srcdir)/config/depcomp | ||
62 | am__depfiles_maybe = depfiles | ||
63 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
64 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
65 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
66 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | ||
67 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
68 | CCLD = $(CC) | ||
69 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | ||
70 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ | ||
71 | $(LDFLAGS) -o $@ | ||
72 | SOURCES = $(imp_leocad_la_SOURCES) | ||
73 | DIST_SOURCES = $(imp_leocad_la_SOURCES) | ||
74 | ETAGS = etags | ||
75 | CTAGS = ctags | ||
76 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
77 | ACLOCAL = @ACLOCAL@ | ||
78 | AMTAR = @AMTAR@ | ||
79 | AR = @AR@ | ||
80 | AS = @AS@ | ||
81 | AUTOCONF = @AUTOCONF@ | ||
82 | AUTOHEADER = @AUTOHEADER@ | ||
83 | AUTOMAKE = @AUTOMAKE@ | ||
84 | AWK = @AWK@ | ||
85 | CC = @CC@ | ||
86 | CCDEPMODE = @CCDEPMODE@ | ||
87 | CFLAGS = @CFLAGS@ | ||
88 | CPP = @CPP@ | ||
89 | CPPFLAGS = @CPPFLAGS@ | ||
90 | CXX = @CXX@ | ||
91 | CXXCPP = @CXXCPP@ | ||
92 | CXXDEPMODE = @CXXDEPMODE@ | ||
93 | CXXFLAGS = @CXXFLAGS@ | ||
94 | CYGPATH_W = @CYGPATH_W@ | ||
95 | DBG_CFLAGS = @DBG_CFLAGS@ | ||
96 | DEBUG = @DEBUG@ | ||
97 | DEFS = @DEFS@ | ||
98 | DEPDIR = @DEPDIR@ | ||
99 | DLLTOOL = @DLLTOOL@ | ||
100 | ECHO = @ECHO@ | ||
101 | ECHO_C = @ECHO_C@ | ||
102 | ECHO_N = @ECHO_N@ | ||
103 | ECHO_T = @ECHO_T@ | ||
104 | EGREP = @EGREP@ | ||
105 | EXEEXT = @EXEEXT@ | ||
106 | F77 = @F77@ | ||
107 | FFLAGS = @FFLAGS@ | ||
108 | GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ | ||
109 | GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ | ||
110 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
111 | GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ | ||
112 | GLIB_LIBS = @GLIB_LIBS@ | ||
113 | GLIB_MKENUMS = @GLIB_MKENUMS@ | ||
114 | GOBJECT_QUERY = @GOBJECT_QUERY@ | ||
115 | GREP = @GREP@ | ||
116 | GTKDOC_CHECK = @GTKDOC_CHECK@ | ||
117 | GTK_CFLAGS = @GTK_CFLAGS@ | ||
118 | GTK_LIBS = @GTK_LIBS@ | ||
119 | HTML_DIR = @HTML_DIR@ | ||
120 | INSTALL = @INSTALL@ | ||
121 | INSTALL_DATA = @INSTALL_DATA@ | ||
122 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
123 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
124 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
125 | LDFLAGS = @LDFLAGS@ | ||
126 | LEX = @LEX@ | ||
127 | LEXLIB = @LEXLIB@ | ||
128 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ | ||
129 | LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ | ||
130 | LIBGSF_LIBS = @LIBGSF_LIBS@ | ||
131 | LIBOBJS = @LIBOBJS@ | ||
132 | LIBS = @LIBS@ | ||
133 | LIBTOOL = @LIBTOOL@ --quiet | ||
134 | LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ | ||
135 | LIBXML2_LIBS = @LIBXML2_LIBS@ | ||
136 | LN_S = @LN_S@ | ||
137 | LTLIBOBJS = @LTLIBOBJS@ | ||
138 | LTVERSION = @LTVERSION@ | ||
139 | MAGIC_LIBS = @MAGIC_LIBS@ | ||
140 | MAKEINFO = @MAKEINFO@ | ||
141 | MATH_LIBS = @MATH_LIBS@ | ||
142 | MKDIR_P = @MKDIR_P@ | ||
143 | OBJDUMP = @OBJDUMP@ | ||
144 | OBJEXT = @OBJEXT@ | ||
145 | PACKAGE = @PACKAGE@ | ||
146 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
147 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
148 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
149 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
150 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
151 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
152 | PKG_CONFIG = @PKG_CONFIG@ | ||
153 | PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ | ||
154 | RANLIB = @RANLIB@ | ||
155 | SET_MAKE = @SET_MAKE@ | ||
156 | SHELL = @SHELL@ | ||
157 | STRIP = @STRIP@ | ||
158 | VERSION = @VERSION@ | ||
159 | XML2_CONFIG = @XML2_CONFIG@ | ||
160 | XML_CPPFLAGS = @XML_CPPFLAGS@ | ||
161 | XML_LIBS = @XML_LIBS@ | ||
162 | Z_CFLAGS = @Z_CFLAGS@ | ||
163 | Z_LIBS = @Z_LIBS@ | ||
164 | abs_builddir = @abs_builddir@ | ||
165 | abs_srcdir = @abs_srcdir@ | ||
166 | abs_top_builddir = @abs_top_builddir@ | ||
167 | abs_top_srcdir = @abs_top_srcdir@ | ||
168 | ac_ct_CC = @ac_ct_CC@ | ||
169 | ac_ct_CXX = @ac_ct_CXX@ | ||
170 | ac_ct_F77 = @ac_ct_F77@ | ||
171 | am__include = @am__include@ | ||
172 | am__leading_dot = @am__leading_dot@ | ||
173 | am__quote = @am__quote@ | ||
174 | am__tar = @am__tar@ | ||
175 | am__untar = @am__untar@ | ||
176 | bindir = @bindir@ | ||
177 | build = @build@ | ||
178 | build_alias = @build_alias@ | ||
179 | build_cpu = @build_cpu@ | ||
180 | build_os = @build_os@ | ||
181 | build_vendor = @build_vendor@ | ||
182 | builddir = @builddir@ | ||
183 | datadir = @datadir@ | ||
184 | datarootdir = @datarootdir@ | ||
185 | docdir = @docdir@ | ||
186 | dvidir = @dvidir@ | ||
187 | exec_prefix = @exec_prefix@ | ||
188 | host = @host@ | ||
189 | host_alias = @host_alias@ | ||
190 | host_cpu = @host_cpu@ | ||
191 | host_os = @host_os@ | ||
192 | host_vendor = @host_vendor@ | ||
193 | htmldir = @htmldir@ | ||
194 | includedir = @includedir@ | ||
195 | infodir = @infodir@ | ||
196 | install_sh = @install_sh@ | ||
197 | libdir = @libdir@ | ||
198 | libexecdir = @libexecdir@ | ||
199 | localedir = @localedir@ | ||
200 | localstatedir = @localstatedir@ | ||
201 | mandir = @mandir@ | ||
202 | mkdir_p = @mkdir_p@ | ||
203 | oldincludedir = @oldincludedir@ | ||
204 | pdfdir = @pdfdir@ | ||
205 | prefix = @prefix@ | ||
206 | program_transform_name = @program_transform_name@ | ||
207 | psdir = @psdir@ | ||
208 | sbindir = @sbindir@ | ||
209 | sharedstatedir = @sharedstatedir@ | ||
210 | srcdir = @srcdir@ | ||
211 | sysconfdir = @sysconfdir@ | ||
212 | target_alias = @target_alias@ | ||
213 | top_builddir = @top_builddir@ | ||
214 | top_srcdir = @top_srcdir@ | ||
215 | pluginimpdir = $(pkglibdir)/plugins/import | ||
216 | pluginimp_LTLIBRARIES = imp_leocad.la | ||
217 | AM_CFLAGS = \ | ||
218 | -Wall -ansi -pedantic \ | ||
219 | -DG_LOG_DOMAIN=\"LibG3D\" \ | ||
220 | @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ | ||
221 | @GLIB_CFLAGS@ | ||
222 | |||
223 | INCLUDES = -I$(top_srcdir)/include | ||
224 | AM_LDFLAGS = \ | ||
225 | -no-undefined -module \ | ||
226 | @PLUGINS_LDFLAGS@ | ||
227 | |||
228 | imp_leocad_la_SOURCES = imp_leocad.c imp_leocad_library.h imp_leocad_library.c | ||
229 | imp_leocad_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ | ||
230 | all: all-am | ||
231 | |||
232 | .SUFFIXES: | ||
233 | .SUFFIXES: .c .lo .o .obj | ||
234 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
235 | @for dep in $?; do \ | ||
236 | case '$(am__configure_deps)' in \ | ||
237 | *$$dep*) \ | ||
238 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
239 | && exit 0; \ | ||
240 | exit 1;; \ | ||
241 | esac; \ | ||
242 | done; \ | ||
243 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_leocad/Makefile'; \ | ||
244 | cd $(top_srcdir) && \ | ||
245 | $(AUTOMAKE) --gnu plugins/import/imp_leocad/Makefile | ||
246 | .PRECIOUS: Makefile | ||
247 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
248 | @case '$?' in \ | ||
249 | *config.status*) \ | ||
250 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
251 | *) \ | ||
252 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
253 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
254 | esac; | ||
255 | |||
256 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
257 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
258 | |||
259 | $(top_srcdir)/configure: $(am__configure_deps) | ||
260 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
261 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
262 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
263 | install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES) | ||
264 | @$(NORMAL_INSTALL) | ||
265 | test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)" | ||
266 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
267 | if test -f $$p; then \ | ||
268 | f=$(am__strip_dir) \ | ||
269 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \ | ||
270 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \ | ||
271 | else :; fi; \ | ||
272 | done | ||
273 | |||
274 | uninstall-pluginimpLTLIBRARIES: | ||
275 | @$(NORMAL_UNINSTALL) | ||
276 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
277 | p=$(am__strip_dir) \ | ||
278 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \ | ||
279 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \ | ||
280 | done | ||
281 | |||
282 | clean-pluginimpLTLIBRARIES: | ||
283 | -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES) | ||
284 | @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \ | ||
285 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
286 | test "$$dir" != "$$p" || dir=.; \ | ||
287 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
288 | rm -f "$${dir}/so_locations"; \ | ||
289 | done | ||
290 | imp_leocad.la: $(imp_leocad_la_OBJECTS) $(imp_leocad_la_DEPENDENCIES) | ||
291 | $(LINK) -rpath $(pluginimpdir) $(imp_leocad_la_OBJECTS) $(imp_leocad_la_LIBADD) $(LIBS) | ||
292 | |||
293 | mostlyclean-compile: | ||
294 | -rm -f *.$(OBJEXT) | ||
295 | |||
296 | distclean-compile: | ||
297 | -rm -f *.tab.c | ||
298 | |||
299 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_leocad.Plo@am__quote@ | ||
300 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_leocad_library.Plo@am__quote@ | ||
301 | |||
302 | .c.o: | ||
303 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
304 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
305 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
306 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
307 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
308 | |||
309 | .c.obj: | ||
310 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
311 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
312 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
313 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
314 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
315 | |||
316 | .c.lo: | ||
317 | @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
318 | @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
319 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
320 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
321 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
322 | |||
323 | mostlyclean-libtool: | ||
324 | -rm -f *.lo | ||
325 | |||
326 | clean-libtool: | ||
327 | -rm -rf .libs _libs | ||
328 | |||
329 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
330 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
331 | unique=`for i in $$list; do \ | ||
332 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
333 | done | \ | ||
334 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
335 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
336 | mkid -fID $$unique | ||
337 | tags: TAGS | ||
338 | |||
339 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
340 | $(TAGS_FILES) $(LISP) | ||
341 | tags=; \ | ||
342 | here=`pwd`; \ | ||
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; nonempty = 1; } \ | ||
348 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
349 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
350 | test -n "$$unique" || unique=$$empty_fix; \ | ||
351 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
352 | $$tags $$unique; \ | ||
353 | fi | ||
354 | ctags: CTAGS | ||
355 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
356 | $(TAGS_FILES) $(LISP) | ||
357 | tags=; \ | ||
358 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
359 | unique=`for i in $$list; do \ | ||
360 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
361 | done | \ | ||
362 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
363 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
364 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
365 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
366 | $$tags $$unique | ||
367 | |||
368 | GTAGS: | ||
369 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
370 | && cd $(top_srcdir) \ | ||
371 | && gtags -i $(GTAGS_ARGS) $$here | ||
372 | |||
373 | distclean-tags: | ||
374 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
375 | |||
376 | distdir: $(DISTFILES) | ||
377 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
378 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
379 | list='$(DISTFILES)'; \ | ||
380 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
381 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
382 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
383 | case $$dist_files in \ | ||
384 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
385 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
386 | sort -u` ;; \ | ||
387 | esac; \ | ||
388 | for file in $$dist_files; do \ | ||
389 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
390 | if test -d $$d/$$file; then \ | ||
391 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
392 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
393 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
394 | fi; \ | ||
395 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
396 | else \ | ||
397 | test -f $(distdir)/$$file \ | ||
398 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
399 | || exit 1; \ | ||
400 | fi; \ | ||
401 | done | ||
402 | check-am: all-am | ||
403 | check: check-am | ||
404 | all-am: Makefile $(LTLIBRARIES) | ||
405 | installdirs: | ||
406 | for dir in "$(DESTDIR)$(pluginimpdir)"; do \ | ||
407 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
408 | done | ||
409 | install: install-am | ||
410 | install-exec: install-exec-am | ||
411 | install-data: install-data-am | ||
412 | uninstall: uninstall-am | ||
413 | |||
414 | install-am: all-am | ||
415 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
416 | |||
417 | installcheck: installcheck-am | ||
418 | install-strip: | ||
419 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
420 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
421 | `test -z '$(STRIP)' || \ | ||
422 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
423 | mostlyclean-generic: | ||
424 | |||
425 | clean-generic: | ||
426 | |||
427 | distclean-generic: | ||
428 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
429 | |||
430 | maintainer-clean-generic: | ||
431 | @echo "This command is intended for maintainers to use" | ||
432 | @echo "it deletes files that may require special tools to rebuild." | ||
433 | clean: clean-am | ||
434 | |||
435 | clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \ | ||
436 | mostlyclean-am | ||
437 | |||
438 | distclean: distclean-am | ||
439 | -rm -rf ./$(DEPDIR) | ||
440 | -rm -f Makefile | ||
441 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
442 | distclean-tags | ||
443 | |||
444 | dvi: dvi-am | ||
445 | |||
446 | dvi-am: | ||
447 | |||
448 | html: html-am | ||
449 | |||
450 | info: info-am | ||
451 | |||
452 | info-am: | ||
453 | |||
454 | install-data-am: install-pluginimpLTLIBRARIES | ||
455 | |||
456 | install-dvi: install-dvi-am | ||
457 | |||
458 | install-exec-am: | ||
459 | |||
460 | install-html: install-html-am | ||
461 | |||
462 | install-info: install-info-am | ||
463 | |||
464 | install-man: | ||
465 | |||
466 | install-pdf: install-pdf-am | ||
467 | |||
468 | install-ps: install-ps-am | ||
469 | |||
470 | installcheck-am: | ||
471 | |||
472 | maintainer-clean: maintainer-clean-am | ||
473 | -rm -rf ./$(DEPDIR) | ||
474 | -rm -f Makefile | ||
475 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
476 | |||
477 | mostlyclean: mostlyclean-am | ||
478 | |||
479 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
480 | mostlyclean-libtool | ||
481 | |||
482 | pdf: pdf-am | ||
483 | |||
484 | pdf-am: | ||
485 | |||
486 | ps: ps-am | ||
487 | |||
488 | ps-am: | ||
489 | |||
490 | uninstall-am: uninstall-pluginimpLTLIBRARIES | ||
491 | |||
492 | .MAKE: install-am install-strip | ||
493 | |||
494 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
495 | clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \ | ||
496 | distclean-compile distclean-generic distclean-libtool \ | ||
497 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
498 | install install-am install-data install-data-am install-dvi \ | ||
499 | install-dvi-am install-exec install-exec-am install-html \ | ||
500 | install-html-am install-info install-info-am install-man \ | ||
501 | install-pdf install-pdf-am install-pluginimpLTLIBRARIES \ | ||
502 | install-ps install-ps-am install-strip installcheck \ | ||
503 | installcheck-am installdirs maintainer-clean \ | ||
504 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
505 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
506 | tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES | ||
507 | |||
508 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
509 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
510 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad.c new file mode 100644 index 0000000..590c342 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad.c | |||
@@ -0,0 +1,496 @@ | |||
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 | |||
23 | #include <stdlib.h> | ||
24 | #include <string.h> | ||
25 | #include <locale.h> | ||
26 | |||
27 | #include <math.h> | ||
28 | |||
29 | #include <g3d/types.h> | ||
30 | #include <g3d/context.h> | ||
31 | #include <g3d/model.h> | ||
32 | #include <g3d/read.h> | ||
33 | #include <g3d/vector.h> | ||
34 | #include <g3d/matrix.h> | ||
35 | |||
36 | #include "imp_leocad_library.h" | ||
37 | |||
38 | static int leocad_load_lcd(G3DStream *stream, G3DModel *model, | ||
39 | LeoCadLibrary *library, G3DContext *context); | ||
40 | |||
41 | EAPI | ||
42 | gpointer plugin_init(G3DContext *context) | ||
43 | { | ||
44 | LeoCadLibrary *library; | ||
45 | const gchar *libdir; | ||
46 | |||
47 | libdir = g_getenv("LEOCAD_LIB"); | ||
48 | if(libdir == NULL) | ||
49 | libdir = "/usr/local/share/leocad"; | ||
50 | |||
51 | library = leocad_library_load(libdir); | ||
52 | |||
53 | if(library == NULL) | ||
54 | { | ||
55 | #if DEBUG > 1 | ||
56 | g_warning("LeoCAD: failed to load library"); | ||
57 | #endif | ||
58 | return NULL; | ||
59 | } | ||
60 | |||
61 | return library; | ||
62 | } | ||
63 | |||
64 | EAPI | ||
65 | void plugin_cleanup(gpointer user_data) | ||
66 | { | ||
67 | LeoCadLibrary *library; | ||
68 | |||
69 | #if DEBUG > 1 | ||
70 | g_debug("LeoCAD: cleaning up library\n"); | ||
71 | #endif | ||
72 | |||
73 | library = (LeoCadLibrary *)user_data; | ||
74 | |||
75 | if(library) | ||
76 | leocad_library_free(library); | ||
77 | } | ||
78 | |||
79 | EAPI | ||
80 | gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream, | ||
81 | G3DModel *model, gpointer user_data) | ||
82 | { | ||
83 | LeoCadLibrary *library; | ||
84 | |||
85 | library = (LeoCadLibrary *)user_data; | ||
86 | |||
87 | if(library == NULL) | ||
88 | { | ||
89 | g_warning("LeoCAD: library not loaded"); | ||
90 | return FALSE; | ||
91 | } | ||
92 | |||
93 | setlocale(LC_NUMERIC, "C"); | ||
94 | |||
95 | return leocad_load_lcd(stream, model, library, context); | ||
96 | } | ||
97 | |||
98 | EAPI | ||
99 | gchar *plugin_description(G3DContext *context) | ||
100 | { | ||
101 | return g_strdup("LeoCAD models."); | ||
102 | } | ||
103 | |||
104 | EAPI | ||
105 | gchar **plugin_extensions(G3DContext *context) | ||
106 | { | ||
107 | return g_strsplit("lcd", ":", 0); | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | * LeoCAD specific stuff | ||
112 | */ | ||
113 | |||
114 | static gboolean leocad_change_key(guint16 ktime, G3DFloat *param, guint8 ktype, | ||
115 | G3DFloat *matrix, G3DFloat *mloc, gboolean *valid_matrix) | ||
116 | { | ||
117 | /* get first frame */ | ||
118 | if(ktime == 1) | ||
119 | { | ||
120 | switch(ktype) | ||
121 | { | ||
122 | case 0x00: /* translation */ | ||
123 | g3d_matrix_identity(mloc); | ||
124 | g3d_matrix_translate(param[0], param[1], param[2], mloc); | ||
125 | g3d_matrix_multiply(matrix, mloc, matrix); | ||
126 | *valid_matrix = TRUE; | ||
127 | break; | ||
128 | |||
129 | case 0x01: /* rotation */ | ||
130 | g3d_matrix_rotate((G3DFloat)param[3] * G_PI / 180.0, | ||
131 | param[0], param[1], param[2], matrix); | ||
132 | g3d_matrix_multiply(mloc, matrix, matrix); | ||
133 | *valid_matrix = TRUE; | ||
134 | break; | ||
135 | |||
136 | default: | ||
137 | break; | ||
138 | } | ||
139 | } | ||
140 | #if DEBUG > 0 | ||
141 | g_debug("LeoCAD: key 0x%02x (%d): %+2.2f %+2.2f %+2.2f %+2.2f", | ||
142 | ktype, ktime, param[0], param[1], param[2], param[3]); | ||
143 | #endif | ||
144 | return TRUE; | ||
145 | } | ||
146 | |||
147 | static gboolean leocad_load_lcd_piece(G3DStream *stream, G3DModel *model, | ||
148 | LeoCadLibrary *library, G3DFloat lcdversion) | ||
149 | { | ||
150 | guint32 i, j, k, nkeys, nobjs; | ||
151 | guint16 ktime; | ||
152 | guint8 pver, over, ktype, color = 0, len8; | ||
153 | gchar name[9]; | ||
154 | G3DFloat param[4], matrix[16], mloc[16]; | ||
155 | G3DFloat offx = 0.0, offy = 0.0, offz = 0.0; | ||
156 | G3DFloat rotx = 0.0, roty = 0.0, rotz = 0.0; | ||
157 | G3DObject *object; | ||
158 | G3DMaterial *mat_change; | ||
159 | G3DFace *face; | ||
160 | GSList *fitem; | ||
161 | gboolean valid_matrix = FALSE; | ||
162 | |||
163 | g3d_matrix_identity(mloc); | ||
164 | g3d_matrix_identity(matrix); | ||
165 | |||
166 | mat_change = leocad_library_get_nth_material(library, 0x10); | ||
167 | |||
168 | if(lcdversion > 0.4) | ||
169 | { | ||
170 | pver = g3d_stream_read_int8(stream); | ||
171 | |||
172 | if(pver >= 9) | ||
173 | { | ||
174 | /* object stuff */ | ||
175 | over = g3d_stream_read_int8(stream); | ||
176 | nobjs = g3d_stream_read_int32_le(stream); | ||
177 | for(i = 0; i < nobjs; i ++) | ||
178 | { | ||
179 | /* time */ | ||
180 | ktime = g3d_stream_read_int16_le(stream); | ||
181 | /* param */ | ||
182 | param[0] = g3d_stream_read_float_le(stream); | ||
183 | param[1] = g3d_stream_read_float_le(stream); | ||
184 | param[2] = g3d_stream_read_float_le(stream); | ||
185 | param[3] = g3d_stream_read_float_le(stream); | ||
186 | /* type */ | ||
187 | ktype = g3d_stream_read_int8(stream); | ||
188 | |||
189 | leocad_change_key(ktime, param, ktype, matrix, mloc, | ||
190 | &valid_matrix); | ||
191 | } | ||
192 | |||
193 | if(over == 1) | ||
194 | { | ||
195 | nobjs = g3d_stream_read_int32_le(stream); | ||
196 | for(i = 0; i < nobjs; i ++) | ||
197 | { | ||
198 | ktime = g3d_stream_read_int16_le(stream); | ||
199 | param[0] = g3d_stream_read_float_le(stream); | ||
200 | param[1] = g3d_stream_read_float_le(stream); | ||
201 | param[2] = g3d_stream_read_float_le(stream); | ||
202 | param[3] = g3d_stream_read_float_le(stream); | ||
203 | ktype = g3d_stream_read_int8(stream); | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | else /* pver < 9 */ | ||
208 | { | ||
209 | if(pver > 5) | ||
210 | { | ||
211 | nkeys = g3d_stream_read_int32_le(stream); | ||
212 | for(i = 0; i < nkeys; i ++) | ||
213 | { | ||
214 | /* param */ | ||
215 | param[0] = g3d_stream_read_float_le(stream); | ||
216 | param[1] = g3d_stream_read_float_le(stream); | ||
217 | param[2] = g3d_stream_read_float_le(stream); | ||
218 | param[3] = g3d_stream_read_float_le(stream); | ||
219 | |||
220 | /* time */ | ||
221 | ktime = g3d_stream_read_int16_le(stream); | ||
222 | |||
223 | /* type */ | ||
224 | ktype = g3d_stream_read_int8(stream); | ||
225 | |||
226 | leocad_change_key(ktime, param, ktype, matrix, mloc, | ||
227 | &valid_matrix); | ||
228 | |||
229 | } /* keys */ | ||
230 | |||
231 | nkeys = g3d_stream_read_int32_le(stream); | ||
232 | for(i = 0; i < nkeys; i ++) | ||
233 | { | ||
234 | /* param */ | ||
235 | param[0] = g3d_stream_read_float_le(stream); | ||
236 | param[1] = g3d_stream_read_float_le(stream); | ||
237 | param[2] = g3d_stream_read_float_le(stream); | ||
238 | param[3] = g3d_stream_read_float_le(stream); | ||
239 | |||
240 | /* time */ | ||
241 | ktime = g3d_stream_read_int16_le(stream); | ||
242 | |||
243 | /* type */ | ||
244 | ktype = g3d_stream_read_int8(stream); | ||
245 | } | ||
246 | } /* pver > 5 */ | ||
247 | else /* pver <= 5 */ | ||
248 | { | ||
249 | if(pver > 2) | ||
250 | { | ||
251 | nkeys = g3d_stream_read_int8(stream); | ||
252 | for(i = 0; i < nkeys; i ++) | ||
253 | { | ||
254 | if(pver > 3) | ||
255 | { | ||
256 | #if DEBUG > 2 | ||
257 | g_debug("LeoCAD: matrix\n"); | ||
258 | #endif | ||
259 | /* matrix */ | ||
260 | for(j = 0; j < 4; j ++) | ||
261 | for(k = 0; k < 4; k ++) | ||
262 | matrix[j * 4 + k] = | ||
263 | g3d_stream_read_float_le(stream); | ||
264 | |||
265 | valid_matrix = TRUE; | ||
266 | } | ||
267 | else | ||
268 | { | ||
269 | /* move: 3 x float */ | ||
270 | offx = g3d_stream_read_float_le(stream); | ||
271 | offy = g3d_stream_read_float_le(stream); | ||
272 | offz = g3d_stream_read_float_le(stream); | ||
273 | |||
274 | /* rotate: 3 x float */ | ||
275 | rotx = g3d_stream_read_float_le(stream); | ||
276 | roty = g3d_stream_read_float_le(stream); | ||
277 | rotz = g3d_stream_read_float_le(stream); | ||
278 | } | ||
279 | |||
280 | /* time */ | ||
281 | ktime = g3d_stream_read_int8(stream); | ||
282 | |||
283 | /* bl? */ | ||
284 | g3d_stream_read_int32_le(stream); | ||
285 | } /* .. nkeys */ | ||
286 | } /* pver > 2 */ | ||
287 | else /* pver <= 2 */ | ||
288 | { | ||
289 | /* move: 3 x float */ | ||
290 | offx = g3d_stream_read_float_le(stream); | ||
291 | offy = g3d_stream_read_float_le(stream); | ||
292 | offz = g3d_stream_read_float_le(stream); | ||
293 | |||
294 | /* rotate: 3 x float */ | ||
295 | rotx = g3d_stream_read_float_le(stream); | ||
296 | roty = g3d_stream_read_float_le(stream); | ||
297 | rotz = g3d_stream_read_float_le(stream); | ||
298 | } | ||
299 | } /* pver <= 5 */ | ||
300 | } /* pver < 9 */ | ||
301 | |||
302 | /* common stuff */ | ||
303 | |||
304 | /* name of piece */ | ||
305 | g3d_stream_read(stream, name, 9); | ||
306 | |||
307 | /* color */ | ||
308 | color = g3d_stream_read_int8(stream); | ||
309 | |||
310 | if(pver < 5) | ||
311 | color = leocad_library_convert_color(color); | ||
312 | |||
313 | #if DEBUG > 0 | ||
314 | g_debug("LeoCAD: [%d]: '%-8s', color 0x%02x", pver, name, color); | ||
315 | #endif | ||
316 | |||
317 | /* step show */ | ||
318 | g3d_stream_read_int8(stream); | ||
319 | |||
320 | /* step hide */ | ||
321 | if(pver > 1) | ||
322 | g3d_stream_read_int8(stream); | ||
323 | |||
324 | if(pver > 5) | ||
325 | { | ||
326 | /* frame show */ | ||
327 | g3d_stream_read_int16_le(stream); | ||
328 | /* frame hide */ | ||
329 | g3d_stream_read_int16_le(stream); | ||
330 | |||
331 | if(pver > 7) { | ||
332 | /* state */ | ||
333 | g3d_stream_read_int8(stream); | ||
334 | |||
335 | len8 = g3d_stream_read_int8(stream); | ||
336 | g3d_stream_skip(stream, len8); | ||
337 | } else { /* pver <= 7 */ | ||
338 | /* hide */ | ||
339 | g3d_stream_read_int32_le(stream); | ||
340 | g3d_stream_skip(stream, 81); | ||
341 | } /* pver <= 7 */ | ||
342 | |||
343 | if(pver > 6) { | ||
344 | /* group pointer ?! */ | ||
345 | g3d_stream_read_int32_le(stream); | ||
346 | } | ||
347 | } /* pver > 5 */ | ||
348 | else /* pver <= 5 */ | ||
349 | { | ||
350 | /* group pointer ?! */ | ||
351 | g3d_stream_read_int8(stream); | ||
352 | |||
353 | /* hide */ | ||
354 | g3d_stream_read_int8(stream); | ||
355 | } | ||
356 | |||
357 | } /* lcdversion > 0.4 */ | ||
358 | |||
359 | object = leocad_library_get_piece(library, name); | ||
360 | if(object == NULL) | ||
361 | { | ||
362 | g_warning("LeoCAD: failed to load piece '%s'", name); | ||
363 | return FALSE; | ||
364 | } | ||
365 | |||
366 | /* matrix */ | ||
367 | if(!valid_matrix) | ||
368 | { | ||
369 | /* translation */ | ||
370 | g3d_matrix_identity(mloc); | ||
371 | g3d_matrix_translate(offx, offy, offz, mloc); | ||
372 | /* rotation */ | ||
373 | rotx = (G3DFloat)(rotx * G_PI) / 180.0; | ||
374 | roty = (G3DFloat)(roty * G_PI) / 180.0; | ||
375 | rotz = (G3DFloat)(rotz * G_PI) / 180.0; | ||
376 | g3d_matrix_identity(matrix); | ||
377 | g3d_matrix_rotate_xyz(rotx, roty, rotz, matrix); | ||
378 | |||
379 | /* combine */ | ||
380 | g3d_matrix_multiply(mloc, matrix, matrix); | ||
381 | } | ||
382 | |||
383 | /*g3d_matrix_dump(matrix);*/ | ||
384 | |||
385 | /* transform vertices */ | ||
386 | for(i = 0; i < object->vertex_count; i ++) | ||
387 | g3d_vector_transform( | ||
388 | &(object->vertex_data[i * 3 + 0]), | ||
389 | &(object->vertex_data[i * 3 + 1]), | ||
390 | &(object->vertex_data[i * 3 + 2]), | ||
391 | matrix); | ||
392 | |||
393 | /* change color */ | ||
394 | fitem = object->faces; | ||
395 | while(fitem) | ||
396 | { | ||
397 | face = (G3DFace *)fitem->data; | ||
398 | if(face->material == mat_change) | ||
399 | { | ||
400 | face->material = leocad_library_get_nth_material(library, color); | ||
401 | } | ||
402 | |||
403 | if(face->material == NULL) | ||
404 | { | ||
405 | face->material = leocad_library_get_nth_material(library, 0); | ||
406 | } | ||
407 | |||
408 | fitem = fitem->next; | ||
409 | } | ||
410 | |||
411 | /* add to model object list */ | ||
412 | model->objects = g_slist_append(model->objects, object); | ||
413 | |||
414 | return TRUE; | ||
415 | } | ||
416 | |||
417 | static gboolean leocad_load_lcd(G3DStream *stream, G3DModel *model, | ||
418 | LeoCadLibrary *library, G3DContext *context) | ||
419 | { | ||
420 | gchar magic[32]; | ||
421 | float version; | ||
422 | guint32 i, count; | ||
423 | G3DFloat r, g, b; | ||
424 | G3DMatrix rmatrix[16]; | ||
425 | |||
426 | g3d_stream_read(stream, magic, 32); | ||
427 | if(strncmp(magic, "LeoCAD", 6) != 0) { | ||
428 | g_warning("LeoCAD: '%s' is not a valid LeoCAD project file", | ||
429 | stream->uri); | ||
430 | return FALSE; | ||
431 | } | ||
432 | |||
433 | sscanf(&magic[7], "%f", &version); | ||
434 | |||
435 | if(version > 0.4) { | ||
436 | #if DEBUG > 0 | ||
437 | g_debug("LeoCAD: file version %.1f, getting next float", version); | ||
438 | #endif | ||
439 | version = g3d_stream_read_float_le(stream); | ||
440 | } | ||
441 | |||
442 | #if DEBUG > 0 | ||
443 | g_debug("LeoCAD: file version %.1f", version); | ||
444 | #endif | ||
445 | |||
446 | r = g3d_stream_read_int8(stream) / 255.0; | ||
447 | g = g3d_stream_read_int8(stream) / 255.0; | ||
448 | b = g3d_stream_read_int8(stream) / 255.0; | ||
449 | /* background color */ | ||
450 | g3d_context_set_bgcolor(context, r, g, b, 1.0); | ||
451 | g3d_stream_read_int8(stream); | ||
452 | |||
453 | /* view */ | ||
454 | if(version < 0.6) { | ||
455 | /* eye: 3 x double */ | ||
456 | g3d_stream_skip(stream, 24); | ||
457 | |||
458 | /* target: 3 x double */ | ||
459 | g3d_stream_skip(stream, 24); | ||
460 | } | ||
461 | |||
462 | /* angle snap */ | ||
463 | g3d_stream_read_int32_le(stream); | ||
464 | /* snap */ | ||
465 | g3d_stream_read_int32_le(stream); | ||
466 | /* line width */ | ||
467 | g3d_stream_read_float_le(stream); | ||
468 | /* detail */ | ||
469 | g3d_stream_read_int32_le(stream); | ||
470 | /* cur group */ | ||
471 | g3d_stream_read_int32_le(stream); | ||
472 | /* cur color */ | ||
473 | g3d_stream_read_int32_le(stream); | ||
474 | /* action */ | ||
475 | g3d_stream_read_int32_le(stream); | ||
476 | /* cur step */ | ||
477 | g3d_stream_read_int32_le(stream); | ||
478 | |||
479 | if(version > 0.8) { | ||
480 | /* scene */ | ||
481 | g3d_stream_read_int32_le(stream); | ||
482 | } | ||
483 | |||
484 | /* piece count */ | ||
485 | count = g3d_stream_read_int32_le(stream); | ||
486 | for(i = 0; i < count; i ++) { | ||
487 | /* load piece */ | ||
488 | leocad_load_lcd_piece(stream, model, library, version); | ||
489 | } | ||
490 | |||
491 | g3d_matrix_identity(rmatrix); | ||
492 | g3d_matrix_rotate_xyz(G_PI * -90.0 / 180, 0.0, 0.0, rmatrix); | ||
493 | g3d_model_transform(model, rmatrix); | ||
494 | |||
495 | return TRUE; | ||
496 | } | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad_library.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad_library.c new file mode 100644 index 0000000..7336336 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad_library.c | |||
@@ -0,0 +1,633 @@ | |||
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 | |||
23 | #include <g3d/config.h> | ||
24 | |||
25 | #include <string.h> | ||
26 | |||
27 | #include <glib.h> | ||
28 | |||
29 | #include <g3d/types.h> | ||
30 | #include <g3d/object.h> | ||
31 | #include <g3d/material.h> | ||
32 | #include <g3d/stream.h> | ||
33 | #include <g3d/primitive.h> | ||
34 | #include <g3d/matrix.h> | ||
35 | |||
36 | #include "imp_leocad_library.h" | ||
37 | |||
38 | #define LEOCAD_FLAG_PIECE_COUNT 0x01 | ||
39 | #define LEOCAD_FLAG_PIECE_LONGDATA 0x02 | ||
40 | #define LEOCAD_FLAG_PIECE_CCW 0x04 | ||
41 | #define LEOCAD_FLAG_PIECE_SMALL 0x10 | ||
42 | #define LEOCAD_FLAG_PIECE_MEDIUM 0x20 | ||
43 | #define LEOCAD_FLAG_LONGDATA_RUNTIME 0x40 | ||
44 | #define LEOCAD_FLAG_PIECE_RENAMED 0x80 | ||
45 | |||
46 | #define LEOCAD_TYPE_MESH 0x01 | ||
47 | #define LEOCAD_TYPE_STUD 0x02 | ||
48 | #define LEOCAD_TYPE_STUD2 0x03 | ||
49 | #define LEOCAD_TYPE_STUD3 0x04 | ||
50 | #define LEOCAD_TYPE_STUD4 0x05 | ||
51 | |||
52 | static gboolean leocad_library_read_pieces_idx(LeoCadLibrary *library, | ||
53 | G3DStream *idx); | ||
54 | static gboolean leocad_create_materials(LeoCadLibrary *library); | ||
55 | |||
56 | struct LeoCadConnection { | ||
57 | guint8 type; | ||
58 | G3DFloat center[3]; | ||
59 | G3DFloat normal[3]; | ||
60 | }; | ||
61 | |||
62 | LeoCadLibrary *leocad_library_load(const gchar *libdir) | ||
63 | { | ||
64 | LeoCadLibrary *library; | ||
65 | gchar filename[1025]; | ||
66 | G3DStream *idx, *bin; | ||
67 | |||
68 | library = g_new0(LeoCadLibrary, 1); | ||
69 | |||
70 | g_snprintf(filename, 1024, "%s/%s", libdir, "pieces.idx"); | ||
71 | idx = g3d_stream_open_file(filename, "rb"); | ||
72 | if(idx == NULL) { | ||
73 | #if DEBUG > 0 | ||
74 | g_warning("LeoCAD: failed to read '%s'", filename); | ||
75 | #endif | ||
76 | g_free(library); | ||
77 | return NULL; | ||
78 | } | ||
79 | |||
80 | g_snprintf(filename, 1024, "%s/%s", libdir, "pieces.bin"); | ||
81 | bin = g3d_stream_open_file(filename, "rb"); | ||
82 | if(bin == NULL) { | ||
83 | #if DEBUG > 0 | ||
84 | g_debug("LeoCAD: failed to read '%s'", filename); | ||
85 | #endif | ||
86 | g3d_stream_close(idx); | ||
87 | g_free(library); | ||
88 | return NULL; | ||
89 | } | ||
90 | |||
91 | library->pieces = g_hash_table_new(g_str_hash, g_str_equal); | ||
92 | library->pieces_bin = bin; | ||
93 | |||
94 | leocad_library_read_pieces_idx(library, idx); | ||
95 | g3d_stream_close(idx); | ||
96 | |||
97 | leocad_create_materials(library); | ||
98 | |||
99 | return library; | ||
100 | } | ||
101 | |||
102 | static gboolean leocad_free_piece_cb(gpointer key, gpointer value, | ||
103 | gpointer user_data) | ||
104 | { | ||
105 | LeoCadPiece *piece; | ||
106 | |||
107 | piece = (LeoCadPiece *)value; | ||
108 | |||
109 | #if DEBUG > 3 | ||
110 | g_debug("D: freeing piece %s", piece->name); | ||
111 | #endif | ||
112 | |||
113 | if(piece->name) g_free(piece->name); | ||
114 | if(piece->description) g_free(piece->description); | ||
115 | if(piece->moved_to) g_free(piece->moved_to); | ||
116 | |||
117 | if(!(piece->flags & LEOCAD_FLAG_PIECE_RENAMED)) | ||
118 | if(piece->object) g3d_object_free(piece->object); | ||
119 | |||
120 | g_free(piece); | ||
121 | |||
122 | return TRUE; | ||
123 | } | ||
124 | |||
125 | void leocad_library_free(LeoCadLibrary *library) | ||
126 | { | ||
127 | GSList *mlist; | ||
128 | G3DMaterial *material; | ||
129 | |||
130 | /* remove materials */ | ||
131 | mlist = library->materials; | ||
132 | while(mlist) | ||
133 | { | ||
134 | material = (G3DMaterial *)mlist->data; | ||
135 | mlist = g_slist_remove(mlist, material); | ||
136 | g3d_material_free(material); | ||
137 | } | ||
138 | |||
139 | /* remove pieces */ | ||
140 | g_hash_table_foreach_remove(library->pieces, leocad_free_piece_cb, NULL); | ||
141 | g_hash_table_destroy(library->pieces); | ||
142 | |||
143 | /* free library */ | ||
144 | g_free(library); | ||
145 | } | ||
146 | |||
147 | static G3DFloat leocad_read_scaled16(G3DStream *stream, G3DFloat scale) | ||
148 | { | ||
149 | gint16 x; | ||
150 | |||
151 | x = g3d_stream_read_int16_le(stream); | ||
152 | |||
153 | return (G3DFloat)(x / scale); | ||
154 | } | ||
155 | |||
156 | static gboolean leocad_create_materials(LeoCadLibrary *library) | ||
157 | { | ||
158 | const guint8 colors[] = { | ||
159 | 166, 25, 25, 255, /* 0 - Red */ | ||
160 | 255, 127, 51, 255, /* 1 - Orange */ | ||
161 | 25, 102, 25, 255, /* 2 - Green */ | ||
162 | 76, 153, 76, 255, /* 3 - Light Green */ | ||
163 | 0, 51, 178, 255, /* 4 - Blue */ | ||
164 | 51, 102, 229, 255, /* 5 - Light Blue */ | ||
165 | 204, 204, 0, 255, /* 6 - Yellow */ | ||
166 | 242, 242, 242, 255, /* 7 - White */ | ||
167 | 76, 76, 76, 255, /* 8 - Dark Gray */ | ||
168 | 25, 25, 25, 255, /* 9 - Black */ | ||
169 | 102, 51, 51, 255, /* 10 - Brown */ | ||
170 | 178, 76, 153, 255, /* 11 - Pink */ | ||
171 | 153, 51, 153, 255, /* 12 - Purple */ | ||
172 | 229, 178, 51, 255, /* 13 - Gold */ | ||
173 | 153, 25, 25, 153, /* 14 - Clear Red */ | ||
174 | 255, 153, 76, 153, /* 15 - Clear Orange */ | ||
175 | 25, 102, 25, 153, /* 16 - Clear Green */ | ||
176 | 153, 178, 76, 153, /* 17 - Clear Light Green */ | ||
177 | 0, 0, 127, 153, /* 18 - Clear Blue */ | ||
178 | 51, 102, 229, 153, /* 19 - Clear Light Blue */ | ||
179 | 229, 229, 0, 153, /* 20 - Clear Yellow */ | ||
180 | 229, 229, 229, 153, /* 21 - Clear White */ | ||
181 | 127, 127, 127, 255, /* 22 - Light Gray */ | ||
182 | 204, 204, 178, 255, /* 23 - Tan */ | ||
183 | 153, 102, 102, 255, /* 24 - Light Brown */ | ||
184 | 229, 178, 229, 255, /* 25 - Light Pink */ | ||
185 | 25, 178, 204, 255, /* 26 - Turquoise */ | ||
186 | 204, 204, 204, 255, /* 27 - Silver */ | ||
187 | 51, 51, 51, 255, /* 28 - Edges */ | ||
188 | 229, 76, 102, 255, /* 29 - Selected */ | ||
189 | 102, 76, 229, 255}; /* 30 - Focused */ | ||
190 | |||
191 | G3DMaterial *material; | ||
192 | guint32 i; | ||
193 | |||
194 | for(i = 0; i < 31; i ++) | ||
195 | { | ||
196 | material = g3d_material_new(); | ||
197 | material->r = (G3DFloat)colors[i * 4 + 0] / 255.0; | ||
198 | material->g = (G3DFloat)colors[i * 4 + 1] / 255.0; | ||
199 | material->b = (G3DFloat)colors[i * 4 + 2] / 255.0; | ||
200 | material->a = (G3DFloat)colors[i * 4 + 3] / 255.0; | ||
201 | |||
202 | library->materials = g_slist_append(library->materials, material); | ||
203 | } | ||
204 | |||
205 | return TRUE; | ||
206 | } | ||
207 | |||
208 | guint8 leocad_library_convert_color(guint8 n) | ||
209 | { | ||
210 | static guint8 converted_colors[20] = | ||
211 | { 0,2,4,9,7,6,22,8,10,11,14,16,18,9,21,20,22,8,10,11 }; | ||
212 | |||
213 | if(n >= 20) | ||
214 | return 0; | ||
215 | |||
216 | return converted_colors[n]; | ||
217 | } | ||
218 | |||
219 | G3DMaterial *leocad_library_get_nth_material(LeoCadLibrary *library, guint8 n) | ||
220 | { | ||
221 | return g_slist_nth_data(library->materials, n); | ||
222 | } | ||
223 | |||
224 | G3DObject *leocad_library_get_piece(LeoCadLibrary *library, const gchar *name) | ||
225 | { | ||
226 | LeoCadPiece *piece; | ||
227 | G3DObject *stud; | ||
228 | G3DFace *face; | ||
229 | guint32 i, j, k, nconn, ngrp, ntex, ngrpconn, ncol, nx, color = 0; | ||
230 | guint16 grp_type; | ||
231 | G3DFloat scale = 100.0; | ||
232 | G3DFloat matrix[16]; | ||
233 | G3DStream *bin; | ||
234 | struct LeoCadConnection *connections; | ||
235 | |||
236 | piece = g_hash_table_lookup(library->pieces, name); | ||
237 | |||
238 | if(piece == NULL) | ||
239 | { | ||
240 | g_warning("LeoCAD: failed to load piece '%s'", name); | ||
241 | return NULL; | ||
242 | } | ||
243 | |||
244 | bin = library->pieces_bin; | ||
245 | |||
246 | if(piece->object == NULL) | ||
247 | { | ||
248 | piece->object = g_new0(G3DObject, 1); | ||
249 | piece->object->name = g_strdup(piece->description); | ||
250 | |||
251 | g3d_stream_seek(bin, piece->offset_bin, G_SEEK_SET); | ||
252 | piece->object->vertex_count = g3d_stream_read_int32_le(bin); | ||
253 | piece->object->vertex_data = g_new0(G3DFloat, | ||
254 | piece->object->vertex_count * 3); | ||
255 | |||
256 | if(piece->flags & LEOCAD_FLAG_PIECE_SMALL) | ||
257 | scale = 10000.0; | ||
258 | else if(piece->flags & LEOCAD_FLAG_PIECE_MEDIUM) | ||
259 | scale = 1000.0; | ||
260 | |||
261 | for(i = 0; i < piece->object->vertex_count; i ++) | ||
262 | { | ||
263 | piece->object->vertex_data[i * 3 + 0] = | ||
264 | leocad_read_scaled16(bin, scale); | ||
265 | piece->object->vertex_data[i * 3 + 1] = | ||
266 | leocad_read_scaled16(bin, scale); | ||
267 | piece->object->vertex_data[i * 3 + 2] = | ||
268 | leocad_read_scaled16(bin, scale); | ||
269 | } | ||
270 | #if DEBUG > 1 | ||
271 | g_debug("LeoCAD: piece '%s': flags 0x%02X", name, piece->flags); | ||
272 | #endif | ||
273 | |||
274 | #if DEBUG > 1 | ||
275 | g_debug("LeoCAD: piece '%s': %d vertices", | ||
276 | name, piece->object->vertex_count); | ||
277 | #endif | ||
278 | |||
279 | /* connections */ | ||
280 | nconn = g3d_stream_read_int16_le(bin); | ||
281 | #if DEBUG > 1 | ||
282 | g_debug("LeoCAD: piece '%s': %d connections", name, nconn); | ||
283 | #endif | ||
284 | connections = g_new0(struct LeoCadConnection, nconn); | ||
285 | for(i = 0; i < nconn; i ++) | ||
286 | { | ||
287 | connections[i].type = g3d_stream_read_int8(bin); | ||
288 | |||
289 | /* center */ | ||
290 | connections[i].center[0] = leocad_read_scaled16(bin, scale); | ||
291 | connections[i].center[1] = leocad_read_scaled16(bin, scale); | ||
292 | connections[i].center[2] = leocad_read_scaled16(bin, scale); | ||
293 | |||
294 | /* normal */ | ||
295 | connections[i].normal[0] = g3d_stream_read_int16_le(bin) / (1 << 14); | ||
296 | connections[i].normal[1] = g3d_stream_read_int16_le(bin) / (1 << 14); | ||
297 | connections[i].normal[2] = g3d_stream_read_int16_le(bin) / (1 << 14); | ||
298 | } | ||
299 | |||
300 | /* textures */ | ||
301 | ntex = g3d_stream_read_int8(bin); | ||
302 | #if DEBUG > 0 | ||
303 | if(ntex > 0) | ||
304 | g_debug("LeoCAD: piece '%s': %d textures", name, ntex); | ||
305 | #endif | ||
306 | for(i = 0; i < ntex; i ++) | ||
307 | { | ||
308 | /* TODO: */ | ||
309 | } | ||
310 | |||
311 | /* groups */ | ||
312 | ngrp = g3d_stream_read_int16_le(bin); | ||
313 | #if DEBUG > 1 | ||
314 | g_debug("LeoCAD: piece '%s': %d groups @ 0x%08lx", | ||
315 | name, ngrp, ftell(bin)); | ||
316 | #endif | ||
317 | for(i = 0; i < ngrp; i ++) | ||
318 | { | ||
319 | /* group connections */ | ||
320 | ngrpconn = g3d_stream_read_int8(bin); | ||
321 | for(j = 0; j < ngrpconn; j ++) | ||
322 | { | ||
323 | g3d_stream_read_int16_le(bin); | ||
324 | } | ||
325 | |||
326 | #if 0 | ||
327 | while(1) | ||
328 | { | ||
329 | #endif | ||
330 | grp_type = g3d_stream_read_int8(bin); | ||
331 | if(grp_type == 0) | ||
332 | { | ||
333 | break; | ||
334 | } | ||
335 | #if DEBUG > 1 | ||
336 | g_debug("LeoCAD: piece '%s': grp %d: type 0x%02x @ 0x%08lx", | ||
337 | name, i, grp_type, ftell(bin)); | ||
338 | #endif | ||
339 | |||
340 | switch(grp_type) | ||
341 | { | ||
342 | case LEOCAD_TYPE_MESH: | ||
343 | ncol = g3d_stream_read_int16_le(bin); | ||
344 | #if DEBUG > 1 | ||
345 | g_debug("LeoCAD: piece '%s': grp %d: %d colors " | ||
346 | "(@ 0x%08lx)", name, i, ncol, ftell(bin)); | ||
347 | #endif | ||
348 | for(j = 0; j < ncol; j ++) | ||
349 | { | ||
350 | /* color code */ | ||
351 | color = g3d_stream_read_int16_le(bin); | ||
352 | #if DEBUG > 1 | ||
353 | g_debug("LeoCAD: piece '%s': grp %d: color 0x%04x", | ||
354 | name, i, color); | ||
355 | #endif | ||
356 | /* quads? */ | ||
357 | nx = g3d_stream_read_int16_le(bin); | ||
358 | for(k = 0; k < nx / 4; k ++) | ||
359 | { | ||
360 | face = g_new0(G3DFace, 1); | ||
361 | face->material = | ||
362 | g_slist_nth_data( | ||
363 | library->materials, color); | ||
364 | face->vertex_count = 4; | ||
365 | face->vertex_indices = g_new0(guint32, 4); | ||
366 | |||
367 | face->vertex_indices[0] = | ||
368 | g3d_stream_read_int16_le(bin); | ||
369 | face->vertex_indices[1] = | ||
370 | g3d_stream_read_int16_le(bin); | ||
371 | face->vertex_indices[2] = | ||
372 | g3d_stream_read_int16_le(bin); | ||
373 | face->vertex_indices[3] = | ||
374 | g3d_stream_read_int16_le(bin); | ||
375 | |||
376 | piece->object->faces = g_slist_prepend( | ||
377 | piece->object->faces, face); | ||
378 | } | ||
379 | #if DEBUG > 1 | ||
380 | g_debug("LeoCAD: piece '%s': grp %d: " | ||
381 | "quads: %d bytes", name, i, nx * 2); | ||
382 | #endif | ||
383 | nx = g3d_stream_read_int16_le(bin); | ||
384 | for(k = 0; k < nx / 3; k ++) | ||
385 | { | ||
386 | face = g_new0(G3DFace, 1); | ||
387 | face->material = | ||
388 | g_slist_nth_data( | ||
389 | library->materials, color); | ||
390 | face->vertex_count = 3; | ||
391 | face->vertex_indices = g_new0(guint32, 3); | ||
392 | |||
393 | face->vertex_indices[0] = | ||
394 | g3d_stream_read_int16_le(bin); | ||
395 | face->vertex_indices[1] = | ||
396 | g3d_stream_read_int16_le(bin); | ||
397 | face->vertex_indices[2] = | ||
398 | g3d_stream_read_int16_le(bin); | ||
399 | |||
400 | piece->object->faces = g_slist_prepend( | ||
401 | piece->object->faces, face); | ||
402 | } | ||
403 | |||
404 | #if DEBUG > 1 | ||
405 | g_debug("LeoCAD: piece '%s': grp %d: " | ||
406 | "triangles: %d bytes", | ||
407 | name, i, nx * 2); | ||
408 | #endif | ||
409 | nx = g3d_stream_read_int16_le(bin); | ||
410 | #if DEBUG > 1 | ||
411 | g_debug("LeoCAD: piece '%s': grp %d: " | ||
412 | "skipping %d bytes @ 0x%08lx", | ||
413 | name, i, nx * 2, ftell(bin)); | ||
414 | #endif | ||
415 | g3d_stream_skip(bin, nx * 2); | ||
416 | } | ||
417 | break; | ||
418 | |||
419 | case LEOCAD_TYPE_STUD: | ||
420 | case LEOCAD_TYPE_STUD2: | ||
421 | case LEOCAD_TYPE_STUD3: | ||
422 | case LEOCAD_TYPE_STUD4: | ||
423 | stud = NULL; | ||
424 | color = g3d_stream_read_int8(bin); | ||
425 | #if DEBUG > 0 | ||
426 | g_debug("LeoCAD: piece '%s': stud 0x%02x", | ||
427 | name, grp_type); | ||
428 | #endif | ||
429 | if(grp_type == LEOCAD_TYPE_STUD4) | ||
430 | stud = g3d_primitive_tube( | ||
431 | 0.24, /* inner radius */ | ||
432 | 0.32, /* outer radius */ | ||
433 | 0.16, /* height */ | ||
434 | 16, /* sides */ | ||
435 | TRUE, FALSE, /* top, bottom */ | ||
436 | leocad_library_get_nth_material( | ||
437 | library, color)); | ||
438 | |||
439 | g3d_matrix_identity(matrix); | ||
440 | for(j = 0; j < 12; j ++) | ||
441 | #if 1 | ||
442 | matrix[(j / 3) * 4 + (j % 3)] = | ||
443 | g3d_stream_read_float_le(bin); | ||
444 | #else | ||
445 | matrix[j] = g3d_stream_read_float_le(bin); | ||
446 | #endif | ||
447 | /* g3d_matrix_dump(matrix); */ | ||
448 | |||
449 | if(stud && piece->object) | ||
450 | { | ||
451 | g3d_object_transform(stud, matrix); | ||
452 | g3d_object_merge(piece->object, stud); | ||
453 | stud = NULL; | ||
454 | } | ||
455 | |||
456 | break; | ||
457 | |||
458 | default: | ||
459 | #if DEBUG > 1 | ||
460 | g_debug( | ||
461 | "LeoCAD: piece '%s': unhandled group type 0x%02x " | ||
462 | "@ 0x%08lx", | ||
463 | name, grp_type, ftell(bin)); | ||
464 | #endif | ||
465 | break; | ||
466 | } /* grp_type */ | ||
467 | #if 0 | ||
468 | } /* grp_type != 0 */ | ||
469 | #endif | ||
470 | g3d_stream_read_int8(bin); | ||
471 | } /* ngrp */ | ||
472 | |||
473 | /* generate studs */ | ||
474 | for(i = 0; i < nconn; i ++) | ||
475 | { | ||
476 | #if DEBUG > 4 | ||
477 | g_debug("LeoCAD: connection %d: type 0x%02x", | ||
478 | i, connections[i].type); | ||
479 | #endif | ||
480 | |||
481 | switch(connections[i].type) | ||
482 | { | ||
483 | case 0: | ||
484 | stud = g3d_primitive_cylinder( | ||
485 | 0.24, /* radius */ | ||
486 | 0.16, /* height */ | ||
487 | 16, /* sides */ | ||
488 | TRUE, FALSE, /* top, bottom */ | ||
489 | leocad_library_get_nth_material(library, color)); | ||
490 | break; | ||
491 | |||
492 | case 2: | ||
493 | stud = g3d_primitive_tube( | ||
494 | 0.24, /* inner radius */ | ||
495 | 0.32, /* outer radius */ | ||
496 | 0.16, /* height */ | ||
497 | 16, /* sides */ | ||
498 | FALSE, TRUE, /* top, bottom */ | ||
499 | leocad_library_get_nth_material(library, color)); | ||
500 | break; | ||
501 | |||
502 | default: | ||
503 | stud = NULL; | ||
504 | break; | ||
505 | } | ||
506 | |||
507 | if(stud) | ||
508 | { | ||
509 | #if DEBUG > 5 | ||
510 | g_debug("LeoCAD: stud"); | ||
511 | #endif | ||
512 | /* transform stud */ | ||
513 | for(j = 0; j < stud->vertex_count; j ++) | ||
514 | { | ||
515 | #if 0 | ||
516 | g3d_vector_transform( | ||
517 | &(stud->vertices[j * 3 + 0]), | ||
518 | &(stud->vertices[j * 3 + 1]), | ||
519 | &(stud->vertices[j * 3 + 2]), | ||
520 | matrix); | ||
521 | #endif | ||
522 | |||
523 | stud->vertex_data[j * 3 + 0] += connections[i].center[0]; | ||
524 | stud->vertex_data[j * 3 + 1] += connections[i].center[1]; | ||
525 | stud->vertex_data[j * 3 + 2] += connections[i].center[2]; | ||
526 | } | ||
527 | |||
528 | /* merge stud */ | ||
529 | g3d_object_merge(piece->object, stud); | ||
530 | } /* stud */ | ||
531 | } /* nconn */ | ||
532 | |||
533 | if(connections) | ||
534 | g_free(connections); | ||
535 | } | ||
536 | |||
537 | return g3d_object_duplicate(piece->object); | ||
538 | } | ||
539 | |||
540 | static gboolean leocad_library_read_piece(LeoCadLibrary *library, | ||
541 | G3DStream *idx) | ||
542 | { | ||
543 | gchar buffer[128]; | ||
544 | guint32 i; | ||
545 | LeoCadPiece *piece; | ||
546 | |||
547 | piece = g_new0(LeoCadPiece, 1); | ||
548 | |||
549 | g3d_stream_read(idx, buffer, 8); | ||
550 | buffer[8] = '\0'; | ||
551 | piece->name = g_strdup(buffer); | ||
552 | |||
553 | g3d_stream_read(idx, buffer, 64); | ||
554 | buffer[64] = '\0'; | ||
555 | piece->description = g_strdup(buffer); | ||
556 | |||
557 | for(i = 0; i < 6; i ++) | ||
558 | piece->bounding_box[i] = g3d_stream_read_int16_le(idx); | ||
559 | |||
560 | piece->flags = g3d_stream_read_int8(idx); | ||
561 | piece->default_group = g3d_stream_read_int32_le(idx); | ||
562 | piece->offset_bin = g3d_stream_read_int32_le(idx); | ||
563 | piece->info_size = g3d_stream_read_int32_le(idx); | ||
564 | |||
565 | #if DEBUG > 1 | ||
566 | g_debug("LeoCAD: %-8s: @ 0x%08x, %s", | ||
567 | piece->name, piece->offset_bin, piece->description); | ||
568 | #endif | ||
569 | |||
570 | g_hash_table_insert(library->pieces, piece->name, piece); | ||
571 | |||
572 | return TRUE; | ||
573 | } | ||
574 | |||
575 | static gboolean leocad_library_read_pieces_idx(LeoCadLibrary *library, | ||
576 | G3DStream *idx) | ||
577 | { | ||
578 | gchar magic[32], nameold[9], namenew[9]; | ||
579 | guint8 version, lastupdate; | ||
580 | guint32 nmoved, nbinsize, npieces, i; | ||
581 | LeoCadPiece *piece, *newpiece; | ||
582 | |||
583 | g3d_stream_read(idx, magic, 32); | ||
584 | if(strncmp(magic, "LeoCAD piece library index file", 31) != 0) | ||
585 | { | ||
586 | g_debug("LeoCAD: pieces.idx: wrong magic"); | ||
587 | return FALSE; | ||
588 | } | ||
589 | |||
590 | version = g3d_stream_read_int8(idx); | ||
591 | lastupdate = g3d_stream_read_int8(idx); | ||
592 | |||
593 | g3d_stream_seek(idx, -8, G_SEEK_END); | ||
594 | nmoved = g3d_stream_read_int16_le(idx); | ||
595 | nbinsize = g3d_stream_read_int32_le(idx); | ||
596 | npieces = g3d_stream_read_int16_le(idx); | ||
597 | |||
598 | g3d_stream_seek(idx, 34, G_SEEK_SET); | ||
599 | |||
600 | #if DEBUG > 0 | ||
601 | g_debug("LeoCAD: pieces.idx: version %d, last update %d", | ||
602 | version, lastupdate); | ||
603 | g_debug("LeoCAD: pieces.idx: %d pieces, %d moves, pieces.bin %d bytes", | ||
604 | npieces, nmoved, nbinsize); | ||
605 | #endif | ||
606 | |||
607 | for(i = 0; i < npieces; i ++) | ||
608 | leocad_library_read_piece(library, idx); | ||
609 | |||
610 | for(i = 0; i < nmoved; i ++) { | ||
611 | memset(nameold, 0, 9); | ||
612 | memset(namenew, 0, 9); | ||
613 | |||
614 | g3d_stream_read(idx, nameold, 8); | ||
615 | g3d_stream_read(idx, namenew, 8); | ||
616 | |||
617 | piece = g_hash_table_lookup(library->pieces, namenew); | ||
618 | if(piece) { | ||
619 | newpiece = g_new0(LeoCadPiece, 1); | ||
620 | memcpy(newpiece, piece, sizeof(LeoCadPiece)); | ||
621 | newpiece->name = g_strdup(nameold); | ||
622 | newpiece->description = g_strdup(piece->description); | ||
623 | newpiece->moved_to = g_strdup(namenew); | ||
624 | newpiece->object = piece->object; | ||
625 | newpiece->flags |= LEOCAD_FLAG_PIECE_RENAMED; | ||
626 | |||
627 | g_hash_table_insert(library->pieces, piece->name, newpiece); | ||
628 | } | ||
629 | } | ||
630 | |||
631 | return TRUE; | ||
632 | } | ||
633 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad_library.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad_library.h new file mode 100644 index 0000000..ac7299e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_leocad/imp_leocad_library.h | |||
@@ -0,0 +1,62 @@ | |||
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 | |||
23 | #ifndef IMP_LEOCAD_LIBRARY_H | ||
24 | #define IMP_LEOCAD_LIBRARY_H | ||
25 | |||
26 | #include <stdio.h> | ||
27 | |||
28 | #include <g3d/types.h> | ||
29 | #include <g3d/stream.h> | ||
30 | |||
31 | typedef struct | ||
32 | { | ||
33 | gchar *name; | ||
34 | gchar *description; | ||
35 | gchar *moved_to; | ||
36 | |||
37 | guint16 bounding_box[6]; | ||
38 | guint8 flags; | ||
39 | guint32 default_group; | ||
40 | guint32 offset_bin; | ||
41 | guint32 info_size; | ||
42 | |||
43 | G3DObject *object; | ||
44 | } | ||
45 | LeoCadPiece; | ||
46 | |||
47 | typedef struct | ||
48 | { | ||
49 | G3DStream *pieces_bin; | ||
50 | GHashTable *pieces; | ||
51 | GSList *materials; | ||
52 | } | ||
53 | LeoCadLibrary; | ||
54 | |||
55 | LeoCadLibrary *leocad_library_load(const gchar *libdir); | ||
56 | void leocad_library_free(LeoCadLibrary *library); | ||
57 | guint8 leocad_library_convert_color(guint8 n); | ||
58 | G3DObject *leocad_library_get_piece(LeoCadLibrary *library, const gchar *name); | ||
59 | G3DMaterial *leocad_library_get_nth_material(LeoCadLibrary *library, guint8 n); | ||
60 | |||
61 | #endif /* IMP_LEOCAD_LIBRARY_H */ | ||
62 | |||