aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile519
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.am24
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.in519
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw.c112
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.c124
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.h30
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.c175
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.h32
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_misc.h36
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.c121
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.h33
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.c291
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.h31
-rw-r--r--src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_types.h48
14 files changed, 2095 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile
new file mode 100644
index 0000000..f57ae4d
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile
@@ -0,0 +1,519 @@
1# Makefile.in generated by automake 1.10.1 from Makefile.am.
2# plugins/import/imp_ldraw/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
18pkgdatadir = $(datadir)/libg3d
19pkglibdir = $(libdir)/libg3d
20pkgincludedir = $(includedir)/libg3d
21am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22install_sh_DATA = $(install_sh) -c -m 644
23install_sh_PROGRAM = $(install_sh) -c
24install_sh_SCRIPT = $(install_sh) -c
25INSTALL_HEADER = $(INSTALL_DATA)
26transform = $(program_transform_name)
27NORMAL_INSTALL = :
28PRE_INSTALL = :
29POST_INSTALL = :
30NORMAL_UNINSTALL = :
31PRE_UNINSTALL = :
32POST_UNINSTALL = :
33build_triplet = x86_64-unknown-linux-gnu
34host_triplet = x86_64-unknown-linux-gnu
35subdir = plugins/import/imp_ldraw
36DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38am__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
43am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45mkinstalldirs = $(install_sh) -d
46CONFIG_HEADER = $(top_builddir)/include/g3d/config.h
47CONFIG_CLEAN_FILES =
48am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
49am__vpath_adj = case $$p in \
50 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
51 *) f=$$p;; \
52 esac;
53am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
54am__installdirs = "$(DESTDIR)$(pluginimpdir)"
55pluginimpLTLIBRARIES_INSTALL = $(INSTALL)
56LTLIBRARIES = $(pluginimp_LTLIBRARIES)
57imp_ldraw_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la
58am_imp_ldraw_la_OBJECTS = imp_ldraw.lo imp_ldraw_part.lo \
59 imp_ldraw_library.lo imp_ldraw_color.lo imp_ldraw_mpd.lo
60imp_ldraw_la_OBJECTS = $(am_imp_ldraw_la_OBJECTS)
61DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d
62depcomp = $(SHELL) $(top_srcdir)/config/depcomp
63am__depfiles_maybe = depfiles
64COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
65 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
66LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
67 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
68 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
69CCLD = $(CC)
70LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
71 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
72 $(LDFLAGS) -o $@
73SOURCES = $(imp_ldraw_la_SOURCES)
74DIST_SOURCES = $(imp_ldraw_la_SOURCES)
75ETAGS = etags
76CTAGS = ctags
77DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
78ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10
79AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar
80AR = ar
81AS = as
82AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf
83AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader
84AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10
85AWK = gawk
86CC = gcc
87CCDEPMODE = depmode=gcc3
88CFLAGS = -g -O2
89CPP = gcc -E
90CPPFLAGS =
91CXX = g++
92CXXCPP = g++ -E
93CXXDEPMODE = depmode=gcc3
94CXXFLAGS = -g -O2
95CYGPATH_W = echo
96DBG_CFLAGS = -O2
97DEBUG = 0
98DEFS = -DHAVE_CONFIG_H
99DEPDIR = .deps
100DLLTOOL = dlltool
101ECHO = echo
102ECHO_C =
103ECHO_N = -n
104ECHO_T =
105EGREP = /bin/grep -E
106EXEEXT =
107F77 =
108FFLAGS =
109GDKPIXBUF_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
110GDKPIXBUF_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
111GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
112GLIB_GENMARSHAL = glib-genmarshal
113GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
114GLIB_MKENUMS = glib-mkenums
115GOBJECT_QUERY = gobject-query
116GREP = /bin/grep
117GTKDOC_CHECK = /usr/bin/gtkdoc-check
118GTK_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
119GTK_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
120HTML_DIR = ${datadir}/gtk-doc/html
121INSTALL = /usr/bin/install -c
122INSTALL_DATA = ${INSTALL} -m 644
123INSTALL_PROGRAM = ${INSTALL}
124INSTALL_SCRIPT = ${INSTALL}
125INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
126LDFLAGS =
127LEX = flex
128LEXLIB = -lfl
129LEX_OUTPUT_ROOT = lex.yy
130LIBGSF_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
131LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0
132LIBOBJS =
133LIBS = -lm
134LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet
135LIBXML2_CFLAGS = -I/usr/include/libxml2
136LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2
137LN_S = ln -s
138LTLIBOBJS =
139LTVERSION = 0:8:0
140MAGIC_LIBS = -lmagic
141MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo
142MATH_LIBS = -lm
143MKDIR_P = /bin/mkdir -p
144OBJDUMP = objdump
145OBJEXT = o
146PACKAGE = libg3d
147PACKAGE_BUGREPORT =
148PACKAGE_NAME =
149PACKAGE_STRING =
150PACKAGE_TARNAME =
151PACKAGE_VERSION =
152PATH_SEPARATOR = :
153PKG_CONFIG = /usr/bin/pkg-config
154PLUGINS_LDFLAGS = -avoid-version -export-dynamic
155RANLIB = ranlib
156SET_MAKE =
157SHELL = /bin/bash
158STRIP = strip
159VERSION = 0.0.8
160XML2_CONFIG = /usr/bin/xml2-config
161XML_CPPFLAGS = -I/usr/include/libxml2
162XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2
163Z_CFLAGS =
164Z_LIBS = -lz
165abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw
166abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw
167abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8
168abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8
169ac_ct_CC = gcc
170ac_ct_CXX = g++
171ac_ct_F77 =
172am__include = include
173am__leading_dot = .
174am__quote =
175am__tar = ${AMTAR} chof - "$$tardir"
176am__untar = ${AMTAR} xf -
177bindir = ${exec_prefix}/bin
178build = x86_64-unknown-linux-gnu
179build_alias =
180build_cpu = x86_64
181build_os = linux-gnu
182build_vendor = unknown
183builddir = .
184datadir = ${datarootdir}
185datarootdir = ${prefix}/share
186docdir = ${datarootdir}/doc/${PACKAGE}
187dvidir = ${docdir}
188exec_prefix = ${prefix}
189host = x86_64-unknown-linux-gnu
190host_alias =
191host_cpu = x86_64
192host_os = linux-gnu
193host_vendor = unknown
194htmldir = ${docdir}
195includedir = ${prefix}/include
196infodir = ${datarootdir}/info
197install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh
198libdir = ${exec_prefix}/lib
199libexecdir = ${exec_prefix}/libexec
200localedir = ${datarootdir}/locale
201localstatedir = ${prefix}/var
202mandir = ${datarootdir}/man
203mkdir_p = /bin/mkdir -p
204oldincludedir = /usr/include
205pdfdir = ${docdir}
206prefix = /usr/local
207program_transform_name = s,x,x,
208psdir = ${docdir}
209sbindir = ${exec_prefix}/sbin
210sharedstatedir = ${prefix}/com
211srcdir = .
212sysconfdir = ${prefix}/etc
213target_alias =
214top_builddir = ../../..
215top_srcdir = ../../..
216pluginimpdir = $(pkglibdir)/plugins/import
217pluginimp_LTLIBRARIES = imp_ldraw.la
218AM_CFLAGS = \
219 -Wall -ansi -pedantic \
220 -DG_LOG_DOMAIN=\"LibG3D\" \
221 -O2 -DDEBUG=0 \
222 -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
223
224INCLUDES = -I$(top_srcdir)/include
225AM_LDFLAGS = \
226 -no-undefined -module \
227 -avoid-version -export-dynamic
228
229imp_ldraw_la_SOURCES = imp_ldraw.c imp_ldraw_misc.h imp_ldraw_types.h \
230 imp_ldraw_part.c imp_ldraw_part.h \
231 imp_ldraw_library.c imp_ldraw_library.h \
232 imp_ldraw_color.c imp_ldraw_color.h \
233 imp_ldraw_mpd.c imp_ldraw_mpd.h
234
235imp_ldraw_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
236all: all-am
237
238.SUFFIXES:
239.SUFFIXES: .c .lo .o .obj
240$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
241 @for dep in $?; do \
242 case '$(am__configure_deps)' in \
243 *$$dep*) \
244 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
245 && exit 0; \
246 exit 1;; \
247 esac; \
248 done; \
249 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_ldraw/Makefile'; \
250 cd $(top_srcdir) && \
251 $(AUTOMAKE) --gnu plugins/import/imp_ldraw/Makefile
252.PRECIOUS: Makefile
253Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
254 @case '$?' in \
255 *config.status*) \
256 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
257 *) \
258 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
259 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
260 esac;
261
262$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
263 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
264
265$(top_srcdir)/configure: $(am__configure_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267$(ACLOCAL_M4): $(am__aclocal_m4_deps)
268 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
269install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES)
270 @$(NORMAL_INSTALL)
271 test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)"
272 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
273 if test -f $$p; then \
274 f=$(am__strip_dir) \
275 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \
276 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \
277 else :; fi; \
278 done
279
280uninstall-pluginimpLTLIBRARIES:
281 @$(NORMAL_UNINSTALL)
282 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
283 p=$(am__strip_dir) \
284 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \
285 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \
286 done
287
288clean-pluginimpLTLIBRARIES:
289 -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES)
290 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
291 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
292 test "$$dir" != "$$p" || dir=.; \
293 echo "rm -f \"$${dir}/so_locations\""; \
294 rm -f "$${dir}/so_locations"; \
295 done
296imp_ldraw.la: $(imp_ldraw_la_OBJECTS) $(imp_ldraw_la_DEPENDENCIES)
297 $(LINK) -rpath $(pluginimpdir) $(imp_ldraw_la_OBJECTS) $(imp_ldraw_la_LIBADD) $(LIBS)
298
299mostlyclean-compile:
300 -rm -f *.$(OBJEXT)
301
302distclean-compile:
303 -rm -f *.tab.c
304
305include ./$(DEPDIR)/imp_ldraw.Plo
306include ./$(DEPDIR)/imp_ldraw_color.Plo
307include ./$(DEPDIR)/imp_ldraw_library.Plo
308include ./$(DEPDIR)/imp_ldraw_mpd.Plo
309include ./$(DEPDIR)/imp_ldraw_part.Plo
310
311.c.o:
312 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
313 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
314# source='$<' object='$@' libtool=no \
315# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
316# $(COMPILE) -c $<
317
318.c.obj:
319 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
320 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
321# source='$<' object='$@' libtool=no \
322# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
323# $(COMPILE) -c `$(CYGPATH_W) '$<'`
324
325.c.lo:
326 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
327 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
328# source='$<' object='$@' libtool=yes \
329# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
330# $(LTCOMPILE) -c -o $@ $<
331
332mostlyclean-libtool:
333 -rm -f *.lo
334
335clean-libtool:
336 -rm -rf .libs _libs
337
338ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
339 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
340 unique=`for i in $$list; do \
341 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
342 done | \
343 $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
344 END { if (nonempty) { for (i in files) print i; }; }'`; \
345 mkid -fID $$unique
346tags: TAGS
347
348TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
349 $(TAGS_FILES) $(LISP)
350 tags=; \
351 here=`pwd`; \
352 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
353 unique=`for i in $$list; do \
354 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
355 done | \
356 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
357 END { if (nonempty) { for (i in files) print i; }; }'`; \
358 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
359 test -n "$$unique" || unique=$$empty_fix; \
360 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
361 $$tags $$unique; \
362 fi
363ctags: CTAGS
364CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
365 $(TAGS_FILES) $(LISP)
366 tags=; \
367 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
368 unique=`for i in $$list; do \
369 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
370 done | \
371 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
372 END { if (nonempty) { for (i in files) print i; }; }'`; \
373 test -z "$(CTAGS_ARGS)$$tags$$unique" \
374 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
375 $$tags $$unique
376
377GTAGS:
378 here=`$(am__cd) $(top_builddir) && pwd` \
379 && cd $(top_srcdir) \
380 && gtags -i $(GTAGS_ARGS) $$here
381
382distclean-tags:
383 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
384
385distdir: $(DISTFILES)
386 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
387 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
388 list='$(DISTFILES)'; \
389 dist_files=`for file in $$list; do echo $$file; done | \
390 sed -e "s|^$$srcdirstrip/||;t" \
391 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
392 case $$dist_files in \
393 */*) $(MKDIR_P) `echo "$$dist_files" | \
394 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
395 sort -u` ;; \
396 esac; \
397 for file in $$dist_files; do \
398 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
399 if test -d $$d/$$file; then \
400 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
401 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
402 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
403 fi; \
404 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
405 else \
406 test -f $(distdir)/$$file \
407 || cp -p $$d/$$file $(distdir)/$$file \
408 || exit 1; \
409 fi; \
410 done
411check-am: all-am
412check: check-am
413all-am: Makefile $(LTLIBRARIES)
414installdirs:
415 for dir in "$(DESTDIR)$(pluginimpdir)"; do \
416 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
417 done
418install: install-am
419install-exec: install-exec-am
420install-data: install-data-am
421uninstall: uninstall-am
422
423install-am: all-am
424 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
425
426installcheck: installcheck-am
427install-strip:
428 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
429 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
430 `test -z '$(STRIP)' || \
431 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
432mostlyclean-generic:
433
434clean-generic:
435
436distclean-generic:
437 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
438
439maintainer-clean-generic:
440 @echo "This command is intended for maintainers to use"
441 @echo "it deletes files that may require special tools to rebuild."
442clean: clean-am
443
444clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \
445 mostlyclean-am
446
447distclean: distclean-am
448 -rm -rf ./$(DEPDIR)
449 -rm -f Makefile
450distclean-am: clean-am distclean-compile distclean-generic \
451 distclean-tags
452
453dvi: dvi-am
454
455dvi-am:
456
457html: html-am
458
459info: info-am
460
461info-am:
462
463install-data-am: install-pluginimpLTLIBRARIES
464
465install-dvi: install-dvi-am
466
467install-exec-am:
468
469install-html: install-html-am
470
471install-info: install-info-am
472
473install-man:
474
475install-pdf: install-pdf-am
476
477install-ps: install-ps-am
478
479installcheck-am:
480
481maintainer-clean: maintainer-clean-am
482 -rm -rf ./$(DEPDIR)
483 -rm -f Makefile
484maintainer-clean-am: distclean-am maintainer-clean-generic
485
486mostlyclean: mostlyclean-am
487
488mostlyclean-am: mostlyclean-compile mostlyclean-generic \
489 mostlyclean-libtool
490
491pdf: pdf-am
492
493pdf-am:
494
495ps: ps-am
496
497ps-am:
498
499uninstall-am: uninstall-pluginimpLTLIBRARIES
500
501.MAKE: install-am install-strip
502
503.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
504 clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \
505 distclean-compile distclean-generic distclean-libtool \
506 distclean-tags distdir dvi dvi-am html html-am info info-am \
507 install install-am install-data install-data-am install-dvi \
508 install-dvi-am install-exec install-exec-am install-html \
509 install-html-am install-info install-info-am install-man \
510 install-pdf install-pdf-am install-pluginimpLTLIBRARIES \
511 install-ps install-ps-am install-strip installcheck \
512 installcheck-am installdirs maintainer-clean \
513 maintainer-clean-generic mostlyclean mostlyclean-compile \
514 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
515 tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES
516
517# Tell versions [3.59,3.63) of GNU make to not export all variables.
518# Otherwise a system limit (for SysV at least) may be exceeded.
519.NOEXPORT:
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.am
new file mode 100644
index 0000000..f27cd09
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.am
@@ -0,0 +1,24 @@
1pluginimpdir = $(pkglibdir)/plugins/import
2
3pluginimp_LTLIBRARIES = imp_ldraw.la
4
5AM_CFLAGS = \
6 -Wall -ansi -pedantic \
7 -DG_LOG_DOMAIN=\"LibG3D\" \
8 @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \
9 @GLIB_CFLAGS@
10
11INCLUDES = -I$(top_srcdir)/include
12
13AM_LDFLAGS = \
14 -no-undefined -module \
15 @PLUGINS_LDFLAGS@
16
17LIBTOOL += --quiet
18
19imp_ldraw_la_SOURCES = imp_ldraw.c imp_ldraw_misc.h imp_ldraw_types.h \
20 imp_ldraw_part.c imp_ldraw_part.h \
21 imp_ldraw_library.c imp_ldraw_library.h \
22 imp_ldraw_color.c imp_ldraw_color.h \
23 imp_ldraw_mpd.c imp_ldraw_mpd.h
24imp_ldraw_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.in
new file mode 100644
index 0000000..94985b2
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/Makefile.in
@@ -0,0 +1,519 @@
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
17VPATH = @srcdir@
18pkgdatadir = $(datadir)/@PACKAGE@
19pkglibdir = $(libdir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22install_sh_DATA = $(install_sh) -c -m 644
23install_sh_PROGRAM = $(install_sh) -c
24install_sh_SCRIPT = $(install_sh) -c
25INSTALL_HEADER = $(INSTALL_DATA)
26transform = $(program_transform_name)
27NORMAL_INSTALL = :
28PRE_INSTALL = :
29POST_INSTALL = :
30NORMAL_UNINSTALL = :
31PRE_UNINSTALL = :
32POST_UNINSTALL = :
33build_triplet = @build@
34host_triplet = @host@
35subdir = plugins/import/imp_ldraw
36DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38am__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
43am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45mkinstalldirs = $(install_sh) -d
46CONFIG_HEADER = $(top_builddir)/include/g3d/config.h
47CONFIG_CLEAN_FILES =
48am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
49am__vpath_adj = case $$p in \
50 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
51 *) f=$$p;; \
52 esac;
53am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
54am__installdirs = "$(DESTDIR)$(pluginimpdir)"
55pluginimpLTLIBRARIES_INSTALL = $(INSTALL)
56LTLIBRARIES = $(pluginimp_LTLIBRARIES)
57imp_ldraw_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la
58am_imp_ldraw_la_OBJECTS = imp_ldraw.lo imp_ldraw_part.lo \
59 imp_ldraw_library.lo imp_ldraw_color.lo imp_ldraw_mpd.lo
60imp_ldraw_la_OBJECTS = $(am_imp_ldraw_la_OBJECTS)
61DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d
62depcomp = $(SHELL) $(top_srcdir)/config/depcomp
63am__depfiles_maybe = depfiles
64COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
65 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
66LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
67 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
68 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
69CCLD = $(CC)
70LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
71 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
72 $(LDFLAGS) -o $@
73SOURCES = $(imp_ldraw_la_SOURCES)
74DIST_SOURCES = $(imp_ldraw_la_SOURCES)
75ETAGS = etags
76CTAGS = ctags
77DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
78ACLOCAL = @ACLOCAL@
79AMTAR = @AMTAR@
80AR = @AR@
81AS = @AS@
82AUTOCONF = @AUTOCONF@
83AUTOHEADER = @AUTOHEADER@
84AUTOMAKE = @AUTOMAKE@
85AWK = @AWK@
86CC = @CC@
87CCDEPMODE = @CCDEPMODE@
88CFLAGS = @CFLAGS@
89CPP = @CPP@
90CPPFLAGS = @CPPFLAGS@
91CXX = @CXX@
92CXXCPP = @CXXCPP@
93CXXDEPMODE = @CXXDEPMODE@
94CXXFLAGS = @CXXFLAGS@
95CYGPATH_W = @CYGPATH_W@
96DBG_CFLAGS = @DBG_CFLAGS@
97DEBUG = @DEBUG@
98DEFS = @DEFS@
99DEPDIR = @DEPDIR@
100DLLTOOL = @DLLTOOL@
101ECHO = @ECHO@
102ECHO_C = @ECHO_C@
103ECHO_N = @ECHO_N@
104ECHO_T = @ECHO_T@
105EGREP = @EGREP@
106EXEEXT = @EXEEXT@
107F77 = @F77@
108FFLAGS = @FFLAGS@
109GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
110GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
111GLIB_CFLAGS = @GLIB_CFLAGS@
112GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
113GLIB_LIBS = @GLIB_LIBS@
114GLIB_MKENUMS = @GLIB_MKENUMS@
115GOBJECT_QUERY = @GOBJECT_QUERY@
116GREP = @GREP@
117GTKDOC_CHECK = @GTKDOC_CHECK@
118GTK_CFLAGS = @GTK_CFLAGS@
119GTK_LIBS = @GTK_LIBS@
120HTML_DIR = @HTML_DIR@
121INSTALL = @INSTALL@
122INSTALL_DATA = @INSTALL_DATA@
123INSTALL_PROGRAM = @INSTALL_PROGRAM@
124INSTALL_SCRIPT = @INSTALL_SCRIPT@
125INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
126LDFLAGS = @LDFLAGS@
127LEX = @LEX@
128LEXLIB = @LEXLIB@
129LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
130LIBGSF_CFLAGS = @LIBGSF_CFLAGS@
131LIBGSF_LIBS = @LIBGSF_LIBS@
132LIBOBJS = @LIBOBJS@
133LIBS = @LIBS@
134LIBTOOL = @LIBTOOL@ --quiet
135LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
136LIBXML2_LIBS = @LIBXML2_LIBS@
137LN_S = @LN_S@
138LTLIBOBJS = @LTLIBOBJS@
139LTVERSION = @LTVERSION@
140MAGIC_LIBS = @MAGIC_LIBS@
141MAKEINFO = @MAKEINFO@
142MATH_LIBS = @MATH_LIBS@
143MKDIR_P = @MKDIR_P@
144OBJDUMP = @OBJDUMP@
145OBJEXT = @OBJEXT@
146PACKAGE = @PACKAGE@
147PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
148PACKAGE_NAME = @PACKAGE_NAME@
149PACKAGE_STRING = @PACKAGE_STRING@
150PACKAGE_TARNAME = @PACKAGE_TARNAME@
151PACKAGE_VERSION = @PACKAGE_VERSION@
152PATH_SEPARATOR = @PATH_SEPARATOR@
153PKG_CONFIG = @PKG_CONFIG@
154PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@
155RANLIB = @RANLIB@
156SET_MAKE = @SET_MAKE@
157SHELL = @SHELL@
158STRIP = @STRIP@
159VERSION = @VERSION@
160XML2_CONFIG = @XML2_CONFIG@
161XML_CPPFLAGS = @XML_CPPFLAGS@
162XML_LIBS = @XML_LIBS@
163Z_CFLAGS = @Z_CFLAGS@
164Z_LIBS = @Z_LIBS@
165abs_builddir = @abs_builddir@
166abs_srcdir = @abs_srcdir@
167abs_top_builddir = @abs_top_builddir@
168abs_top_srcdir = @abs_top_srcdir@
169ac_ct_CC = @ac_ct_CC@
170ac_ct_CXX = @ac_ct_CXX@
171ac_ct_F77 = @ac_ct_F77@
172am__include = @am__include@
173am__leading_dot = @am__leading_dot@
174am__quote = @am__quote@
175am__tar = @am__tar@
176am__untar = @am__untar@
177bindir = @bindir@
178build = @build@
179build_alias = @build_alias@
180build_cpu = @build_cpu@
181build_os = @build_os@
182build_vendor = @build_vendor@
183builddir = @builddir@
184datadir = @datadir@
185datarootdir = @datarootdir@
186docdir = @docdir@
187dvidir = @dvidir@
188exec_prefix = @exec_prefix@
189host = @host@
190host_alias = @host_alias@
191host_cpu = @host_cpu@
192host_os = @host_os@
193host_vendor = @host_vendor@
194htmldir = @htmldir@
195includedir = @includedir@
196infodir = @infodir@
197install_sh = @install_sh@
198libdir = @libdir@
199libexecdir = @libexecdir@
200localedir = @localedir@
201localstatedir = @localstatedir@
202mandir = @mandir@
203mkdir_p = @mkdir_p@
204oldincludedir = @oldincludedir@
205pdfdir = @pdfdir@
206prefix = @prefix@
207program_transform_name = @program_transform_name@
208psdir = @psdir@
209sbindir = @sbindir@
210sharedstatedir = @sharedstatedir@
211srcdir = @srcdir@
212sysconfdir = @sysconfdir@
213target_alias = @target_alias@
214top_builddir = @top_builddir@
215top_srcdir = @top_srcdir@
216pluginimpdir = $(pkglibdir)/plugins/import
217pluginimp_LTLIBRARIES = imp_ldraw.la
218AM_CFLAGS = \
219 -Wall -ansi -pedantic \
220 -DG_LOG_DOMAIN=\"LibG3D\" \
221 @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \
222 @GLIB_CFLAGS@
223
224INCLUDES = -I$(top_srcdir)/include
225AM_LDFLAGS = \
226 -no-undefined -module \
227 @PLUGINS_LDFLAGS@
228
229imp_ldraw_la_SOURCES = imp_ldraw.c imp_ldraw_misc.h imp_ldraw_types.h \
230 imp_ldraw_part.c imp_ldraw_part.h \
231 imp_ldraw_library.c imp_ldraw_library.h \
232 imp_ldraw_color.c imp_ldraw_color.h \
233 imp_ldraw_mpd.c imp_ldraw_mpd.h
234
235imp_ldraw_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@
236all: all-am
237
238.SUFFIXES:
239.SUFFIXES: .c .lo .o .obj
240$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
241 @for dep in $?; do \
242 case '$(am__configure_deps)' in \
243 *$$dep*) \
244 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
245 && exit 0; \
246 exit 1;; \
247 esac; \
248 done; \
249 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/import/imp_ldraw/Makefile'; \
250 cd $(top_srcdir) && \
251 $(AUTOMAKE) --gnu plugins/import/imp_ldraw/Makefile
252.PRECIOUS: Makefile
253Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
254 @case '$?' in \
255 *config.status*) \
256 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
257 *) \
258 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
259 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
260 esac;
261
262$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
263 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
264
265$(top_srcdir)/configure: $(am__configure_deps)
266 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
267$(ACLOCAL_M4): $(am__aclocal_m4_deps)
268 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
269install-pluginimpLTLIBRARIES: $(pluginimp_LTLIBRARIES)
270 @$(NORMAL_INSTALL)
271 test -z "$(pluginimpdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimpdir)"
272 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
273 if test -f $$p; then \
274 f=$(am__strip_dir) \
275 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimpdir)/$$f'"; \
276 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimpLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimpdir)/$$f"; \
277 else :; fi; \
278 done
279
280uninstall-pluginimpLTLIBRARIES:
281 @$(NORMAL_UNINSTALL)
282 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
283 p=$(am__strip_dir) \
284 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimpdir)/$$p'"; \
285 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimpdir)/$$p"; \
286 done
287
288clean-pluginimpLTLIBRARIES:
289 -test -z "$(pluginimp_LTLIBRARIES)" || rm -f $(pluginimp_LTLIBRARIES)
290 @list='$(pluginimp_LTLIBRARIES)'; for p in $$list; do \
291 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
292 test "$$dir" != "$$p" || dir=.; \
293 echo "rm -f \"$${dir}/so_locations\""; \
294 rm -f "$${dir}/so_locations"; \
295 done
296imp_ldraw.la: $(imp_ldraw_la_OBJECTS) $(imp_ldraw_la_DEPENDENCIES)
297 $(LINK) -rpath $(pluginimpdir) $(imp_ldraw_la_OBJECTS) $(imp_ldraw_la_LIBADD) $(LIBS)
298
299mostlyclean-compile:
300 -rm -f *.$(OBJEXT)
301
302distclean-compile:
303 -rm -f *.tab.c
304
305@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_ldraw.Plo@am__quote@
306@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_ldraw_color.Plo@am__quote@
307@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_ldraw_library.Plo@am__quote@
308@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_ldraw_mpd.Plo@am__quote@
309@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imp_ldraw_part.Plo@am__quote@
310
311.c.o:
312@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
313@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
314@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
315@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
316@am__fastdepCC_FALSE@ $(COMPILE) -c $<
317
318.c.obj:
319@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
320@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
321@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
322@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
323@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
324
325.c.lo:
326@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
327@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
328@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
329@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
330@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
331
332mostlyclean-libtool:
333 -rm -f *.lo
334
335clean-libtool:
336 -rm -rf .libs _libs
337
338ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
339 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
340 unique=`for i in $$list; do \
341 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
342 done | \
343 $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
344 END { if (nonempty) { for (i in files) print i; }; }'`; \
345 mkid -fID $$unique
346tags: TAGS
347
348TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
349 $(TAGS_FILES) $(LISP)
350 tags=; \
351 here=`pwd`; \
352 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
353 unique=`for i in $$list; do \
354 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
355 done | \
356 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
357 END { if (nonempty) { for (i in files) print i; }; }'`; \
358 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
359 test -n "$$unique" || unique=$$empty_fix; \
360 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
361 $$tags $$unique; \
362 fi
363ctags: CTAGS
364CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
365 $(TAGS_FILES) $(LISP)
366 tags=; \
367 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
368 unique=`for i in $$list; do \
369 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
370 done | \
371 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
372 END { if (nonempty) { for (i in files) print i; }; }'`; \
373 test -z "$(CTAGS_ARGS)$$tags$$unique" \
374 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
375 $$tags $$unique
376
377GTAGS:
378 here=`$(am__cd) $(top_builddir) && pwd` \
379 && cd $(top_srcdir) \
380 && gtags -i $(GTAGS_ARGS) $$here
381
382distclean-tags:
383 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
384
385distdir: $(DISTFILES)
386 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
387 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
388 list='$(DISTFILES)'; \
389 dist_files=`for file in $$list; do echo $$file; done | \
390 sed -e "s|^$$srcdirstrip/||;t" \
391 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
392 case $$dist_files in \
393 */*) $(MKDIR_P) `echo "$$dist_files" | \
394 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
395 sort -u` ;; \
396 esac; \
397 for file in $$dist_files; do \
398 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
399 if test -d $$d/$$file; then \
400 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
401 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
402 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
403 fi; \
404 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
405 else \
406 test -f $(distdir)/$$file \
407 || cp -p $$d/$$file $(distdir)/$$file \
408 || exit 1; \
409 fi; \
410 done
411check-am: all-am
412check: check-am
413all-am: Makefile $(LTLIBRARIES)
414installdirs:
415 for dir in "$(DESTDIR)$(pluginimpdir)"; do \
416 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
417 done
418install: install-am
419install-exec: install-exec-am
420install-data: install-data-am
421uninstall: uninstall-am
422
423install-am: all-am
424 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
425
426installcheck: installcheck-am
427install-strip:
428 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
429 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
430 `test -z '$(STRIP)' || \
431 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
432mostlyclean-generic:
433
434clean-generic:
435
436distclean-generic:
437 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
438
439maintainer-clean-generic:
440 @echo "This command is intended for maintainers to use"
441 @echo "it deletes files that may require special tools to rebuild."
442clean: clean-am
443
444clean-am: clean-generic clean-libtool clean-pluginimpLTLIBRARIES \
445 mostlyclean-am
446
447distclean: distclean-am
448 -rm -rf ./$(DEPDIR)
449 -rm -f Makefile
450distclean-am: clean-am distclean-compile distclean-generic \
451 distclean-tags
452
453dvi: dvi-am
454
455dvi-am:
456
457html: html-am
458
459info: info-am
460
461info-am:
462
463install-data-am: install-pluginimpLTLIBRARIES
464
465install-dvi: install-dvi-am
466
467install-exec-am:
468
469install-html: install-html-am
470
471install-info: install-info-am
472
473install-man:
474
475install-pdf: install-pdf-am
476
477install-ps: install-ps-am
478
479installcheck-am:
480
481maintainer-clean: maintainer-clean-am
482 -rm -rf ./$(DEPDIR)
483 -rm -f Makefile
484maintainer-clean-am: distclean-am maintainer-clean-generic
485
486mostlyclean: mostlyclean-am
487
488mostlyclean-am: mostlyclean-compile mostlyclean-generic \
489 mostlyclean-libtool
490
491pdf: pdf-am
492
493pdf-am:
494
495ps: ps-am
496
497ps-am:
498
499uninstall-am: uninstall-pluginimpLTLIBRARIES
500
501.MAKE: install-am install-strip
502
503.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
504 clean-libtool clean-pluginimpLTLIBRARIES ctags distclean \
505 distclean-compile distclean-generic distclean-libtool \
506 distclean-tags distdir dvi dvi-am html html-am info info-am \
507 install install-am install-data install-data-am install-dvi \
508 install-dvi-am install-exec install-exec-am install-html \
509 install-html-am install-info install-info-am install-man \
510 install-pdf install-pdf-am install-pluginimpLTLIBRARIES \
511 install-ps install-ps-am install-strip installcheck \
512 installcheck-am installdirs maintainer-clean \
513 maintainer-clean-generic mostlyclean mostlyclean-compile \
514 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
515 tags uninstall uninstall-am uninstall-pluginimpLTLIBRARIES
516
517# Tell versions [3.59,3.63) of GNU make to not export all variables.
518# Otherwise a system limit (for SysV at least) may be exceeded.
519.NOEXPORT:
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw.c
new file mode 100644
index 0000000..09a013d
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw.c
@@ -0,0 +1,112 @@
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 <string.h>
24#include <stdio.h>
25
26#include <g3d/types.h>
27#include <g3d/stream.h>
28#include <g3d/matrix.h>
29#include <g3d/object.h>
30
31#include "imp_ldraw_types.h"
32#include "imp_ldraw_part.h"
33#include "imp_ldraw_library.h"
34#include "imp_ldraw_mpd.h"
35
36static gboolean ldraw_load_simple(G3DStream *stream, G3DModel *model,
37 LDrawLibrary *lib);
38
39
40EAPI
41gpointer plugin_init(G3DContext *context)
42{
43 return ldraw_library_init();
44}
45
46EAPI
47void plugin_cleanup(gpointer user_data)
48{
49 LDrawLibrary *lib = user_data;
50
51 ldraw_library_cleanup(lib);
52}
53
54EAPI
55gboolean plugin_load_model_from_stream(G3DContext *context, G3DStream *stream,
56 G3DModel *model, gpointer user_data)
57{
58 LDrawLibrary *lib = user_data;
59
60 g_return_val_if_fail(lib != NULL, FALSE);
61 if(lib->libdir == NULL) {
62 g_warning("LDraw: library not found, please set LDRAWDIR");
63 return FALSE;
64 }
65
66 lib->context = context;
67
68 if(g_ascii_strcasecmp(stream->uri + strlen(stream->uri) - 4, ".mpd") == 0)
69 return ldraw_mpd_load(stream, model, lib);
70 else
71 return ldraw_load_simple(stream, model, lib);
72
73 return TRUE;
74}
75
76EAPI
77gchar *plugin_description(void)
78{
79 return g_strdup("LDraw models.");
80}
81
82EAPI
83gchar **plugin_extensions(void)
84{
85 return g_strsplit("ldr:mpd:dat", ":", 0);
86}
87
88/*****************************************************************************/
89
90static gboolean ldraw_load_simple(G3DStream *stream, G3DModel *model,
91 LDrawLibrary *lib)
92{
93 LDrawPart *part;
94 G3DObject *object;
95 G3DFloat m[16];
96
97 part = g_new0(LDrawPart, 1);
98 part->name = g_path_get_basename(stream->uri);
99 part->stream = stream;
100 part->master = TRUE;
101
102 object = ldraw_part_get_object(part, lib);
103 if(object == NULL)
104 return FALSE;
105
106 g3d_matrix_identity(m);
107 g3d_matrix_rotate_xyz(0.0, 0.0, G_PI, m);
108 g3d_object_transform(object, m);
109 model->objects = g_slist_append(model->objects, object);
110 return TRUE;
111}
112
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.c
new file mode 100644
index 0000000..6b76e50
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.c
@@ -0,0 +1,124 @@
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 <g3d/material.h>
23
24#include "imp_ldraw_types.h"
25
26typedef struct {
27 gint32 id;
28 const gchar *name;
29 G3DFloat r;
30 G3DFloat g;
31 G3DFloat b;
32 G3DFloat a;
33} LDrawColorDef;
34
35static LDrawColorDef ldraw_colors[] = {
36 { 0, "Black", 0.13, 0.13, 0.13, 1.0 },
37 { 1, "Blue", 0.00, 0.20, 0.70, 1.0 },
38 { 2, "Green", 0.00, 0.55, 0.08, 1.0 },
39 { 3, "Teal", 0.00, 0.60, 0.62, 1.0 },
40 { 4, "Red", 0.77, 0.00, 0.15, 1.0 },
41 { 5, "Dark Pink", 0.87, 0.40, 0.58, 1.0 },
42 { 6, "Brown", 0.36, 0.13, 0.00, 1.0 },
43 { 7, "Gray", 0.76, 0.76, 0.76, 1.0 },
44 { 8, "Dark Gray", 0.39, 0.37, 0.32, 1.0 },
45 { 9, "Light Blue", 0.42, 0.67, 0.86, 1.0 },
46 { 10, "Bright Green", 0.42, 0.93, 0.56, 1.0 },
47 { 11, "Cyan", 0.20, 0.65, 0.65, 1.0 },
48 { 12, "Light Red", 1.00, 0.52, 0.48, 1.0 },
49 { 13, "Pink", 0.98, 0.64, 0.78, 1.0 },
50 { 14, "Yellow", 1.00, 0.86, 0.00, 1.0 },
51 { 15, "White", 1.00, 1.00, 1.00, 1.0 },
52
53 { 17, "Light Green", 0.73, 1.00, 0.81, 1.0 },
54 { 18, "Light Yellow", 0.99, 0.91, 0.59, 1.0 },
55 { 20, "Light Violet", 0.84, 0.77, 0.90, 1.0 },
56 { 28, "Dark Tan", 0.77, 0.59, 0.31, 1.0 },
57 { 32, "Trans Gray", 0.39, 0.37, 0.32, 0.9 },
58 { 33, "Trans Blue", 0.00, 0.13, 0.63, 0.9 },
59 { 36, "Trans Red", 0.77, 0.00, 0.15, 0.9 },
60 { 39, "Trans Light Gray", 0.76, 0.76, 0.76, 0.9 }, /* FIXME */
61 { 40, "Trans Gray", 0.39, 0.37, 0.32, 0.9 },
62 { 41, "Trans Light Cyan", 0.68, 0.94, 0.93, 0.95 },
63 { 46, "Trans Yellow", 0.79, 0.69, 0.00, 0.9 },
64 { 47, "Clear (trans white)", 1.00, 1.00, 1.00, 0.9 },
65 { 72, "Dark Stone Gray", 0.39, 0.37, 0.38, 1.0 },
66 { 272, "Dark Blue", 0.00, 0.11, 0.41, 1.0 },
67 { 288, "Dark Green", 0.15, 0.27, 0.17, 1.0 },
68 { 320, "Dark Red", 0.47, 0.00, 0.11, 1.0 },
69 { 334, "Chrome Gold", 0.88, 0.43, 0.07, 1.0 },
70 { 336, "Earth Orange", 0.82, 0.51, 0.02, 1.0 },
71 { 383, "Chrome Silver", 0.88, 0.88, 0.88, 1.0 },
72 { 431, "Light Green", 0.73, 1.00, 0.81, 1.0 },
73 { 463, "Light Red", 1.00, 0.52, 0.48, 1.0 },
74 { 484, "Dark Orange", 0.70, 0.24, 0.00, 1.0 },
75 { 494, "Electric Contact", 0.82, 0.82, 0.82, 1.0 },
76 { 495, "Light Yellow", 0.99, 0.91, 0.59, 1.0 },
77 { 503, "Light Gray", 0.90, 0.89, 0.85, 1.0 },
78
79 { -1, NULL, 0,0,0,0 }
80};
81
82gboolean ldraw_color_init(LDrawLibrary *lib)
83{
84 G3DMaterial *material;
85 gint32 i;
86
87 lib->colordb = g_hash_table_new(g_int_hash, g_int_equal);
88
89 for(i = 0; ldraw_colors[i].id >= 0; i ++) {
90 material = g3d_material_new();
91 material->name = g_strdup(ldraw_colors[i].name);
92 material->r = ldraw_colors[i].r;
93 material->g = ldraw_colors[i].g;
94 material->b = ldraw_colors[i].b;
95 material->a = ldraw_colors[i].a;
96 g_hash_table_insert(lib->colordb, &(ldraw_colors[i].id), material);
97 lib->colorlist = g_slist_append(lib->colorlist, material);
98#if DEBUG > 2
99 g_debug("LDraw: adding color '%s' with id %d",
100 ldraw_colors[i].name, ldraw_colors[i].id);
101#endif
102 }
103 return TRUE;
104}
105
106G3DMaterial *ldraw_color_lookup(LDrawLibrary *lib, guint32 colid)
107{
108 G3DMaterial *material;
109 guint32 fbid = 0;
110
111 /* current color */
112 if(colid == 16)
113 return NULL;
114
115 material = g_hash_table_lookup(lib->colordb, &colid);
116 if(material == NULL) { /* fall back */
117#if DEBUG > 0
118 g_debug("LDraw: failed to lookup color %u", colid);
119#endif
120 material = g_hash_table_lookup(lib->colordb, &fbid);
121 }
122 return material;
123}
124
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.h
new file mode 100644
index 0000000..e5844de
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_color.h
@@ -0,0 +1,30 @@
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_LDRAW_COLOR_H
23#define _IMP_LDRAW_COLOR_H
24
25#include "imp_ldraw_types.h"
26
27gboolean ldraw_color_init(LDrawLibrary *lib);
28G3DMaterial *ldraw_color_lookup(LDrawLibrary *lib, guint32 colid);
29
30#endif /* _IMP_LDRAW_COLOR_H */
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.c
new file mode 100644
index 0000000..aa07cdb
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.c
@@ -0,0 +1,175 @@
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/object.h>
25
26#include "imp_ldraw_types.h"
27#include "imp_ldraw_part.h"
28#include "imp_ldraw_color.h"
29#include "imp_ldraw_misc.h"
30
31static gboolean ldraw_library_add_dir(LDrawLibrary *lib, const gchar *subdir)
32{
33 LDrawPart *part;
34 const gchar *filename;
35 gchar *partdir, *strup;
36 GDir *dir;
37 GError *error;
38 gboolean prefix = FALSE;
39
40 partdir = g_strdup_printf("%s%c%s", lib->libdir, G_DIR_SEPARATOR, subdir);
41 dir = g_dir_open(partdir, 0, &error);
42 if(dir == NULL) {
43 g_warning("LDraw: failed to open directory '%s': %s", partdir,
44 error->message);
45 g_error_free(error);
46 g_free(partdir);
47 return FALSE;
48 }
49
50 if(path_sep(subdir))
51 prefix = TRUE;
52
53 filename = g_dir_read_name(dir);
54 while(filename) {
55 if(g_ascii_strcasecmp(filename + strlen(filename) - 4, ".dat") == 0) {
56#if DEBUG > 3
57 g_debug("LDraw: Library: adding '%s'", filename);
58#endif
59 part = g_new0(LDrawPart, 1);
60 part->filename = g_strdup_printf("%s%c%s",
61 partdir, G_DIR_SEPARATOR, filename);
62 strup = g_ascii_strup(filename, -1);
63 if(prefix)
64 part->name = g_strdup_printf("%s%c%s",
65 path_sep(subdir) + 1,
66 G_DIR_SEPARATOR, strup);
67 else
68 part->name = g_strdup(strup);
69 g_free(strup);
70 g_hash_table_insert(lib->partdb, part->name, part);
71 lib->partlist = g_slist_append(lib->partlist, part);
72 }
73 filename = g_dir_read_name(dir);
74 }
75 g_dir_close(dir);
76 g_free(partdir);
77
78 return TRUE;
79}
80
81LDrawLibrary *ldraw_library_init(void)
82{
83 LDrawLibrary *lib;
84 const gchar *lddir;
85
86 lib = g_new0(LDrawLibrary, 1);
87 lib->partdb = g_hash_table_new(g_str_hash, g_str_equal);
88
89 ldraw_color_init(lib);
90
91 lddir = g_getenv("LDRAWDIR");
92 if(lddir == NULL) /* warning is issued when trying to load a model */
93 return lib;
94
95 lib->libdir = g_strdup(lddir);
96
97 ldraw_library_add_dir(lib, "PARTS");
98 ldraw_library_add_dir(lib, "PARTS" G_DIR_SEPARATOR_S "S");
99 ldraw_library_add_dir(lib, "P");
100 ldraw_library_add_dir(lib, "P" G_DIR_SEPARATOR_S "48");
101
102 return lib;
103}
104
105void ldraw_library_cleanup(LDrawLibrary *lib)
106{
107 GSList *item;
108 LDrawPart *part;
109
110 item = lib->partlist;
111 while(item != NULL) {
112 part = item->data;
113 item = g_slist_remove(item, part);
114 ldraw_part_free(part);
115 }
116 g_hash_table_destroy(lib->partdb);
117 g_free(lib);
118}
119
120void ldraw_library_insert(LDrawLibrary *lib, gchar *name, gpointer data)
121{
122 g_hash_table_insert(lib->partdb, name, data);
123}
124
125G3DObject *ldraw_library_lookup(LDrawLibrary *lib, const gchar *name)
126{
127 LDrawPart *part;
128 gchar *strc;
129
130 part = g_hash_table_lookup(lib->partdb, name);
131 if(part == NULL) {
132 strc = g_ascii_strup(name, -1);
133 g_strdelimit(strc, "/\\", G_DIR_SEPARATOR);
134 part = g_hash_table_lookup(lib->partdb, strc);
135 g_free(strc);
136 }
137#if 0
138 if(part == NULL) {
139 strc = g_ascii_strdown(name, -1);
140 g_strdelimit(strc, "/\\", G_DIR_SEPARATOR);
141 part = g_hash_table_lookup(lib->partdb, strc);
142 g_free(strc);
143 }
144#endif
145 if(part == NULL) {
146 g_warning("LDraw: failed to find '%s' in library", name);
147 return NULL;
148 }
149 if(part->object == NULL) {
150 if(part->stream) {
151 /* MPD loader has a custom stream */
152 part->object = ldraw_part_get_object(part, lib);
153 } else if(part->filename) {
154 /* try to load part from standard library */
155 part->stream = g3d_stream_open_file(part->filename, "r");
156 if(part->stream) {
157 part->object = ldraw_part_get_object(part, lib);
158 g3d_stream_close(part->stream);
159 part->stream = NULL;
160 } else {
161 g_warning("LDraw: failed to open stream for '%s'",
162 part->filename);
163 }
164 } else {
165 g_warning("LDraw: don't know how to open part '%s'", part->name);
166 }
167
168 if(part->object == NULL) {
169 g_warning("LDraw: failed to load part '%s'", part->name);
170 return NULL;
171 }
172 }
173 return g3d_object_duplicate(part->object);
174}
175
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.h
new file mode 100644
index 0000000..39fa0f9
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_library.h
@@ -0,0 +1,32 @@
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_LDRAW_LIBRARY_H
23#define _IMP_LDRAW_LIBRARY_H
24
25#include "imp_ldraw_types.h"
26
27LDrawLibrary *ldraw_library_init(void);
28void ldraw_library_cleanup(LDrawLibrary *lib);
29void ldraw_library_insert(LDrawLibrary *lib, gchar *name, gpointer data);
30G3DObject *ldraw_library_lookup(LDrawLibrary *lib, const gchar *name);
31
32#endif
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_misc.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_misc.h
new file mode 100644
index 0000000..16651d5
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_misc.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_LDRAW_MISC_H
23#define _IMP_LDRAW_MISC_H
24
25#include <string.h>
26#include <glib.h>
27
28static inline gchar *path_sep(const gchar *text)
29{
30 gchar *p = strchr(text, '/');
31 if(p != NULL)
32 return p;
33 return strchr(text, '\\');
34}
35
36#endif
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.c
new file mode 100644
index 0000000..a699f2a
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.c
@@ -0,0 +1,121 @@
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 <stdio.h>
24
25#include <g3d/types.h>
26#include <g3d/matrix.h>
27#include <g3d/object.h>
28
29#include "imp_ldraw_types.h"
30#include "imp_ldraw_part.h"
31#include "imp_ldraw_library.h"
32
33static inline void ldraw_create_subpart(LDrawLibrary *lib, gchar *name,
34 gchar *buffer, GSList **partsp)
35{
36 G3DStream *substream;
37 LDrawPart *part;
38
39#if DEBUG > 2
40 g_debug("LDraw: adding sub-file %s to library", name);
41#endif
42
43 substream = g3d_stream_from_buffer((guint8 *)buffer, strlen(buffer),
44 name, TRUE);
45 if(substream == NULL) {
46 g_warning("LDraw: failed to create stream for %s", name);
47 return;
48 }
49 part = g_new0(LDrawPart, 1);
50 part->name = g_ascii_strup(name, -1);
51 part->stream = substream;
52
53 ldraw_library_insert(lib, part->name, part);
54 *partsp = g_slist_append(*partsp, part);
55}
56
57gboolean ldraw_mpd_load(G3DStream *stream, G3DModel *model,
58 LDrawLibrary *lib)
59{
60 G3DObject *object = NULL;
61 GSList *parts = NULL, *item;
62 LDrawPart *part;
63 gchar buffer[1024], name[256], *streambuf = NULL;
64 gsize size;
65 goffset off;
66 G3DFloat m[16];
67
68 while(!g3d_stream_eof(stream)) {
69 memset(buffer, 0, 1024);
70 g3d_stream_read_line(stream, buffer, 1023);
71 if(strncmp(buffer, "0 FILE ", 7) == 0) {
72 if(streambuf) {
73 ldraw_create_subpart(lib, name, streambuf, &parts);
74 streambuf = NULL;
75 }
76 memset(name, 0, 256);
77 if(sscanf(buffer + 7, "%255s", name) == 1)
78 streambuf = g_strdup("");
79 } else if(strncmp(buffer, "0 NOFILE", 8) == 0) {
80 if(streambuf) {
81 ldraw_create_subpart(lib, name, streambuf, &parts);
82 streambuf = NULL;
83 }
84 break;
85 } else if(streambuf) {
86 /* append line to buffer */
87 size = strlen(buffer) + strlen(streambuf) + 1;
88 off = strlen(streambuf);
89 streambuf = g_realloc(streambuf, size * sizeof(gchar));
90 strcpy(streambuf + off, buffer);
91 }
92 } /* !eof */
93
94 if(streambuf)
95 ldraw_create_subpart(lib, name, streambuf, &parts);
96
97 if(parts) {
98 part = parts->data;
99 part->master = TRUE;
100 object = ldraw_part_get_object(part, lib);
101 if(object != NULL) {
102 g3d_matrix_identity(m);
103 g3d_matrix_rotate_xyz(0.0, 0.0, G_PI, m);
104 g3d_object_transform(object, m);
105 model->objects = g_slist_append(model->objects, object);
106 }
107 }
108
109#if 1
110 /* close open streams */
111 for(item = parts; item != NULL; item = item->next) {
112 part = item->data;
113 if(part->stream) {
114 g3d_stream_close(part->stream);
115 part->stream = NULL;
116 }
117 }
118#endif
119 return (object != NULL);
120}
121
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.h
new file mode 100644
index 0000000..75a5f11
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_mpd.h
@@ -0,0 +1,33 @@
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_LDRAW_MPD_H
23#define _IMP_LDRAW_MPD_H
24
25#include <g3d/types.h>
26#include <g3d/stream.h>
27
28#include "imp_ldraw_types.h"
29
30gboolean ldraw_mpd_load(G3DStream *stream, G3DModel *model,
31 LDrawLibrary *lib);
32
33#endif /* _IMP_LDRAW_MPD_H */
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.c b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.c
new file mode 100644
index 0000000..9f7f608
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.c
@@ -0,0 +1,291 @@
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 <stdio.h>
23#include <string.h>
24
25#include <g3d/types.h>
26#include <g3d/context.h>
27#include <g3d/stream.h>
28#include <g3d/material.h>
29#include <g3d/matrix.h>
30#include <g3d/object.h>
31
32#include "imp_ldraw_types.h"
33#include "imp_ldraw_part.h"
34#include "imp_ldraw_library.h"
35#include "imp_ldraw_color.h"
36#include "imp_ldraw_misc.h"
37
38static gboolean ldraw_part_parse_meta(G3DObject *object, gchar *buffer)
39{
40 if(object->name == NULL) {
41 object->name = g_strdup(buffer);
42 return TRUE;
43 }
44#if DEBUG > 2
45 g_debug("META: %s", buffer);
46#endif
47 return TRUE;
48}
49
50static void ldraw_part_replace_material(G3DObject *object,
51 G3DMaterial *material)
52{
53 GSList *item;
54 G3DObject *sub;
55 G3DFace *face;
56
57 for(item = object->faces; item != NULL; item = item->next) {
58 face = item->data;
59 if(face->material == NULL)
60 face->material = material;
61 }
62 for(item = object->objects; item != NULL; item = item->next) {
63 sub = item->data;
64 ldraw_part_replace_material(sub, material);
65 }
66}
67
68static gboolean ldraw_part_parse_ref(G3DObject *object, gchar *buffer,
69 LDrawLibrary *lib)
70{
71 G3DObject *subobj;
72 G3DMaterial *material;
73 G3DFloat m[16], x, y, z;
74 guint32 colid;
75 gchar fname[256], *strp;
76
77 g3d_matrix_identity(m);
78 memset(fname, 0, 256);
79
80 if(sscanf(buffer, "%u "
81 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " "
82 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " "
83 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " %255s",
84 &colid, &x, &y, &z,
85 m + 0 * 4 + 0, m + 1 * 4 + 0, m + 2 * 4 + 0,
86 m + 0 * 4 + 1, m + 1 * 4 + 1, m + 2 * 4 + 1,
87 m + 0 * 4 + 2, m + 1 * 4 + 2, m + 2 * 4 + 2,
88 fname) == 14) {
89
90 strp = path_sep(fname);
91 if(strp != NULL)
92 strp[0] = G_DIR_SEPARATOR;
93
94 subobj = ldraw_part_from_file(lib, fname);
95 if(!subobj)
96 subobj = ldraw_library_lookup(lib, fname);
97 if(subobj != NULL) {
98 g3d_object_transform(subobj, m);
99 g3d_matrix_identity(m);
100 g3d_matrix_translate(x, y, z, m);
101 g3d_object_transform(subobj, m);
102 if(colid != 16) {
103 material = ldraw_color_lookup(lib, colid);
104 ldraw_part_replace_material(subobj, material);
105 }
106 object->objects = g_slist_append(object->objects, subobj);
107 return TRUE;
108 }
109 }
110#if DEBUG > 1
111 g_warning("LDraw: failed to parse/process reference: %s", buffer);
112#endif
113 return FALSE;
114}
115
116static gboolean ldraw_part_parse_tri(G3DObject *object, gchar *buffer,
117 LDrawLibrary *lib)
118{
119 guint32 off, colid;
120 G3DFace *face;
121
122 off = object->vertex_count;
123 object->vertex_count += 3;
124 object->vertex_data = g_realloc(object->vertex_data,
125 object->vertex_count * 3 * sizeof(G3DFloat));
126 if(sscanf(buffer, "%u "
127 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " "
128 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " "
129 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT,
130 &colid,
131 object->vertex_data + (off + 0) * 3 + 0,
132 object->vertex_data + (off + 0) * 3 + 1,
133 object->vertex_data + (off + 0) * 3 + 2,
134 object->vertex_data + (off + 1) * 3 + 0,
135 object->vertex_data + (off + 1) * 3 + 1,
136 object->vertex_data + (off + 1) * 3 + 2,
137 object->vertex_data + (off + 2) * 3 + 0,
138 object->vertex_data + (off + 2) * 3 + 1,
139 object->vertex_data + (off + 2) * 3 + 2) == 10) {
140
141 face = g_new0(G3DFace, 1);
142 face->material = ldraw_color_lookup(lib, colid);
143 face->vertex_count = 3;
144 face->vertex_indices = g_new0(guint32, 3);
145 face->vertex_indices[0] = off + 0;
146 face->vertex_indices[1] = off + 1;
147 face->vertex_indices[2] = off + 2;
148 object->faces = g_slist_append(object->faces, face);
149 return TRUE;
150 }
151 return FALSE;
152}
153
154static gboolean ldraw_part_parse_quad(G3DObject *object, gchar *buffer,
155 LDrawLibrary *lib)
156{
157 guint32 off, colid;
158 G3DFace *face;
159
160 off = object->vertex_count;
161 object->vertex_count += 4;
162 object->vertex_data = g_realloc(object->vertex_data,
163 object->vertex_count * 3 * sizeof(G3DFloat));
164 if(sscanf(buffer, "%u "
165 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " "
166 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " "
167 G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT " " G3D_SCANF_FLOAT,
168 &colid,
169 object->vertex_data + (off + 0) * 3 + 0,
170 object->vertex_data + (off + 0) * 3 + 1,
171 object->vertex_data + (off + 0) * 3 + 2,
172 object->vertex_data + (off + 1) * 3 + 0,
173 object->vertex_data + (off + 1) * 3 + 1,
174 object->vertex_data + (off + 1) * 3 + 2,
175 object->vertex_data + (off + 2) * 3 + 0,
176 object->vertex_data + (off + 2) * 3 + 1,
177 object->vertex_data + (off + 2) * 3 + 2,
178 object->vertex_data + (off + 3) * 3 + 0,
179 object->vertex_data + (off + 3) * 3 + 1,
180 object->vertex_data + (off + 3) * 3 + 2) == 13) {
181
182 face = g_new0(G3DFace, 1);
183 face->material = ldraw_color_lookup(lib, colid);
184 face->vertex_count = 4;
185 face->vertex_indices = g_new0(guint32, 4);
186 face->vertex_indices[0] = off + 0;
187 face->vertex_indices[1] = off + 1;
188 face->vertex_indices[2] = off + 2;
189 face->vertex_indices[3] = off + 3;
190 object->faces = g_slist_append(object->faces, face);
191 return TRUE;
192 }
193 return FALSE;
194}
195
196static inline G3DObject *ldraw_part_open_file(LDrawLibrary *lib,
197 const gchar *filename)
198{
199 LDrawPart *part;
200
201 part = g_new0(LDrawPart, 1);
202 part->name = g_strdup(filename);
203 part->stream = g3d_stream_open_file(filename, "r");
204 if(part->stream == NULL) {
205 g_free(part);
206 return NULL;
207 }
208 part->object = ldraw_part_get_object(part, lib);
209 g3d_stream_close(part->stream);
210 part->stream = NULL;
211
212 ldraw_library_insert(lib, part->name, part);
213
214 return part->object;
215}
216
217G3DObject *ldraw_part_from_file(LDrawLibrary *lib, const gchar *filename)
218{
219 G3DObject *object;
220 gchar *path;
221
222 if(g_file_test(filename, G_FILE_TEST_EXISTS))
223 return ldraw_part_open_file(lib, filename);
224 path = g_ascii_strdown(filename, -1);
225 if(g_file_test(path, G_FILE_TEST_EXISTS)) {
226 object = ldraw_part_open_file(lib, path);
227 g_free(path);
228 return object;
229 }
230 g_free(path);
231 return NULL;
232}
233
234G3DObject *ldraw_part_get_object(LDrawPart *part, LDrawLibrary *lib)
235{
236 G3DObject *object;
237 G3DMaterial *material;
238 gchar buffer[1024];
239
240 object = g_new0(G3DObject, 1);
241 material = g3d_material_new();
242 material->name = g_strdup("default material");
243 object->materials = g_slist_append(object->materials, material);
244
245 while(!g3d_stream_eof(part->stream)) {
246 memset(buffer, 0, 1024);
247 g3d_stream_read_line(part->stream, buffer, 1023);
248 g_strstrip(buffer);
249 if(strlen(buffer) == 0)
250 continue;
251 switch(buffer[0] - 0x30) {
252 case 0: /* meta data */
253 ldraw_part_parse_meta(object, buffer + 2);
254 break;
255 case 1: /* sub-file reference */
256 ldraw_part_parse_ref(object, buffer + 2, lib);
257 break;
258 case 2: /* line */
259 break;
260 case 3: /* triangle */
261 ldraw_part_parse_tri(object, buffer + 2, lib);
262 break;
263 case 4: /* quadrilateral */
264 ldraw_part_parse_quad(object, buffer + 2, lib);
265 break;
266 case 5: /* optional line */
267 break;
268 default:
269 g_warning("LDraw: unknown type of line: %s", buffer);
270 break;
271 }
272 if(part->master) {
273 g3d_context_update_progress_bar(lib->context,
274 (G3DFloat)g3d_stream_tell(part->stream) /
275 (G3DFloat)g3d_stream_size(part->stream), TRUE);
276 g3d_context_update_interface(lib->context);
277 }
278 }
279
280 return object;
281}
282
283void ldraw_part_free(LDrawPart *part)
284{
285 if(part->stream)
286 g3d_stream_close(part->stream);
287 if(part->filename)
288 g_free(part->filename);
289 g_free(part->name);
290 g_free(part);
291}
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.h
new file mode 100644
index 0000000..8bd758d
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_part.h
@@ -0,0 +1,31 @@
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_LDRAW_PART_H
23#define _IMP_LDRAW_PART_H
24
25#include "imp_ldraw_types.h"
26
27G3DObject *ldraw_part_from_file(LDrawLibrary *lib, const gchar *filename);
28G3DObject *ldraw_part_get_object(LDrawPart *part, LDrawLibrary *lib);
29void ldraw_part_free(LDrawPart *part);
30
31#endif /* _IMP_LDRAW_PART_H */
diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_types.h b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_types.h
new file mode 100644
index 0000000..56805db
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/plugins/import/imp_ldraw/imp_ldraw_types.h
@@ -0,0 +1,48 @@
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_LDRAW_TYPES_H
23#define _IMP_LDRAW_TYPES_H
24
25#include <glib.h>
26
27#include <g3d/types.h>
28#include <g3d/stream.h>
29
30typedef struct {
31 gchar *name;
32 gchar *filename;
33 G3DObject *object;
34 G3DStream *stream;
35 gboolean failed;
36 gboolean master;
37} LDrawPart;
38
39typedef struct {
40 G3DContext *context;
41 gchar *libdir;
42 GHashTable *partdb;
43 GSList *partlist;
44 GHashTable *colordb;
45 GSList *colorlist;
46} LDrawLibrary;
47
48#endif /* _IMP_LDRAW_TYPES_H */