Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit since shifting the Stage-3.0 development branch (opengl)…

… to HEAD
  • Loading branch information...
commit 36bfbdb6b43b6cb21c205d4aed33e40fd4700da3 1 parent 08e985b
rtv authored
Showing with 16,042 additions and 0 deletions.
  1. +4 −0 libstage/.cvsignore
  2. +649 −0 libstage/Makefile
  3. +57 −0 libstage/Makefile.am
  4. +40 −0 libstage/Makefile.fl
  5. +48 −0 libstage/Makefile.manual
  6. +55 −0 libstage/ancestor.cc
  7. +293 −0 libstage/block.cc
  8. +168 −0 libstage/blockgrid.cc
  9. +520 −0 libstage/canvas.cc
  10. +4 −0 libstage/draw.cc
  11. +16 −0 libstage/gl.c
  12. +74 −0 libstage/glcolorstack.cc
  13. +377 −0 libstage/glutgraphics.cc
  14. +713 −0 libstage/logo.cc
  15. +1,463 −0 libstage/model.cc
  16. +369 −0 libstage/model_blobfinder.cc
  17. +129 −0 libstage/model_callbacks.cc
  18. +305 −0 libstage/model_fiducial.cc
  19. +347 −0 libstage/model_laser.cc
  20. +354 −0 libstage/model_load.cc
  21. +515 −0 libstage/model_position.cc
  22. +93 −0 libstage/model_props.cc
  23. +388 −0 libstage/model_ranger.cc
  24. +153 −0 libstage/model_wifi.cc
  25. +753 −0 libstage/rgb.txt
  26. +610 −0 libstage/stage.cc
  27. +2,141 −0 libstage/stage.hh
  28. +20 −0 libstage/stage_internal.hh
  29. +144 −0 libstage/stagecpp.cc
  30. +162 −0 libstage/stest.cc
  31. +29 −0 libstage/typetable.cc
  32. +647 −0 libstage/world.cc
  33. +1,737 −0 libstage/worldfile.cc
  34. +358 −0 libstage/worldfile.hh
  35. +1,950 −0 libstage/worldgtk.cc
  36. +357 −0 libstage/worldgui.cc
View
4 libstage/.cvsignore
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+stage
+.DS_Store
View
649 libstage/Makefile
@@ -0,0 +1,649 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# libstage/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+# Automake script to build Stage's Makefile
+#
+# RTV 20021026
+# $Id: Makefile,v 1.2 2008-01-15 01:16:49 rtv Exp $
+
+
+
+
+
+pkgdatadir = $(datadir)/stage
+pkglibdir = $(libdir)/stage
+pkgincludedir = $(includedir)/stage
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i386-apple-darwin9.1.0
+host_triplet = i386-apple-darwin9.1.0
+target_triplet = i386-apple-darwin9.1.0
+bin_PROGRAMS = stest$(EXEEXT)
+subdir = libstage
+DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libstage_la_DEPENDENCIES =
+am_libstage_la_OBJECTS = ancestor.lo block.lo blockgrid.lo canvas.lo \
+ glcolorstack.lo model.lo model_callbacks.lo model_fiducial.lo \
+ model_laser.lo model_load.lo model_position.lo model_ranger.lo \
+ model_blobfinder.lo model_props.lo stage.lo typetable.lo \
+ world.lo worldfile.lo worldgui.lo
+libstage_la_OBJECTS = $(am_libstage_la_OBJECTS)
+libstage_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(libstage_la_LDFLAGS) $(LDFLAGS) -o $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_stest_OBJECTS = stest.$(OBJEXT)
+stest_OBJECTS = $(am_stest_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libstage_la_SOURCES) $(stest_SOURCES)
+DIST_SOURCES = $(libstage_la_SOURCES) $(stest_SOURCES)
+pkgdataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgdata_DATA)
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /Users/vaughan/PS/HEAD/stage/missing --run aclocal-1.10
+AMTAR = ${SHELL} /Users/vaughan/PS/HEAD/stage/missing --run tar
+AR = ar
+AUTOCONF = ${SHELL} /Users/vaughan/PS/HEAD/stage/missing --run autoconf
+AUTOHEADER = ${SHELL} /Users/vaughan/PS/HEAD/stage/missing --run autoheader
+AUTOMAKE = ${SHELL} /Users/vaughan/PS/HEAD/stage/missing --run automake-1.10
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+CPP = gcc -E
+CPPFLAGS =
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = /bin/echo
+ECHO_C = \c
+ECHO_N =
+ECHO_T =
+EGREP = /usr/bin/grep -E
+EXEEXT =
+F77 =
+FFLAGS =
+FLTK_CFLAGS = -I/opt/local/include -I/opt/local/include/FL/images
+FLTK_LIBS = -L/opt/local/lib -lfltk_images -lfltk_png -lz -lfltk_jpeg -lfltk_gl -framework AGL -framework OpenGL -lfltk -framework Carbon -framework ApplicationServices
+GREP = /usr/bin/grep
+HAVE_FLTK_CONFIG = fltk-config
+INSTALL = /opt/local/bin/ginstall -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LDFLAGS =
+LIBOBJS =
+LIBS =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBTOOL_DEPS = ./ltmain.sh
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /Users/vaughan/PS/HEAD/stage/missing --run makeinfo
+MKDIR_P = /opt/local/bin/gmkdir -p
+OBJEXT = o
+PACKAGE = stage
+PACKAGE_BUGREPORT =
+PACKAGE_NAME = Stage
+PACKAGE_STRING = Stage 3.0.0
+PACKAGE_TARNAME = stage
+PACKAGE_VERSION = 3.0.0
+PATH_SEPARATOR = :
+PIXBUF_CFLAGS = -I/opt/local/include/gtk-2.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include
+PIXBUF_LIBS = -L/opt/local/lib -lgdk_pixbuf-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv
+PKG_CONFIG = /opt/local/bin/pkg-config
+PLAYERC_CFLAGS = -I/Users/vaughan/PS-2.0/include/player-2.1
+PLAYERC_LIBS = -L/Users/vaughan/PS-2.0/lib -lplayerc -lm -lplayerxdr -lplayererror
+PLAYER_CFLAGS = -I/Users/vaughan/PS-2.0/include/player-2.1
+PLAYER_LIBS = -L/Users/vaughan/PS-2.0/lib -lplayercore -lltdl -lpthread -lplayererror
+RANLIB = ranlib
+SET_MAKE =
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 3.0.0
+abs_builddir = /Users/vaughan/PS/HEAD/stage/libstage
+abs_srcdir = /Users/vaughan/PS/HEAD/stage/libstage
+abs_top_builddir = /Users/vaughan/PS/HEAD/stage
+abs_top_srcdir = /Users/vaughan/PS/HEAD/stage
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_F77 =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = tar --format=ustar -chf - "$$tardir"
+am__untar = tar -xf -
+bindir = ${exec_prefix}/bin
+build = i386-apple-darwin9.1.0
+build_alias =
+build_cpu = i386
+build_os = darwin9.1.0
+build_vendor = apple
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+have_pkg_config = yes
+host = i386-apple-darwin9.1.0
+host_alias =
+host_cpu = i386
+host_os = darwin9.1.0
+host_vendor = apple
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = $(SHELL) /Users/vaughan/PS/HEAD/stage/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = /opt/local/bin/gmkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /Users/vaughan/PS-2.0
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target = i386-apple-darwin9.1.0
+target_alias =
+target_cpu = i386
+target_os = darwin9.1.0
+target_vendor = apple
+top_builddir = ..
+top_srcdir = ..
+
+# install the header file for the Stage library
+include_HEADERS = stage.hh
+
+# install the color database
+pkgdata_DATA = rgb.txt
+RGB = $(datadir)/stage/rgb.txt
+
+# system-wide compile flags - target-specific flags are added to each target below
+AM_CPPFLAGS = -Wall -I. -I$(top_srcdir)/replace -I/opt/local/include/gtk-2.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include -I/opt/local/include/FL/images -DRGBFILE=\"$(RGB)\"
+
+# build the stage library
+lib_LTLIBRARIES = libstage.la
+
+# The stage library
+libstage_la_SOURCES = \
+ ../config.h \
+ ancestor.cc \
+ block.cc \
+ blockgrid.cc \
+ canvas.cc \
+ colors.h \
+ glcolorstack.cc \
+ model.cc \
+ model_callbacks.cc \
+ model_fiducial.cc \
+ model_laser.cc \
+ model_load.cc \
+ model_position.cc \
+ model_ranger.cc \
+ model_blobfinder.cc \
+ model_props.cc \
+ stage.cc \
+ stage.hh \
+ stage_internal.hh \
+ typetable.cc \
+ world.cc \
+ worldfile.cc \
+ worldfile.hh \
+ worldgui.cc
+
+
+#logo.cc
+libstage_la_LDFLAGS = -version-info 3:1:0 -rpath $(libdir)
+libstage_la_LIBADD = -L/opt/local/lib -lgdk_pixbuf-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -L/opt/local/lib -lfltk_images -lfltk_png -lz -lfltk_jpeg -lfltk_gl -framework AGL -framework OpenGL -lfltk -framework Carbon -framework ApplicationServices
+stest_DEPENDENCIES = libstage.la
+stest_SOURCES = stest.cc
+stest_LDADD = libstage.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libstage/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu libstage/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libstage.la: $(libstage_la_OBJECTS) $(libstage_la_DEPENDENCIES)
+ $(libstage_la_LINK) -rpath $(libdir) $(libstage_la_OBJECTS) $(libstage_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+stest$(EXEEXT): $(stest_OBJECTS) $(stest_DEPENDENCIES)
+ @rm -f stest$(EXEEXT)
+ $(CXXLINK) $(stest_OBJECTS) $(stest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/ancestor.Plo
+include ./$(DEPDIR)/block.Plo
+include ./$(DEPDIR)/blockgrid.Plo
+include ./$(DEPDIR)/canvas.Plo
+include ./$(DEPDIR)/glcolorstack.Plo
+include ./$(DEPDIR)/model.Plo
+include ./$(DEPDIR)/model_blobfinder.Plo
+include ./$(DEPDIR)/model_callbacks.Plo
+include ./$(DEPDIR)/model_fiducial.Plo
+include ./$(DEPDIR)/model_laser.Plo
+include ./$(DEPDIR)/model_load.Plo
+include ./$(DEPDIR)/model_position.Plo
+include ./$(DEPDIR)/model_props.Plo
+include ./$(DEPDIR)/model_ranger.Plo
+include ./$(DEPDIR)/stage.Plo
+include ./$(DEPDIR)/stest.Po
+include ./$(DEPDIR)/typetable.Plo
+include ./$(DEPDIR)/world.Plo
+include ./$(DEPDIR)/worldfile.Plo
+include ./$(DEPDIR)/worldgui.Plo
+
+.cc.o:
+ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+# source='$<' object='$@' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pkgdataDATA: $(pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+
+uninstall-pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS)
+install-binPROGRAMS: install-libLTLIBRARIES
+
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS install-pkgdataDATA
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
+ uninstall-libLTLIBRARIES uninstall-pkgdataDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libLTLIBRARIES clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-includeHEADERS install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-pkgdataDATA install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+ uninstall-pkgdataDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
View
57 libstage/Makefile.am
@@ -0,0 +1,57 @@
+
+# Automake script to build Stage's Makefile
+#
+# RTV 20021026
+# $Id: Makefile.am,v 1.2 2008-01-15 01:16:49 rtv Exp $
+
+# install the header file for the Stage library
+include_HEADERS = stage.hh
+
+# install the color database
+pkgdata_DATA = rgb.txt
+
+RGB=$(datadir)/@PACKAGE@/rgb.txt
+
+# system-wide compile flags - target-specific flags are added to each target below
+AM_CPPFLAGS = -Wall -I. -I$(top_srcdir)/replace @PIXBUF_CFLAGS@ @FLTK_CFLAGS@ -DRGBFILE=\"$(RGB)\"
+
+# build the stage library
+lib_LTLIBRARIES = libstage.la
+
+# The stage library
+libstage_la_SOURCES = \
+ ../config.h \
+ ancestor.cc \
+ block.cc \
+ blockgrid.cc \
+ canvas.cc \
+ colors.h \
+ glcolorstack.cc \
+ model.cc \
+ model_callbacks.cc \
+ model_fiducial.cc \
+ model_laser.cc \
+ model_load.cc \
+ model_position.cc \
+ model_ranger.cc \
+ model_blobfinder.cc \
+ model_props.cc \
+ stage.cc \
+ stage.hh \
+ stage_internal.hh \
+ typetable.cc \
+ world.cc \
+ worldfile.cc \
+ worldfile.hh \
+ worldgui.cc
+
+#logo.cc
+libstage_la_LDFLAGS = -version-info 3:1:0 -rpath $(libdir)
+libstage_la_LIBADD = @PIXBUF_LIBS@ @FLTK_LIBS@
+
+# build stest, a stand-alone test binary using the stage library,
+bin_PROGRAMS = stest
+stest_DEPENDENCIES = libstage.la
+stest_SOURCES = stest.cc
+stest_LDADD = libstage.la
+
View
40 libstage/Makefile.fl
@@ -0,0 +1,40 @@
+HEADERS = \
+ ../config.h \
+ colors.h \
+ stage.hh \
+ worldfile.hh
+
+CC = g++
+
+OBS = \
+ ancestor.o \
+ block.o \
+ blockgrid.o \
+ canvas.o \
+ glcolorstack.o \
+ model.o \
+ model_callbacks.o \
+ model_laser.o \
+ model_load.o \
+ model_position.o \
+ model_props.o \
+ model_ranger.o \
+ stest.o \
+ stage.o \
+ typetable.o \
+ world.o \
+ worldfile.o \
+ worldgui.o
+
+CPPFLAGS= -g -Wall -I.. -I../replace -I/System/Library/Frameworks/OpenGL.framework/Headers `fltk-config --use-gl --cflags` `pkg-config --cflags glib-2.0 gdk-pixbuf-2.0`
+LIBS= `fltk-config --use-gl --ldflags` `pkg-config --libs gdk-pixbuf-2.0` -framework OpenGL
+
+
+all: stagefl
+
+stagefl: $(OBS) $(HEADERS)
+ g++ -o $@ $(CPPFLAGS) $(OBS) $(LIBS)
+
+clean :
+ rm -f *.o *.lo
+
View
48 libstage/Makefile.manual
@@ -0,0 +1,48 @@
+
+HDR = \
+ ../config.h \
+ colors.h \
+ stage.hh \
+ stage_internalmake.hh \
+ worldfile.hh
+
+SRC = \
+ ancestor.cc \
+ block.cc \
+ blockgrid.cc \
+ canvas.cc \
+ glcolorstack.cc \
+ model.cc \
+ model_callbacks.cc \
+ model_ranger.cc \
+ model_blobfinder.cc \
+ model_laser.cc \
+ model_fiducial.cc \
+ model_load.cc \
+ model_position.cc \
+ model_props.cc \
+ stest.cc \
+ stage.cc \
+ typetable.cc \
+ world.cc \
+ worldfile.cc \
+ worldgui.cc
+
+
+
+CXXFLAGS+= -g -Wall -I.. -I../replace `fltk-config --use-gl --use-images --cflags` `pkg-config --cflags glib-2.0 gdk-pixbuf-2.0`
+LIBS= `fltk-config --use-gl --use-images --ldflags` `pkg-config --libs gdk-pixbuf-2.0` -framework OpenGL
+
+OBJ=$(SRC:.cc=.o)
+
+all: stage
+
+.cc.o:
+ g++ $(CXXFLAGS) -c $<
+
+stage: $(OBJ)
+ g++ $(LIBS) $(OBJ) -o $@
+
+clean :
+ rm -f *.o *.lo stage
+
View
55 libstage/ancestor.cc
@@ -0,0 +1,55 @@
+#include "stage_internal.hh"
+
+StgAncestor::StgAncestor()
+{
+ token = NULL;
+ children = NULL;
+ child_types = g_hash_table_new( g_str_hash, g_str_equal );
+ debug = false;
+}
+
+StgAncestor::~StgAncestor()
+{
+ if( children )
+ {
+ for( GList* it = children; it; it=it->next )
+ delete (StgModel*)it->data;
+
+ g_list_free( children );
+ }
+
+ g_hash_table_destroy( child_types );
+}
+
+unsigned int StgAncestor::GetNumChildrenOfType( const char* typestr )
+{
+ return (unsigned int)g_hash_table_lookup( child_types, typestr);
+}
+
+void StgAncestor::SetNumChildrenOfType( const char* typestr, unsigned int count )
+{
+ g_hash_table_insert( child_types, (gpointer)typestr, (gpointer)count);
+}
+
+void StgAncestor::AddChild( StgModel* mod )
+{
+ // increment the count of models of this type
+ unsigned int count = GetNumChildrenOfType( mod->typestr );
+ SetNumChildrenOfType( mod->typestr, ++count );
+
+ // store as a child
+ children = g_list_append( children, mod );
+}
+
+void StgAncestor::RemoveChild( StgModel* mod )
+{
+ puts( "TODO: StgWorld::RemoveChild()" );
+}
+
+stg_pose_t StgAncestor::GetGlobalPose()
+{
+ stg_pose_t pose;
+ bzero( &pose, sizeof(pose));
+ return pose;
+}
+
View
293 libstage/block.cc
@@ -0,0 +1,293 @@
+//#define DEBUG 1
+#include "stage_internal.hh"
+
+/** Create a new block. A model's body is a list of these
+ blocks. The point data is copied, so pts can safely be freed
+ after calling this.*/
+StgBlock::StgBlock( StgModel* mod,
+ stg_point_t* pts,
+ size_t pt_count,
+ stg_meters_t zmin,
+ stg_meters_t zmax,
+ stg_color_t color,
+ bool inherit_color )
+{
+ this->mod = mod;
+ this->pt_count = pt_count;
+ this->pts = (stg_point_t*)g_memdup( pts, pt_count * sizeof(stg_point_t));
+ // allocate space for the integer version of the block vertices
+ this->pts_global = new stg_point_int_t[pt_count];
+ this->zmin = zmin;
+ this->zmax = zmax;
+ this->color = color;
+ this->inherit_color = inherit_color;
+ this->rendered_points = g_array_new( FALSE, FALSE, sizeof(stg_point_int_t));
+
+ // flag these as unset until StgBlock::Map() is called.
+ this->global_zmin = -1;
+ this->global_zmax = -1;
+}
+
+StgBlock::~StgBlock()
+{
+ this->UnMap();
+ g_free( pts );
+ g_array_free( rendered_points, TRUE );
+}
+
+void Stg::stg_block_list_destroy( GList* list )
+{
+ GList* it;
+ for( it=list; it; it=it->next )
+ delete (StgBlock*)it->data;
+ g_list_free( list );
+}
+
+
+void StgBlock::DrawTop()
+{
+ // draw a top that fits over the side strip
+ glBegin(GL_POLYGON);
+
+ for( unsigned int p=0; p<pt_count; p++ )
+ glVertex3f( pts[p].x, pts[p].y, zmax );
+
+ glEnd();
+}
+
+void StgBlock::DrawSides()
+{
+ // construct a strip that wraps around the polygon
+
+ glBegin(GL_QUAD_STRIP);
+ for( unsigned int p=0; p<pt_count; p++)
+ {
+ glVertex3f( pts[p].x, pts[p].y, zmax );
+ glVertex3f( pts[p].x, pts[p].y, zmin );
+ }
+ // close the strip
+ glVertex3f( pts[0].x, pts[0].y, zmax );
+ glVertex3f( pts[0].x, pts[0].y, zmin );
+ glEnd();
+}
+
+void StgBlock::DrawFootPrint()
+{
+ glBegin(GL_POLYGON);
+
+ for( unsigned int p=0; p<pt_count; p++ )
+ glVertex2f( pts[p].x, pts[p].y );
+
+ glEnd();
+}
+
+void StgBlock::Draw()
+{
+ // draw filled color polygons
+ stg_color_t color = Color();
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL );
+ PushColor( color );
+ glEnable(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(1.0, 1.0);
+ DrawSides();
+ DrawTop();
+ glDisable(GL_POLYGON_OFFSET_FILL);
+
+ // draw the block outline in a darker version of the same color
+ double r,g,b,a;
+ stg_color_unpack( color, &r, &g, &b, &a );
+ PushColor( stg_color_pack( r/2.0, g/2.0, b/2.0, a ));
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE );
+ glDepthMask(GL_FALSE);
+ DrawTop();
+ DrawSides();
+ glDepthMask(GL_TRUE);
+
+ PopColor();
+ PopColor();
+}
+
+void StgBlock::Draw2D()
+{
+ // draw filled color polygons
+ stg_color_t color = Color();
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL );
+ PushColor( color );
+ glEnable(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(1.0, 1.0);
+ //DrawSides();
+ DrawTop();
+ glDisable(GL_POLYGON_OFFSET_FILL);
+
+ // draw the block outline in a darker version of the same color
+ double r,g,b,a;
+ stg_color_unpack( color, &r, &g, &b, &a );
+ PushColor( stg_color_pack( r/2.0, g/2.0, b/2.0, a ));
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE );
+ glDepthMask(GL_FALSE);
+ DrawTop();
+ //DrawSides();
+ glDepthMask(GL_TRUE);
+
+ PopColor();
+ PopColor();
+}
+
+
+void StgBlock::DrawSolid( void )
+{
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL );
+ DrawSides();
+ DrawTop();
+}
+
+void StgBlock::Map()
+{
+ PRINT_DEBUG2( "%s mapping block with %d points",
+ mod->Token(),
+ (int)pt_count );
+
+ double ppm = mod->World()->ppm;
+
+ // update the global coordinate list
+ stg_pose_t gpose;
+ bzero(&gpose,sizeof(gpose));
+
+ for( unsigned int p=0; p<pt_count; p++ )
+ {
+ gpose.x = pts[p].x;
+ gpose.y = pts[p].y;
+ gpose.z = zmin;
+
+ mod->LocalToGlobal( &gpose );
+
+ pts_global[p].x = (int32_t)floor((gpose.x+mod->World()->width/2.0)*ppm);
+ pts_global[p].y = (int32_t)floor((gpose.y+mod->World()->height/2.0)*ppm);
+
+ PRINT_DEBUG2("loc [%.2f %.2f]",
+ pts[p].x,
+ pts[p].y );
+
+ PRINT_DEBUG2("glb [%d %d]",
+ pts_global[p].x,
+ pts_global[p].y );
+ }
+
+ // store the block's global vertical bounds for inspection by the
+ // raytracer
+ global_zmin = gpose.z;
+ global_zmax = gpose.z + (zmax-zmin);
+
+ stg_render_info_t render_info;
+ render_info.world = mod->World();
+ render_info.block = this;
+
+ stg_polygon_3d( pts_global, pt_count,
+ (stg_line3d_func_t)StgWorld::AddBlockPixel,
+ (void*)&render_info );
+
+}
+
+void StgBlock::UnMap()
+{
+ PRINT_DEBUG2( "UnMapping block of model %s with %d points",
+ mod->Token(),
+ (int)pt_count);
+
+ for( unsigned int p=0; p<rendered_points->len; p++ )
+ {
+ stg_point_int_t* pt =
+ &g_array_index( rendered_points, stg_point_int_t, p);
+
+ mod->World()->RemoveBlock( pt->x, pt->y, this );
+
+ }
+
+ // forget the points we have unrendered (but keep their storage)
+ g_array_set_size( rendered_points,0 );
+}
+
+void StgBlock::RecordRenderPoint( uint32_t x, uint32_t y )
+{
+ // store this index in the block for later fast deletion
+ stg_point_int_t pt;
+ pt.x = x;
+ pt.y = y;
+ g_array_append_val( rendered_points, pt );
+}
+
+
+void StgBlock::ScaleList( GList* blocks,
+ stg_size_t* size )
+{
+ if( g_list_length( blocks ) < 1 )
+ return;
+
+ // assuming the blocks currently fit in a square +/- one billion units
+ double minx, miny, maxx, maxy;
+ minx = miny = billion;
+ maxx = maxy = -billion;
+
+ double maxz = 0;
+
+ GList* it;
+ for( it=blocks; it; it=it->next ) // examine all the blocks
+ {
+ // examine all the points in the polygon
+ StgBlock* block = (StgBlock*)it->data;
+
+ block->UnMap();
+
+ for( unsigned int p=0; p < block->pt_count; p++ )
+ {
+ stg_point_t* pt = &block->pts[p];
+ if( pt->x < minx ) minx = pt->x;
+ if( pt->y < miny ) miny = pt->y;
+ if( pt->x > maxx ) maxx = pt->x;
+ if( pt->y > maxy ) maxy = pt->y;
+
+ assert( ! isnan( pt->x ) );
+ assert( ! isnan( pt->y ) );
+ }
+
+
+ if( block->zmax > maxz )
+ maxz = block->zmax;
+ }
+
+ // now normalize all lengths so that the lines all fit inside
+ // the specified rectangle
+ double scalex = (maxx - minx);
+ double scaley = (maxy - miny);
+
+ double scalez = size->z / maxz;
+
+ for( it=blocks; it; it=it->next ) // examine all the blocks again
+ {
+ StgBlock* block = (StgBlock*)it->data;
+
+ // scale all the points in the block
+ // TODO - scaling data in the block instead?
+ for( unsigned int p=0; p < block->pt_count; p++ )
+ {
+ stg_point_t* pt = &block->pts[p];
+
+ pt->x = ((pt->x - minx) / scalex * size->x) - size->x/2.0;
+ pt->y = ((pt->y - miny) / scaley * size->y) - size->y/2.0;
+
+ assert( ! isnan( pt->x ) );
+ assert( ! isnan( pt->y ) );
+ }
+
+ // todo - scale min properly
+ block->zmax *= scalez;
+ block->zmin *= scalez;
+
+ //block->Map();
+ }
+}
+
View
168 libstage/blockgrid.cc
@@ -0,0 +1,168 @@
+#include "stage_internal.hh"
+
+// todo - get rid of constants in code, so that these are just
+// defaults
+const uint32_t NBITS = 5;
+const uint32_t NSIZE = 1<<NBITS;
+const uint32_t NSQR = NSIZE*NSIZE;
+const uint32_t MASK = NSIZE-1;
+
+StgBlockGrid::StgBlockGrid( uint32_t width, uint32_t height )
+{
+ this->numbits = NBITS;
+ this->width = width;
+ this->height = height;
+
+ this->bwidth = width >> NBITS;
+ this->bheight = height >> NBITS;
+
+ //printf( "Creating StgBlockGrid of [%u,%u](%u,%u) elements\n",
+ // width, height, bwidth, bheight );
+
+ trashstack = NULL;
+
+ size_t bbs = bwidth * bheight;
+ this->map = new stg_bigblock_t[ bbs ];
+ bzero( map, sizeof(stg_bigblock_t)*bbs );
+}
+
+StgBlockGrid::~StgBlockGrid()
+{
+ for( uint32_t x=0; x<bwidth; x++ )
+ for( uint32_t y=0; y<bheight; y++ )
+ {
+ stg_bigblock_t* bb = &map[ x + y*bwidth ];
+
+ if( bb && bb->lists )
+ delete[] bb->lists;
+ }
+
+ delete[] map;
+}
+
+void StgBlockGrid::AddBlock( uint32_t x, uint32_t y, StgBlock* block )
+{
+ if( x < width && y < height )
+ {
+ uint32_t a = x>>NBITS;
+ uint32_t b = y>>NBITS;
+
+ stg_bigblock_t* bb = &map[ a + b*bwidth ];
+ assert(bb); // it really should be there
+
+ if( bb->lists == NULL )
+ {
+ assert( bb->counter == 0 );
+
+ if( g_trash_stack_peek( &trashstack ) )
+ {
+ bb->lists = (GSList**)g_trash_stack_pop( &trashstack );
+ //printf( "recycled %p\n", bb->lists );
+ }
+ else
+ {
+ bb->lists = new GSList*[ NSQR ];
+ //printf( "alloced %p\n", bb->lists );
+ }
+
+ bzero( bb->lists, NSQR * sizeof(GSList*));
+ }
+
+ bb->counter++;
+
+ // use only the NBITS least significant bits of the address
+ uint32_t index = (x&MASK) + (y&MASK)*NSIZE;
+ bb->lists[index] = g_slist_prepend( bb->lists[index], block );
+
+ block->RecordRenderPoint( x, y );
+ }
+}
+
+void StgBlockGrid::RemoveBlock( uint32_t x, uint32_t y, StgBlock* block )
+{
+ //printf( "remove block %u %u\n", x, y );
+
+ if( x < width && y < height )
+ {
+ uint32_t a = x>>NBITS;
+ uint32_t b = y>>NBITS;
+
+ stg_bigblock_t* bb = &map[ a + b*bwidth ];
+ assert( bb ); // it really should be there
+
+ // remove list entry
+ uint32_t index = (x&MASK) + (y&MASK)*NSIZE;
+ assert( bb->lists[index] );
+ bb->lists[index] = g_slist_remove( bb->lists[index], block );
+
+ assert( bb->counter > 0 );
+ bb->counter--;
+
+ if( bb->counter == 0 ) // this was the last entry in this block;
+ {
+ g_trash_stack_push( &trashstack, bb->lists );
+ //printf( "pushed %p\n", bb->lists );
+ bb->lists = NULL;
+ }
+ }
+}
+
+uint32_t StgBlockGrid::BigBlockOccupancy( uint32_t bbx, uint32_t bby )
+{
+ //glRecti( bbx<<NBITS, bby<<NBITS,(bbx+1)<<NBITS,(bby+1)<<NBITS );
+ return map[ bbx + bby*bwidth].counter;
+}
+
+GSList* StgBlockGrid::GetList( uint32_t x, uint32_t y )
+{
+ if( x < width && y < height )
+ {
+ uint32_t a = x>>NBITS;
+ uint32_t b = y>>NBITS;
+
+ stg_bigblock_t* bb = &map[ a + b*bwidth ];
+
+ if( bb->lists )
+ {
+ //glRecti( x,y,x+1,y+1 );
+
+ assert( bb->counter > 0 );
+ uint32_t index = (x&MASK) + (y&MASK)*NSIZE;
+ return bb->lists[index];
+ }
+ }
+ return NULL;
+}
+
+void StgBlockGrid::GlobalRemoveBlock( StgBlock* block )
+{
+ for( uint32_t x=0; x<width; x++ )
+ for( uint32_t y=0; y<height; y++ )
+ RemoveBlock(x,y,block );
+}
+
+void StgBlockGrid::Draw( bool drawall )
+{
+ for( uint32_t x=0; x<bwidth; x++ )
+ for( uint32_t y=0; y<bheight; y++ )
+ {
+ stg_bigblock_t* bb = &map[ x + y*bwidth ];
+
+ if( drawall || bb->lists )
+ {
+ glRecti( x<<NBITS,y<<NBITS,(x+1)<<NBITS,(y+1)<<NBITS );
+
+ if( bb->lists )
+ for( uint32_t a=0; a<NSQR; a++ )
+ {
+ if( drawall || bb->lists[ a ] )
+ glRecti( (x<<NBITS)+a%NSIZE,
+ (y<<NBITS)+a/NSIZE,
+ (x<<NBITS)+a%NSIZE+1,
+ (y<<NBITS)+a/NSIZE+1 );
+
+ }
+ }
+ }
+}
+
View
520 libstage/canvas.cc
@@ -0,0 +1,520 @@
+#include "stage_internal.hh"
+
+void StgCanvas::TimerCallback( StgCanvas* c )
+{
+ c->redraw();
+
+ Fl::repeat_timeout(((double)c->interval/1000),
+ (Fl_Timeout_Handler)StgCanvas::TimerCallback,
+ c);
+}
+
+
+StgCanvas::StgCanvas( StgWorld* world, int x, int y, int w, int h)
+ : Fl_Gl_Window(x,y,w,h)
+{
+ end();
+ show(); // must do this so that the GL context is created before configuring GL
+
+ this->world = world;
+ selected_models = NULL;
+ last_selection = NULL;
+
+ startx = starty = 0;
+ panx = pany = stheta = sphi = 0.0;
+ scale = 15.0;
+ interval = 100; //msec between redraws
+
+ graphics = true;
+ dragging = false;
+ rotating = false;
+
+ showflags = STG_SHOW_CLOCK | STG_SHOW_BLOCKS | STG_SHOW_GRID;
+
+ // start the timer that causes regular redraws
+ Fl::add_timeout( ((double)interval/1000),
+ (Fl_Timeout_Handler)StgCanvas::TimerCallback,
+ this);
+ }
+
+StgCanvas::~StgCanvas()
+{
+}
+
+void StgCanvas::InvertView( uint32_t invertflags )
+{
+ showflags = (showflags ^ invertflags);
+
+// printf( "flags %u data %d grid %d blocks %d follow %d clock %d tree %d occ %d\n",
+// showflags,
+// showflags & STG_SHOW_DATA,
+// showflags & STG_SHOW_GRID,
+// showflags & STG_SHOW_BLOCKS,
+// showflags & STG_SHOW_FOLLOW,
+// showflags & STG_SHOW_CLOCK,
+// showflags & STG_SHOW_QUADTREE,
+// showflags & STG_SHOW_OCCUPANCY );
+}
+
+StgModel* StgCanvas::Select( int x, int y )
+{
+ // render all models in a unique color
+ make_current(); // make sure the GL context is current
+ glClearColor ( 0,0,0,1 );
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+ glDisable(GL_DITHER);
+
+ // render all top-level, draggable models in a color that is their
+ // id + a 100% alpha value
+ for( GList* it=world->children; it; it=it->next )
+ {
+ StgModel* mod = (StgModel*)it->data;
+
+ if( mod->GuiMask() & (STG_MOVE_TRANS | STG_MOVE_ROT ))
+ {
+ uint32_t col = (mod->Id() | 0xFF000000);
+ glColor4ubv( (GLubyte*)&col );
+ mod->DrawPicker();
+ }
+ }
+
+ // read the color of the pixel in the back buffer under the mouse
+ // pointer
+ GLint viewport[4];
+ glGetIntegerv(GL_VIEWPORT,viewport);
+
+ uint32_t id;
+ glReadPixels( x,viewport[3]-y,1,1,
+ GL_RGBA,GL_UNSIGNED_BYTE,(void*)&id );
+
+ // strip off the alpha channel byte to retrieve the model id
+ id &= 0x00FFFFFF;
+
+ StgModel* mod = world->GetModel( id );
+
+ //printf("%p %s %d\n", mod, mod ? mod->Token() : "", id );
+
+ glEnable(GL_DITHER);
+ glClearColor ( 0.7, 0.7, 0.8, 1.0);
+
+ if( mod ) // we clicked on a root model
+ {
+ // if it's already selected
+ if( GList* link = g_list_find( selected_models, mod ) )
+ {
+ // remove it from the selected list
+ selected_models =
+ g_list_remove_link( selected_models, link );
+
+ mod->Disable();
+ }
+ else
+ {
+ last_selection = mod;
+ selected_models = g_list_prepend( selected_models, mod );
+ mod->Enable();
+ }
+
+ invalidate();
+ }
+
+ return mod;
+}
+
+// convert from 2d window pixel to 3d world coordinates
+void StgCanvas::CanvasToWorld( int px, int py,
+ double *wx, double *wy, double* wz )
+{
+ int viewport[4];
+ glGetIntegerv(GL_VIEWPORT, viewport);
+
+ GLdouble modelview[16];
+ glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
+
+ GLdouble projection[16];
+ glGetDoublev(GL_PROJECTION_MATRIX, projection);
+
+ GLfloat pz;
+ glReadPixels( px, h()-py, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &pz );
+ gluUnProject( px, w()-py, pz, modelview, projection, viewport, wx,wy,wz );
+}
+
+int StgCanvas::handle(int event)
+{
+
+ switch(event)
+ {
+ case FL_MOUSEWHEEL:
+ if( selected_models )
+ {
+ // rotate all selected models
+ for( GList* it = selected_models; it; it=it->next )
+ {
+ StgModel* mod = (StgModel*)it->data;
+ mod->AddToPose( 0,0,0, 0.1*(double)Fl::event_dy() );
+ }
+ redraw();
+ }
+ else
+ {
+ //scale -= 0.5 * (double)Fl::event_dy();
+ scale -= 0.5 * (double)Fl::event_dy();
+ if( scale < 1 )
+ scale = 1;
+
+ invalidate();
+ }
+ return 1;
+
+ case FL_MOVE: // moused moved while no button was pressed
+ if( Fl::event_state( FL_CTRL ) )
+ {
+ int dx = Fl::event_x() - startx;
+ int dy = Fl::event_y() - starty;
+
+ stheta -= 0.01 * (double)dy;
+ sphi += 0.01 * (double)dx;
+ stheta = constrain( stheta, 0, M_PI/2.0 );
+ invalidate();
+ }
+ else if( Fl::event_state( FL_ALT ) )
+ {
+ int dx = Fl::event_x() - startx;
+ int dy = Fl::event_y() - starty;
+
+ panx -= dx;
+ pany += dy;
+ invalidate();
+ }
+
+ startx = Fl::event_x();
+ starty = Fl::event_y();
+ return 1;
+
+ case FL_PUSH: // button pressed
+ switch( Fl::event_button() )
+ {
+ case 1:
+ startx = Fl::event_x();
+ starty = Fl::event_y();
+ if( Select( startx, starty ) )
+ dragging = true;
+ return 1;
+ case 3:
+ {
+ puts( "button 3" );
+ startx = Fl::event_x();
+ starty = Fl::event_y();
+ if( Select( startx, starty ) )
+ {
+ printf( "rotating" );
+ rotating = true;
+ }
+ return 1;
+ }
+ default:
+ return 0;
+ }
+
+ case FL_DRAG: // mouse moved while button was pressed
+ {
+ int dx = Fl::event_x() - startx;
+ int dy = Fl::event_y() - starty;
+
+ switch( Fl::event_button() )
+ {
+ case 1:
+ if( dragging )
+ {
+ assert(selected_models);
+
+ double sx,sy,sz;
+ CanvasToWorld( startx, starty,
+ &sx, &sy, &sz );
+ double x,y,z;
+ CanvasToWorld( Fl::event_x(), Fl::event_y(),
+ &x, &y, &z );
+
+ // move all selected models to the mouse pointer
+ for( GList* it = selected_models; it; it=it->next )
+ {
+ StgModel* mod = (StgModel*)it->data;
+ mod->AddToPose( x-sx, y-sy, 0, 0 );
+ }
+ }
+ else
+ {
+ panx -= dx;
+ pany += dy;
+ invalidate(); // so the projection gets updated
+ }
+ break;
+ case 3: // right button
+ if( rotating )
+ {
+ // move all selected models to the mouse pointer
+ for( GList* it = selected_models; it; it=it->next )
+ {
+ StgModel* mod = (StgModel*)it->data;
+ mod->AddToPose( 0,0,0, 0.05*dx );
+ }
+ }
+ break;
+ }
+ }
+ startx = Fl::event_x();
+ starty = Fl::event_y();
+ return 1; // end case FL_DRAG
+
+ case FL_RELEASE: // mouse button released
+ // unselect everyone unless shift is pressed
+ if( ! Fl::event_state( FL_SHIFT ) )
+ {
+ for( GList* it=selected_models; it; it=it->next )
+ ((StgModel*)it->data)->Enable();
+
+ g_list_free( selected_models );
+ selected_models = NULL;
+ dragging = false;
+ rotating = false;
+ redraw();
+ }
+ return 1;
+ case FL_FOCUS :
+ case FL_UNFOCUS :
+ //.... Return 1 if you want keyboard events, 0 otherwise
+ return 1;
+ case FL_KEYBOARD:
+ switch( Fl::event_key() )
+ {
+ case 'p': // pause
+ world->TogglePause();
+ break;
+ case ' ': // space bar
+ sphi = stheta = 0.0;
+ invalidate();
+ break;
+ case FL_Left: panx += 10; break;
+ case FL_Right: panx -= 10; break;
+ case FL_Down: pany += 10; break;
+ case FL_Up: pany -= 10; break;
+ default:
+ return 0; // keypress unhandled
+ }
+ invalidate(); // update projection
+ return 1;
+ //case FL_SHORTCUT:
+ ///... shortcut, key is in Fl::event_key(), ascii in Fl::event_text()
+ // ... Return 1 if you understand/use the shortcut event, 0 otherwise...
+ //return 1;
+ default:
+ // pass other events to the base class...
+ //printf( "EVENT %d\n", event );
+ return Fl_Gl_Window::handle(event);
+ }
+}
+
+void StgCanvas::FixViewport(int W,int H)
+{
+ glLoadIdentity();
+ glViewport(0,0,W,H);
+}
+
+void StgCanvas::draw()
+{
+ // static int centerx = 0, centery = 0;
+
+ if (!valid())
+ {
+ valid(1);
+ FixViewport(w(), h());
+
+ // set gl state that won't change every redraw
+ glClearColor ( 0.7, 0.7, 0.8, 1.0);
+ glDisable(GL_LIGHTING);
+ glEnable (GL_DEPTH_TEST);
+ glDepthFunc (GL_LESS);
+ glCullFace( GL_BACK );
+ glEnable (GL_CULL_FACE);
+ glEnable( GL_BLEND );
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glEnable( GL_LINE_SMOOTH );
+ glHint (GL_LINE_SMOOTH_HINT, GL_FASTEST);
+ glDepthMask(GL_TRUE);
+
+ // install a font
+ gl_font( FL_HELVETICA, 12 );
+
+ double zclip = hypot(world->Width(), world->Height()) * scale;
+ double pixels_width = w();
+ double pixels_height = h();
+
+ // map the viewport to pixel units by scaling it the same as the window
+ glMatrixMode (GL_PROJECTION);
+ glLoadIdentity ();
+
+
+ glOrtho( -pixels_width/2.0, pixels_width/2.0,
+ -pixels_height/2.0, pixels_height/2.0,
+ -zclip, zclip );
+
+ // set the modelview matrix
+ glMatrixMode (GL_MODELVIEW);
+ glLoadIdentity ();
+
+ // move the next two lines...
+ glScalef( scale, scale, scale );
+ glTranslatef( -panx/scale, -pany/scale, 0 );
+
+ glRotatef( rtod(-stheta), fabs(cos(sphi)), 0, 0 );
+ glRotatef( rtod(sphi), 0,0,1 ); // rotate about z - yaw
+
+ // ... to here to get rotation about the center of the window (but broken panning)
+ }
+
+ // Clear screen to bg color
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ if( showflags & STG_SHOW_CLOCK )
+ {
+ glPushMatrix();
+ glLoadIdentity();
+
+ char clockstr[50];
+ world->ClockString( clockstr, 50 );
+
+ colorstack.Push( 0,0,0 ); // black
+ gl_draw_string( -w()/2+4, -h()/2+4, 0, clockstr );
+ colorstack.Pop();
+
+ glPopMatrix();
+ }
+
+
+ // if following selected, shift the view to above the selected robot
+ if( (showflags & STG_SHOW_FOLLOW) && last_selection )
+ {
+ glLoadIdentity ();
+ double zclip = hypot(world->Width(), world->Height()) * scale;
+ glTranslatef( 0,0,
+ -zclip / 2.0 );
+
+ // meter scale
+ glScalef ( scale, scale, scale ); // zoom
+
+ stg_pose_t gpose = last_selection->GetGlobalPose();
+
+ // and put it in the center of the window
+ //glRotatef( -rtod(gpose.a), 0,0,1 );
+ glTranslatef( -gpose.x, -gpose.y, 0 );
+
+ }
+
+ // draw the world size rectangle in white, using the polygon offset
+ // so it doesn't z-fight with the models
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glEnable(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(1.0, 1.0);
+ glColor3f( 1,1,1 );
+ glRectf( -world->Width()/2.0, -world->Height()/2.0,
+ world->Width()/2.0, world->Height()/2.0 );
+ glDisable(GL_POLYGON_OFFSET_FILL);
+
+ if( (showflags & STG_SHOW_QUADTREE) || (showflags & STG_SHOW_OCCUPANCY) )
+ {
+ glDisable( GL_LINE_SMOOTH );
+ glLineWidth( 1 );
+
+ glPushMatrix();
+ glTranslatef( -world->Width()/2.0, -world->Height()/2.0, 1 );
+ glScalef( 1.0/world->Resolution(), 1.0/world->Resolution(), 0 );
+ glPolygonMode( GL_FRONT, GL_LINE );
+ colorstack.Push(1,0,0);
+
+ if( showflags & STG_SHOW_OCCUPANCY )
+ ((StgWorldGui*)world)->GetBlockGrid()->Draw( false );
+
+ if( showflags & STG_SHOW_QUADTREE )
+ ((StgWorldGui*)world)->GetBlockGrid()->Draw( true );
+
+ colorstack.Pop();
+ glPopMatrix();
+
+ glEnable( GL_LINE_SMOOTH );
+ }
+
+ for( GList* it=selected_models; it; it=it->next )
+ ((StgModel*)it->data)->DrawSelected();
+
+ // draw the models
+ if( showflags ) // if any bits are set there's something to draw
+ {
+ if( showflags & STG_SHOW_FOOTPRINT )
+ {
+ glDisable( GL_DEPTH_TEST );
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL );
+
+ for( GList* it=world->children; it; it=it->next )
+ {
+ ((StgModel*)it->data)->DrawTrailFootprint();
+ }
+ glEnable( GL_DEPTH_TEST );
+ }
+
+ if( showflags & STG_SHOW_TRAILS )
+ {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL );
+
+ for( GList* it=world->children; it; it=it->next )
+ {
+ ((StgModel*)it->data)->DrawTrailBlocks();
+ }
+ }
+
+ if( showflags & STG_SHOW_ARROWS )
+ {
+ glEnable( GL_DEPTH_TEST );
+ for( GList* it=world->children; it; it=it->next )
+ {
+ ((StgModel*)it->data)->DrawTrailArrows();
+ }
+ }
+
+ if( showflags & STG_SHOW_BLOCKS )
+ for( GList* it=world->children; it; it=it->next )
+ {
+ uint32_t flags = showflags;
+
+ if( (stheta == 0) && (sphi == 0) )
+ flags |= STG_SHOW_BLOCKS_2D;
+
+ ((StgModel*)it->data)->Draw( flags );
+ }
+ }
+
+ if( world->GetRayList() )
+ {
+ glDisable( GL_DEPTH_TEST );
+ PushColor( 0,0,0,0.5 );
+ for( GList* it = world->GetRayList(); it; it=it->next )
+ {
+ float* pts = (float*)it->data;
+ glBegin( GL_LINES );
+ glVertex2f( pts[0], pts[1] );
+ glVertex2f( pts[2], pts[3] );
+ glEnd();
+ }
+ PopColor();
+ glEnable( GL_DEPTH_TEST );
+
+ world->ClearRays();
+ }
+}
+
+void StgCanvas::resize(int X,int Y,int W,int H)
+{
+ Fl_Gl_Window::resize(X,Y,W,H);
+ FixViewport(W,H);
+ invalidate();
+}
+
View
4 libstage/draw.cc
@@ -0,0 +1,4 @@
+/* Author: Richard Vaughan
+ Date
+#include "stage_internal.hh"
+
View
16 libstage/gl.c
@@ -0,0 +1,16 @@
+#include <gl.h>
+#include "stage.hh"
+
+
+// transform the current coordinate frame by the given pose
+void gl_coord_shift( double x, double y, double z, double a )
+{
+ glTranslatef( x,y,z );
+ glRotatef( RTOD(a), 0,0,1 );
+}
+
+// transform the current coordinate frame by the given pose
+void gl_pose_shift( stg_pose_t* pose )
+{
+ gl_coord_shift( pose->x, pose->y, pose->z, pose->a );
+}
View
74 libstage/glcolorstack.cc
@@ -0,0 +1,74 @@
+#include "stage_internal.hh"
+
+GlColorStack::GlColorStack()
+{
+ colorstack = g_queue_new();
+}
+
+GlColorStack::~GlColorStack()
+{
+
+}
+
+void GlColorStack::Push( GLdouble col[4] )
+{
+ size_t sz = 4 * sizeof(col[0]);
+ GLdouble *keep = (GLdouble*)malloc( sz );
+ memcpy( keep, col, sz );
+
+ g_queue_push_head( colorstack, keep );
+
+ // and select this color in GL
+ glColor4dv( col );
+}
+
+
+void GlColorStack::Push( double r, double g, double b )
+{
+ GLdouble col[4];
+ col[0] = r;
+ col[1] = g;
+ col[2] = b;
+ col[3] = 1.0;
+
+ Push( col );
+}
+
+// a convenience wrapper around push_color()
+void GlColorStack::Push( double r, double g, double b, double a )
+{
+ GLdouble col[4];
+ col[0] = r;
+ col[1] = g;
+ col[2] = b;
+ col[3] = a;
+
+ Push( col );
+}
+
+void GlColorStack::Push( stg_color_t col )
+{
+ GLdouble d[4];
+
+ d[0] = ((col & 0x00FF0000) >> 16) / 256.0;
+ d[1] = ((col & 0x0000FF00) >> 8) / 256.0;
+ d[2] = ((col & 0x000000FF) >> 0) / 256.0;
+ d[3] = (((col & 0xFF000000) >> 24) / 256.0);
+
+ Push( d );
+}
+
+
+// reset GL to the color we stored using store_color()
+void GlColorStack::Pop( void )
+{
+ if( g_queue_is_empty( colorstack ) )
+ PRINT_WARN1( "Attempted to ColorStack.Pop() but ColorStack %p is empty",
+ this );
+ else
+ {
+ GLdouble *col = (GLdouble*)g_queue_pop_head( colorstack );
+ glColor4dv( col );
+ free( col );
+ }
+}
View
377 libstage/glutgraphics.cc
@@ -0,0 +1,377 @@
+/*
+ * Player - One Hell of a Robot Server
+ * glutgraphics.cc: GLUT-based graphics3d + 2d driver
+ * Copyright (C) 2007
+ * Brian Gerkey, Richard Vaughan
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/*
+ * A simple example of how to write a driver that will be built as a
+ * shared object.
+ */
+
+// ONLY if you need something that was #define'd as a result of configure
+// (e.g., HAVE_CFMAKERAW), then #include <config.h>, like so:
+/*
+#if HAVE_CONFIG_H
+ #include <config.h>
+#endif
+*/
+
+#include <unistd.h>
+#include <string.h>
+
+#include <libplayercore/playercore.h>
+
+#include <GLUT/glut.h>
+#include <stdio.h>
+#include <math.h>
+
+
+GLfloat light0_ambient[] =
+{0.2, 0.2, 0.2, 1.0};
+GLfloat light0_diffuse[] =
+{0.0, 0.0, 0.0, 1.0};
+GLfloat light1_diffuse[] =
+{1.0, 0.0, 0.0, 1.0};
+GLfloat light1_position[] =
+{1.0, 1.0, 1.0, 0.0};
+GLfloat light2_diffuse[] =
+{0.0, 1.0, 0.0, 1.0};
+GLfloat light2_position[] =
+{-1.0, -1.0, 1.0, 0.0};
+float s = 0.0;
+GLfloat angle1 = 0.0, angle2 = 0.0;
+
+void
+output(GLfloat x, GLfloat y, char *text)
+{
+ char *p;
+
+ glPushMatrix();
+ glTranslatef(x, y, 0);
+ for (p = text; *p; p++)
+ glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
+ glPopMatrix();
+}
+
+void
+display(void)
+{
+ static GLfloat amb[] =
+ {0.4, 0.4, 0.4, 0.0};
+ static GLfloat dif[] =
+ {1.0, 1.0, 1.0, 0.0};
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glEnable(GL_LIGHT1);
+ glDisable(GL_LIGHT2);
+ amb[3] = dif[3] = cos(s) / 2.0 + 0.5;
+ glMaterialfv(GL_FRONT, GL_AMBIENT, amb);
+ glMaterialfv(GL_FRONT, GL_DIFFUSE, dif);
+
+ glPushMatrix();
+ glTranslatef(-0.3, -0.3, 0.0);
+ glRotatef(angle1, 1.0, 5.0, 0.0);
+ glCallList(1); /* render ico display list */
+ glPopMatrix();
+
+ glClear(GL_DEPTH_BUFFER_BIT);
+ glEnable(GL_LIGHT2);
+ glDisable(GL_LIGHT1);
+ amb[3] = dif[3] = 0.5 - cos(s * .95) / 2.0;
+ glMaterialfv(GL_FRONT, GL_AMBIENT, amb);
+ glMaterialfv(GL_FRONT, GL_DIFFUSE, dif);
+
+ glPushMatrix();
+ glTranslatef(0.3, 0.3, 0.0);
+ glRotatef(angle2, 1.0, 0.0, 5.0);
+ glCallList(1); /* render ico display list */
+ glPopMatrix();
+
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ gluOrtho2D(0, 1500, 0, 1500);
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+ /* Rotate text slightly to help show jaggies. */
+ glRotatef(4, 0.0, 0.0, 1.0);
+ output(200, 225, "This is antialiased.");
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_BLEND);
+ output(160, 100, "This text is not.");
+ glPopMatrix();
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glPopAttrib();
+ glMatrixMode(GL_MODELVIEW);
+
+ glutSwapBuffers();
+}
+
+void
+idle(void)
+{
+ angle1 = (GLfloat) fmod(angle1 + 0.8, 360.0);
+ angle2 = (GLfloat) fmod(angle2 + 1.1, 360.0);
+ s += 0.05;
+
+ //usleep( 100000 );
+
+ static int g=1;
+ printf( "cycle %d\n", g++ );
+
+ glutPostRedisplay();
+}
+
+void
+redraw( int val )
+{
+ angle1 = (GLfloat) fmod(angle1 + 0.8, 360.0);
+ angle2 = (GLfloat) fmod(angle2 + 1.1, 360.0);
+ s += 0.05;
+
+ //usleep( 100000 );
+
+ static int g=1;
+ printf( "cycle %d\n", g++ );
+
+ glutPostRedisplay();
+
+ glutTimerFunc( 100, redraw, 0 );
+}
+
+void
+visible(int vis)
+{
+ if (vis == GLUT_VISIBLE)
+ //glutTimerFunc( 100, redraw, 0 );
+ glutIdleFunc( idle );
+ else
+ glutIdleFunc(NULL);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// The class for the driver
+class ExampleDriver : public Driver
+{
+ public:
+
+ // Constructor; need that
+ ExampleDriver(ConfigFile* cf, int section);
+
+ // Must implement the following methods.
+ virtual int Setup();
+ virtual int Shutdown();
+
+ // This method will be invoked on each incoming message
+ virtual int ProcessMessage(MessageQueue* resp_queue,
+ player_msghdr * hdr,
+ void * data);
+
+ private:
+
+ // Main function for device thread.
+ virtual void Main();
+
+ virtual void Update();
+
+ int foop;
+};
+
+// A factory creation function, declared outside of the class so that it
+// can be invoked without any object context (alternatively, you can
+// declare it static in the class). In this function, we create and return
+// (as a generic Driver*) a pointer to a new instance of this driver.
+Driver*
+ExampleDriver_Init(ConfigFile* cf, int section)
+{
+ puts( "my init" );
+ // Create and return a new instance of this driver
+ return((Driver*)(new ExampleDriver(cf, section)));
+}
+
+// A driver registration function, again declared outside of the class so
+// that it can be invoked without object context. In this function, we add
+// the driver into the given driver table, indicating which interface the
+// driver can support and how to create a driver instance.
+void ExampleDriver_Register(DriverTable* table)
+{
+ table->AddDriver("glutgraphics", ExampleDriver_Init);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Constructor. Retrieve options from the configuration file and do any
+// pre-Setup() setup.
+ExampleDriver::ExampleDriver(ConfigFile* cf, int section)
+ : Driver(cf, section, false, PLAYER_MSGQUEUE_DEFAULT_MAXLEN,
+ PLAYER_GRAPHICS3D_CODE)
+{
+ // Read an option from the configuration file
+ //this->foop = cf->ReadInt(section, "foo", 0);
+
+ return;
+}
+
+
+static int argc = 1;
+static char *argv = "fake";
+
+////////////////////////////////////////////////////////////////////////////////
+// Set up the device. Return 0 if things go well, and -1 otherwise.
+int ExampleDriver::Setup()
+{
+ puts("Example driver initialising");
+
+ // Here you do whatever is necessary to setup the device, like open and
+ // configure a serial port.
+
+ //printf("Was foo option given in config file? %d\n", this->foop);
+
+ glutInit( &argc, &argv );
+ glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
+ glutCreateWindow("blender");
+ glutDisplayFunc(display);
+ glutVisibilityFunc(visible);
+
+ glNewList(1, GL_COMPILE); /* create ico display list */
+ glutSolidIcosahedron();
+ glEndList();
+
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
+ glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_diffuse);
+ glLightfv(GL_LIGHT1, GL_POSITION, light1_position);
+ glLightfv(GL_LIGHT2, GL_DIFFUSE, light2_diffuse);
+ glLightfv(GL_LIGHT2, GL_POSITION, light2_position);
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_LINE_SMOOTH);
+ glLineWidth(2.0);
+
+ glMatrixMode(GL_PROJECTION);
+ gluPerspective( /* field of view in degree */ 40.0,
+ /* aspect ratio */ 1.0,
+ /* Z near */ 1.0, /* Z far */ 10.0);
+ glMatrixMode(GL_MODELVIEW);
+ gluLookAt(0.0, 0.0, 5.0, /* eye is at (0,0,5) */
+ 0.0, 0.0, 0.0, /* center is at (0,0,0) */
+ 0.0, 1.0, 0.); /* up is in positive Y direction */
+ glTranslatef(0.0, 0.6, -1.0);
+
+
+ puts("Example driver ready");
+
+ // Start the device thread; spawns a new thread and executes
+ // ExampleDriver::Main(), which contains the main loop for the driver.
+ //StartThread();
+
+ return(0);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Shutdown the device
+int ExampleDriver::Shutdown()
+{
+ puts("Shutting example driver down");
+
+ // Stop and join the driver thread
+ StopThread();
+
+ // Here you would shut the device down by, for example, closing a
+ // serial port.
+
+ puts("Example driver has been shutdown");
+
+ return(0);
+}
+
+int ExampleDriver::ProcessMessage(MessageQueue* resp_queue,
+ player_msghdr * hdr,
+ void * data)
+{
+ // Process messages here. Send a response if necessary, using Publish().
+ // If you handle the message successfully, return 0. Otherwise,
+ // return -1, and a NACK will be sent for you, if a response is required.
+
+ // call this from the driver's private thread - on a timer?
+ // receive messages and do drawing
+
+ return(0);
+}
+
+
+void ExampleDriver::Update()
+{
+ ProcessMessages();
+ glutCheckLoop();
+ return;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Main function for device thread
+void ExampleDriver::Main()
+{
+ printf( "entering main loop" );
+ //glutMainLoop();
+
+ //return 0; /* ANSI C requires main to return int. */
+
+ // The main loop; interact with the device here
+ for(;;)
+ {}
+ //{
+ // test if we are supposed to cancel
+ //pthread_testcancel();
+
+ // Process incoming messages. ExampleDriver::ProcessMessage() is
+ // called on each message.
+ //ProcessMessages();
+
+ // Interact with the device, and push out the resulting data, using
+ // Driver::Publish()
+
+ // Sleep (you might, for example, block on a read() instead)
+ //usleep(100000);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Extra stuff for building a shared object.
+
+/* need the extern to avoid C++ name-mangling */
+extern "C" {
+ int player_driver_init(DriverTable* table)
+ {
+ puts("Example driver initializing");
+ ExampleDriver_Register(table);
+ puts("Example driver done");
+ return(0);
+ }
+}
+
View
713 libstage/logo.cc
@@ -0,0 +1,713 @@
+
+#include <gdk-pixbuf/gdk-pixdata.h>
+
+/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */
+
+GdkPixdata logo_pixbuf = {
+ 0x47646b50, /* Pixbuf magic: 'GdkP' */
+ 24 + 14983, /* header length + pixel_data length */
+ 0x2010002, /* pixdata_type */
+ 1056, /* rowstride */
+ 264, /* width */
+ 82, /* height */
+ /* pixel_data: */ (guint8*)
+ "\1\377\377\377\0\237MLK\0\1MLK\377\377\0\0\0\377\350\0\0\0\377\1\377"
+ "\377\377\0\237\202\203\177\0\2\202\203\177\377\3\3\4\377\377\0\0\0\377"
+ "\347\0\0\0\377\1\377\377\377\0\237\205\205\201\0\4\205\205\201\377\7"
+ "\7\7\377\2\2\2\377\26\26\27\377\377\30\30\34\377\343\30\30\34\377\202"
+ "\0\0\0\377\1\377\377\377\0\237\205\206\203\0\3\205\206\203\377\11\11"
+ "\14\377\5\5\11\377\377\30\30\34\377\344\30\30\34\377\202\0\0\0\377\1"
+ "\377\377\377\0\237\205\205\202\0\3\205\205\202\377\7\7\13\377\5\5\11"
+ "\377\377\30\30\34\377\344\30\30\34\377\202\0\0\0\377\1\377\377\377\0"
+ "\237\203\203\201\0\3\203\203\201\377\5\5\11\377\2\2\5\377\377\30\30\34"
+ "\377\344\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0"
+ "\5\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\227\207"
+ "\207\204\0\3\207\207\204\377\12\12\16\377\3\3\7\377\377\30\30\34\377"
+ "\344\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\6\231"
+ "\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224"
+ "\0\226\220\220\215\0\3\220\220\215\377\25\23\34\377\11\7\20\377\377\30"
+ "\30\34\377\344\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226"
+ "\217\0\7\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231\222\0"
+ "\232\233\224\0\225\226\217\0\225\225\225\222\0\3\225\225\222\377\37\35"
+ "'\377\16\14\25\377\377\30\30\34\377\344\30\30\34\377\202\0\0\0\377\1"
+ "\377\377\377\0\203\226\226\217\0\10\231\231\225\0vvt\0\222\223\216\0"
+ "\225\225\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211"
+ "\0\224\227\227\222\0\3\227\227\222\377\30\30\34\377\0\0\0\377\377\30"
+ "\30\34\377\344\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226"
+ "\217\0\11\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231\222"
+ "\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223\215\0\223\225\226"
+ "\221\0\3\225\226\221\377\26\26\32\377\0\0\2\377\260\30\30\34\377\2""7"
+ "7:\377eeh\377\203\204\204\206\377\2VVY\377''+\377\207\30\30\34\377\2"
+ "ttw\377VVY\377\377\30\30\34\377\244\30\30\34\377\202\0\0\0\377\1\377"
+ "\377\377\0\203\226\226\217\0\12\231\231\225\0vvt\0\222\223\216\0\225"
+ "\225\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223"
+ "\223\215\0\232\232\223\0\222\224\225\221\0\3\224\225\221\377\25\25\31"
+ "\377\0\0\2\377\256\30\30\34\377\2ttw\377\321\321\322\377\207\377\377"
+ "\377\377\2\262\262\263\377ttw\377\204\30\30\34\377\3''+\377\377\377\377"
+ "\377\204\204\206\377\377\30\30\34\377\244\30\30\34\377\202\0\0\0\377"
+ "\1\377\377\377\0\203\226\226\217\0\12\231\231\225\0vvt\0\222\223\216"
+ "\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211"
+ "\0\223\223\215\0\232\232\223\0\222\222\222\216\0\3\222\222\216\377\21"
+ "\21\25\377\0\0\2\377\254\30\30\34\377\2""77:\377\321\321\322\377\213"
+ "\377\377\377\377\2\360\360\360\377\243\243\244\377\202VVY\377\3\243\243"
+ "\244\377\377\377\377\377\301\301\302\377\377\30\30\34\377\244\30\30\34"
+ "\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\13\231\231\225\0"
+ "vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226"
+ "\217\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\221\216\216\213"
+ "\0\3\216\216\213\377\16\16\22\377\0\0\4\377\253\30\30\34\377\2FFI\377"
+ "\360\360\360\377\203\377\377\377\377\3\360\360\360\377\204\204\206\377"
+ "FFI\377\202\30\30\34\377\3FFI\377\204\204\206\377\340\340\341\377\207"
+ "\377\377\377\377\1\301\301\302\377\377\30\30\34\377\244\30\30\34\377"
+ "\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\14\231\231\225\0vvt"
+ "\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226\217"
+ "\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200|\0\220\213"
+ "\213\210\0\3\213\213\210\377\14\14\20\377\0\0\4\377\252\30\30\34\377"
+ "\2''+\377\360\360\360\377\203\377\377\377\377\2\321\321\322\37777:\377"
+ "\207\30\30\34\377\2ttw\377\360\360\360\377\205\377\377\377\377\1\301"
+ "\301\302\377\377\30\30\34\377\244\30\30\34\377\202\0\0\0\377\1\377\377"
+ "\377\0\203\226\226\217\0\15\231\231\225\0vvt\0\222\223\216\0\225\225"
+ "\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223"
+ "\215\0\232\232\223\0kjh\0\200\200|\0\232\232\223\0\217\210\210\205\0"
+ "\2\210\210\205\377\11\11\14\377\253\30\30\34\377\1\262\262\263\377\203"
+ "\377\377\377\377\2\340\340\341\377''+\377\211\30\30\34\377\2""77:\377"
+ "\321\321\322\377\205\377\377\377\377\377\30\30\34\377\244\30\30\34\377"
+ "\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\15\231\231\225\0vvt"
+ "\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226\217"
+ "\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200|\0\232\232"
+ "\223\0\217\205\206\203\0\2\205\206\203\377\11\11\14\377\252\30\30\34"
+ "\377\1VVY\377\204\377\377\377\377\1ttw\377\213\30\30\34\377\2''+\377"
+ "\321\321\322\377\204\377\377\377\377\377\30\30\34\377\244\30\30\34\377"
+ "\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\16\231\231\225\0vvt"
+ "\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226\217"
+ "\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200|\0\232\232"
+ "\223\0\214\214\206\0\216\202\203\200\0\2\202\203\200\377\2\2\5\377\252"
+ "\30\30\34\377\1\301\301\302\377\204\377\377\377\377\215\30\30\34\377"
+ "\2''+\377\360\360\360\377\203\377\377\377\377\216\30\30\34\377\2FFI\377"
+ "ttw\377\377\30\30\34\377\224\30\30\34\377\202\0\0\0\377\1\377\377\377"
+ "\0\203\226\226\217\0\17\231\231\225\0vvt\0\222\223\216\0\225\225\221"
+ "\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223\215"
+ "\0\232\232\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0\230\231"
+ "\221\0\215}}{\0\2}}{\377\2\2\5\377\251\30\30\34\377\1""77:\377\204\377"
+ "\377\377\377\1\301\301\302\377\216\30\30\34\377\1eeh\377\203\377\377"
+ "\377\377\1VVY\377\215\30\30\34\377\2\301\301\302\377\204\204\206\377"
+ "\377\30\30\34\377\224\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203"
+ "\226\226\217\0\17\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230"
+ "\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223\215\0\232"
+ "\232\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0\230\231\221\0"
+ "\215qqo\0\2qqo\377\2\2\5\377\251\30\30\34\377\1ttw\377\204\377\377\377"
+ "\377\1\301\301\302\377\217\30\30\34\377\1\301\301\302\377\202\377\377"
+ "\377\377\1VVY\377\214\30\30\34\377\3\204\204\206\377\377\377\377\377"
+ "\204\204\206\377\377\30\30\34\377\224\30\30\34\377\202\0\0\0\377\1\377"
+ "\377\377\0\203\226\226\217\0\20\231\231\225\0vvt\0\222\223\216\0\225"
+ "\225\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223"
+ "\223\215\0\232\232\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0"
+ "\230\231\221\0\210\210\205\0\214``_\0\2``_\377\2\2\5\377\251\30\30\34"
+ "\377\1\204\204\206\377\204\377\377\377\377\1\301\301\302\377\217\30\30"
+ "\34\377\1ttw\377\202\377\377\377\377\1VVY\377\213\30\30\34\377\4""77"
+ ":\377\360\360\360\377\377\377\377\377\204\204\206\377\377\30\30\34\377"
+ "\224\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\21"
+ "\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233"
+ "\224\0\225\226\217\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200"
+ "\200|\0\232\232\223\0\214\214\206\0\230\231\221\0\210\210\205\0\230\230"
+ "\221\0\213III\0\2III\377\0\0\4\377\251\30\30\34\377\1\301\301\302\377"
+ "\204\377\377\377\377\1\360\360\360\377\220\30\30\34\377\3\360\360\360"
+ "\377\377\377\377\377\204\204\206\377\213\30\30\34\377\1\262\262\263\377"
+ "\202\377\377\377\377\1\204\204\206\377\377\30\30\34\377\224\30\30\34"
+ "\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\21\231\231\225\0"
+ "vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226"
+ "\217\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200|\0\232"
+ "\232\223\0\214\214\206\0\230\231\221\0\210\210\205\0\230\230\221\0\213"
+ "000\0\2""000\377\0\0\4\377\251\30\30\34\377\1\301\301\302\377\205\377"
+ "\377\377\377\1FFI\377\217\30\30\34\377\3\243\243\244\377\377\377\377"
+ "\377\204\204\206\377\212\30\30\34\377\1eeh\377\203\377\377\377\377\1"
+ "\204\204\206\377\377\30\30\34\377\224\30\30\34\377\202\0\0\0\377\1\377"
+ "\377\377\0\203\226\226\217\0\22\231\231\225\0vvt\0\222\223\216\0\225"
+ "\225\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223"
+ "\223\215\0\232\232\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0"
+ "\230\231\221\0\210\210\205\0\230\230\221\0\225\225\220\0\212\227\230"
+ "\220\0\2\32\32\33\377\0\0\4\377\251\30\30\34\377\1\301\301\302\377\205"
+ "\377\377\377\377\1\243\243\244\377\217\30\30\34\377\3eeh\377\377\377"
+ "\377\377\204\204\206\377\211\30\30\34\377\2''+\377\360\360\360\377\203"
+ "\377\377\377\377\1\204\204\206\377\377\30\30\34\377\224\30\30\34\377"
+ "\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\22\231\231\225\0vvt"
+ "\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226\217"
+ "\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200|\0\232\232"
+ "\223\0\214\214\206\0\230\231\221\0\210\210\205\0\230\230\221\0\225\225"
+ "\220\0\211\227\230\220\0\3\227\230\220\377\20\17\20\377\0\0\4\377\251"
+ "\30\30\34\377\1\262\262\263\377\206\377\377\377\377\1VVY\377\216\30\30"
+ "\34\377\3''+\377\377\377\377\377\262\262\263\377\211\30\30\34\377\1\321"
+ "\321\322\377\204\377\377\377\377\1\204\204\206\377\377\30\30\34\377\224"
+ "\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\23\231"
+ "\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224"
+ "\0\225\226\217\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200"
+ "|\0\232\232\223\0\214\214\206\0\230\231\221\0\210\210\205\0\230\230\221"
+ "\0\225\225\220\0\230\231\222\0\210\221\222\214\0\1\221\222\214\377\202"
+ "\12\12\11\377\251\30\30\34\377\1\204\204\206\377\206\377\377\377\377"
+ "\2\360\360\360\37777:\377\216\30\30\34\377\2\243\243\244\377\223\223"
+ "\225\377\210\30\30\34\377\1\243\243\244\377\205\377\377\377\377\1\204"
+ "\204\206\377\377\30\30\34\377\224\30\30\34\377\202\0\0\0\377\1\377\377"
+ "\377\0\203\226\226\217\0\23\231\231\225\0vvt\0\222\223\216\0\225\225"
+ "\221\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223"
+ "\215\0\232\232\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0\230"
+ "\231\221\0\210\210\205\0\230\230\221\0\225\225\220\0\230\231\222\0\210"
+ "\207\210\202\0\1\207\210\202\377\202\12\12\11\377\251\30\30\34\377\1"
+ "VVY\377\207\377\377\377\377\2\321\321\322\377FFI\377\226\30\30\34\377"
+ "\1\243\243\244\377\206\377\377\377\377\1\301\301\302\377\205\204\204"
+ "\206\377\1ttw\377\211\30\30\34\377\4""77:\377\204\204\206\377\301\301"
+ "\302\377\340\340\341\377\203\377\377\377\377\3\321\321\322\377\243\243"
+ "\244\377eeh\377\224\30\30\34\377\3""77:\377\223\223\225\377\301\301\302"
+ "\377\203\377\377\377\377\3\321\321\322\377\243\243\244\377eeh\377\224"
+ "\30\30\34\377\4''+\377ttw\377\262\262\263\377\340\340\341\377\202\377"
+ "\377\377\377\4\360\360\360\377\262\262\263\377ttw\377''+\377\277\30\30"
+ "\34\377\202\0\0\0\377\1\377\377\377\0\203\226\226\217\0\24\231\231\225"
+ "\0vvt\0\222\223\216\0\225\225\221\0\230\231\222\0\232\233\224\0\225\226"
+ "\217\0\217\220\211\0\223\223\215\0\232\232\223\0kjh\0\200\200|\0\232"
+ "\232\223\0\214\214\206\0\230\231\221\0\210\210\205\0\230\230\221\0\225"
+ "\225\220\0\230\231\222\0ccd\0\207mnf\0\3mnf\377\12\14\5\377\12\12\11"
+ "\377\252\30\30\34\377\1\340\340\341\377\207\377\377\377\377\2\360\360"
+ "\360\377FFI\377\224\30\30\34\377\1\243\243\244\377\215\377\377\377\377"
+ "\1\301\301\302\377\207\30\30\34\377\2''+\377\243\243\244\377\212\377"
+ "\377\377\377\2\321\321\322\377FFI\377\220\30\30\34\377\2''+\377\223\223"
+ "\225\377\211\377\377\377\377\3\360\360\360\377\223\223\225\377FFI\377"
+ "\220\30\30\34\377\2\204\204\206\377\360\360\360\377\210\377\377\377\377"
+ "\2\360\360\360\377eeh\377\276\30\30\34\377\202\0\0\0\377\1\377\377\377"
+ "\0\203\226\226\217\0\25\231\231\225\0vvt\0\222\223\216\0\225\225\221"
+ "\0\230\231\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223\215"
+ "\0\232\232\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0\230\231"
+ "\221\0\210\210\205\0\230\230\221\0\225\225\220\0\230\231\222\0ccd\0|"
+ "|{\0\206KLG\0\1KLG\377\202\12\12\11\377\252\30\30\34\377\1ttw\377\211"
+ "\377\377\377\377\1\204\204\206\377\222\30\30\34\377\1FFI\377\216\377"
+ "\377\377\377\1\301\301\302\377\206\30\30\34\377\2""77:\377\321\321\322"
+ "\377\203\377\377\377\377\2\243\243\244\377FFI\377\202\30\30\34\377\2"
+ "eeh\377\301\301\302\377\203\377\377\377\377\2\360\360\360\377FFI\377"
+ "\216\30\30\34\377\2''+\377\321\321\322\377\202\377\377\377\377\2\301"
+ "\301\302\377eeh\377\202\30\30\34\377\2FFI\377\262\262\263\377\205\377"
+ "\377\377\377\1\360\360\360\377\206\301\301\302\377\207\30\30\34\377\2"
+ "''+\377\321\321\322\377\202\377\377\377\377\2\340\340\341\377\223\223"
+ "\225\377\202\204\204\206\377\1\321\321\322\377\205\377\377\377\377\1"
+ "\243\243\244\377\275\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203\226"
+ "\226\217\0\26\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230\231"
+ "\222\0\232\233\224\0\225\226\217\0\217\220\211\0\223\223\215\0\232\232"
+ "\223\0kjh\0\200\200|\0\232\232\223\0\214\214\206\0\230\231\221\0\210"
+ "\210\205\0\230\230\221\0\225\225\220\0\230\231\222\0ccd\0||{\0ccd\0\204"
+ "\232\233\224\0\2\226\227\220\0(*#\377\202\12\12\11\377\253\30\30\34\377"
+ "\1\321\321\322\377\211\377\377\377\377\2\262\262\263\377''+\377\224\30"
+ "\30\34\377\1\301\301\302\377\204\377\377\377\377\1\204\204\206\377\213"
+ "\30\30\34\377\2''+\377\321\321\322\377\203\377\377\377\377\1ttw\377\206"
+ "\30\30\34\377\1\301\301\302\377\203\377\377\377\377\1\340\340\341\377"
+ "\215\30\30\34\377\2''+\377\321\321\322\377\202\377\377\377\377\1\301"
+ "\301\302\377\206\30\30\34\377\1\204\204\206\377\213\377\377\377\377\206"
+ "\30\30\34\377\2''+\377\321\321\322\377\202\377\377\377\377\1\204\204"
+ "\206\377\205\30\30\34\377\2VVY\377\340\340\341\377\204\377\377\377\377"
+ "\1\243\243\244\377\274\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203"
+ "\226\226\217\0\26\231\231\225\0vvt\0\222\223\216\0\225\225\221\0\230"
+ "\231\222\377\232\233\224\377\225\226\217\377\217\220\211\377\223\223"
+ "\215\377\232\232\223\377kjh\0\200\200|\0\232\232\223\0\214\214\206\0"
+ "\230\231\221\0\210\210\205\0\230\230\221\0\225\225\220\0\230\231\222"
+ "\0ccd\0||{\0ccd\0\204\232\233\224\0\2\226\227\220\377\14\16\7\377\202"
+ "\12\12\11\377\253\30\30\34\377\2FFI\377\360\360\360\377\211\377\377\377"
+ "\377\2\340\340\341\377VVY\377\223\30\30\34\377\1\301\301\302\377\204"
+ "\377\377\377\377\1\204\204\206\377\213\30\30\34\377\1\262\262\263\377"
+ "\203\377\377\377\377\1\340\340\341\377\207\30\30\34\377\1FFI\377\204"
+ "\377\377\377\377\1ttw\377\214\30\30\34\377\1\223\223\225\377\203\377"
+ "\377\377\377\1""77:\377\207\30\30\34\377\1\301\301\302\377\212\377\377"
+ "\377\377\206\30\30\34\377\1\301\301\302\377\202\377\377\377\377\1eeh"
+ "\377\207\30\30\34\377\2""77:\377\360\360\360\377\204\377\377\377\377"
+ "\1\204\204\206\377\273\30\30\34\377\202\0\0\0\377\1\377\377\377\0\203"
+ "\226\226\217\0\26\231\231\225\0vvt\0\222\223\216\0\225\225\221\377;;"
+ "9\377\35\35\34\377\14\14\13\377\3\3\2\377\21\21\20\377@\77>\377kjh\377"
+ "\200\200|\377\232\232\223\377\214\214\206\0\230\231\221\0\210\210\205"
+ "\0\230\230\221\0\225\225\220\0\230\231\222\0ccd\0||{\0ccd\0\203\232\233"
+ "\224\0\4\232\233\224\377ggd\377\0\0\0\377\12\12\11\377\255\30\30\34\377"
+ "\1eeh\377\213\377\377\377\377\1\204\204\206\377\222\30\30\34\377\1\301"
+ "\301\302\377\204\377\377\377\377\1\204\204\206\377\212\30\30\34\377\1"
+ "VVY\377\204\377\377\377\377\1\301\301\302\377\210\30\30\34\377\204\377"
+ "\377\377\377\1\321\321\322\377\213\30\30\34\377\1FFI\377\203\377\377"
+ "\377\377\1\301\301\302\377\210\30\30\34\377\1VVY\377\204\377\377\377"
+ "\377\1\340\340\341\377\212\30\30\34\377\1\204\204\206\377\202\377\377"
+ "\377\377\1\223\223\225\377\211\30\30\34\377\1\204\204\206\377\205\377"
+ "\377\377\377\1""77:\377\272\30\30\34\377\202\0\0\0\377\1\377\377\377"
+ "\0\203\226\226\217\0\7\231\231\225\0vvt\0\222\223\216\377\33\33\31\377"
+ "\12\12\11\377\16\16\14\377\21\21\20\377\202\25\25\23\377\24\21\21\20"
+ "\377\16\17\14\377\12\13\12\377MLK\377\214\214\206\377\230\231\221\377"
+ "\210\210\205\0\230\230\221\0\225\225\220\0\230\231\222\0ccd\0||{\0cc"
+ "d\0\232\233\224\0\201\201\177\0\211\211\206\0\217\217\213\377\34\33\32"
+ "\377\0\0\0\377\12\12\11\377\256\30\30\34\377\2eeh\377\360\360\360\377"
+ "\212\377\377\377\377\2\301\301\302\377''+\377\220\30\30\34\377\1\301"
+