From: <yx...@us...> - 2009-01-22 11:22:00
|
Revision: 30 http://simspark.svn.sourceforge.net/simspark/?rev=30&view=rev Author: yxu Date: 2009-01-22 11:21:46 +0000 (Thu, 22 Jan 2009) Log Message: ----------- add imageperceptor, but it can not send image to agent at present Modified Paths: -------------- trunk/spark/configure.ac trunk/spark/lib/kerosin/renderserver/baserenderserver.h trunk/spark/lib/kerosin/renderserver/renderserver.h trunk/spark/plugin/CMakeLists.txt trunk/spark/plugin/Makefile.am Added Paths: ----------- trunk/spark/plugin/imageperceptor/ trunk/spark/plugin/imageperceptor/CMakeLists.txt trunk/spark/plugin/imageperceptor/Makefile.am trunk/spark/plugin/imageperceptor/Makefile.in trunk/spark/plugin/imageperceptor/export.cpp trunk/spark/plugin/imageperceptor/imageperceptor.cpp trunk/spark/plugin/imageperceptor/imageperceptor.h trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp Modified: trunk/spark/configure.ac =================================================================== --- trunk/spark/configure.ac 2009-01-22 10:40:16 UTC (rev 29) +++ trunk/spark/configure.ac 2009-01-22 11:21:46 UTC (rev 30) @@ -170,6 +170,7 @@ plugin/openglsyswx/Makefile \ plugin/sparkmonitor/Makefile \ plugin/sparkagent/Makefile \ + plugin/imageperceptor/Makefile \ test/Makefile \ test/coretest/Makefile \ test/fonttest/Makefile \ Modified: trunk/spark/lib/kerosin/renderserver/baserenderserver.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/baserenderserver.h 2009-01-22 10:40:16 UTC (rev 29) +++ trunk/spark/lib/kerosin/renderserver/baserenderserver.h 2009-01-22 11:21:46 UTC (rev 30) @@ -59,6 +59,16 @@ //! get a shot of the current frame virtual bool CopyFrame(char* /* buffer */) const { return false; } + void SetCamera( boost::shared_ptr<oxygen::Camera> c ) + { + mCamera = c; + } + + boost::shared_ptr<oxygen::Camera> GetCamera() + { + return mCamera; + } + protected: /** get the active scene node from the sceneServer */ virtual bool GetActiveScene(); @@ -81,6 +91,9 @@ /** reference to the SceneServer */ CachedPath<oxygen::SceneServer> mSceneServer; + + /** the currently selected camera */ + boost::shared_ptr<oxygen::Camera> mCamera; }; DECLARE_ABSTRACTCLASS(BaseRenderServer); Modified: trunk/spark/lib/kerosin/renderserver/renderserver.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/renderserver.h 2009-01-22 10:40:16 UTC (rev 29) +++ trunk/spark/lib/kerosin/renderserver/renderserver.h 2009-01-22 11:21:46 UTC (rev 30) @@ -123,7 +123,7 @@ // protected: /** reference to the SceneServer */ - CachedPath<oxygen::SceneServer> mSceneServer; + //CachedPath<oxygen::SceneServer> mSceneServer; /** the OpenGL ambient clear color */ RGBA mAmbientColor; @@ -143,9 +143,6 @@ double mPickRange; /** the picked result node */ boost::weak_ptr<RenderNode> mPickedNode; - - /** the currently selected camera */ - boost::shared_ptr<oxygen::Camera> mCamera; }; DECLARE_CLASS(RenderServer); Modified: trunk/spark/plugin/CMakeLists.txt =================================================================== --- trunk/spark/plugin/CMakeLists.txt 2009-01-22 10:40:16 UTC (rev 29) +++ trunk/spark/plugin/CMakeLists.txt 2009-01-22 11:21:46 UTC (rev 30) @@ -18,3 +18,4 @@ add_subdirectory(soundsystemfmod) add_subdirectory(inputwx) add_subdirectory(openglsyswx) +add_subdirectory(imageperceptor) Modified: trunk/spark/plugin/Makefile.am =================================================================== --- trunk/spark/plugin/Makefile.am 2009-01-22 10:40:16 UTC (rev 29) +++ trunk/spark/plugin/Makefile.am 2009-01-22 11:21:46 UTC (rev 30) @@ -16,7 +16,8 @@ sceneeffector\ soundsystemfmod \ inputwx \ - openglsyswx + openglsyswx \ + imageperceptor # filesystemrar # soundsystembass Added: trunk/spark/plugin/imageperceptor/CMakeLists.txt =================================================================== --- trunk/spark/plugin/imageperceptor/CMakeLists.txt (rev 0) +++ trunk/spark/plugin/imageperceptor/CMakeLists.txt 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,16 @@ + +########### next target ############### + +set(imageperceptor_LIB_SRCS + export.cpp + imageperceptor.h + imageperceptor.cpp + imageperceptor_c.cpp +) + +add_library(imageperceptor MODULE ${imageperceptor_LIB_SRCS}) + +target_link_libraries(imageperceptor) + +set_target_properties(imageperceptor PROPERTIES VERSION 0.0.0 SOVERSION 0) +install(TARGETS imageperceptor DESTINATION ${LIBDIR}/${CMAKE_PROJECT_NAME}) Added: trunk/spark/plugin/imageperceptor/Makefile.am =================================================================== --- trunk/spark/plugin/imageperceptor/Makefile.am (rev 0) +++ trunk/spark/plugin/imageperceptor/Makefile.am 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,12 @@ +pkglib_LTLIBRARIES = imageperceptor.la + +imageperceptor_la_SOURCES = export.cpp \ + imageperceptor.h \ + imageperceptor.cpp \ + imageperceptor_c.cpp + +# -module tells automake we're not building a library but a loadable module +# so we don't need the "lib" prefix in the module name +imageperceptor_la_LDFLAGS = -module -version-info 0:0:0 + +AM_CPPFLAGS = -I${top_srcdir}/lib @RUBY_CPPFLAGS@ Added: trunk/spark/plugin/imageperceptor/Makefile.in =================================================================== --- trunk/spark/plugin/imageperceptor/Makefile.in (rev 0) +++ trunk/spark/plugin/imageperceptor/Makefile.in 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,543 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugin/imageperceptor +DIST_COMMON = $(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)/sparkconfig.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)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +imageperceptor_la_LIBADD = +am_imageperceptor_la_OBJECTS = export.lo imageperceptor.lo \ + imageperceptor_c.lo +imageperceptor_la_OBJECTS = $(am_imageperceptor_la_OBJECTS) +imageperceptor_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(imageperceptor_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config.aux/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 = $(imageperceptor_la_SOURCES) +DIST_SOURCES = $(imageperceptor_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BOOST_THREADS_LIB = @BOOST_THREADS_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEVIL = @DEVIL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE = @FREETYPE@ +FREETYPE_CPPFLAGS = @FREETYPE_CPPFLAGS@ +FREETYPE_LIBADD = @FREETYPE_LIBADD@ +GLDIR = @GLDIR@ +GLTARGET = @GLTARGET@ +GL_LDFLAGS = @GL_LDFLAGS@ +GL_LIBADD = @GL_LIBADD@ +GREP = @GREP@ +HAVE_DOT = @HAVE_DOT@ +IL_LDFLAGS = @IL_LDFLAGS@ +IL_LIBADD = @IL_LIBADD@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NET_LIBS = @NET_LIBS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +ODE = @ODE@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PDFLATEX = @PDFLATEX@ +PERL = @PERL@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +RUBY_CPPFLAGS = @RUBY_CPPFLAGS@ +RUBY_LDADD = @RUBY_LDADD@ +RUBY_LDFLAGS = @RUBY_LDFLAGS@ +SALT_LIBADD = @SALT_LIBADD@ +SDL = @SDL@ +SDLCONFIG = @SDLCONFIG@ +SDL_CPPFLAGS = @SDL_CPPFLAGS@ +SDL_LDFLAGS = @SDL_LDFLAGS@ +SDL_LIBADD = @SDL_LIBADD@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPADES = @SPADES@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WX_CFLAGS = @WX_CFLAGS@ +WX_CFLAGS_ONLY = @WX_CFLAGS_ONLY@ +WX_CONFIG_PATH = @WX_CONFIG_PATH@ +WX_CPPFLAGS = @WX_CPPFLAGS@ +WX_CXXFLAGS = @WX_CXXFLAGS@ +WX_CXXFLAGS_ONLY = @WX_CXXFLAGS_ONLY@ +WX_LIBS = @WX_LIBS@ +WX_LIBS_STATIC = @WX_LIBS_STATIC@ +WX_VERSION = @WX_VERSION@ +XMKMF = @XMKMF@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +bundle_support = @bundle_support@ +datadir = @datadir@ +datarootdir = @datarootdir@ +debug = @debug@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +kerosin_version = @kerosin_version@ +kerosin_version_info = @kerosin_version_info@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +oxygen_version = @oxygen_version@ +oxygen_version_info = @oxygen_version_info@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +rcssnet3D_version = @rcssnet3D_version@ +rcssnet3D_version_info = @rcssnet3D_version_info@ +salt_version = @salt_version@ +salt_version_info = @salt_version_info@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +spark_version = @spark_version@ +spark_version_info = @spark_version_info@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +zeitgeist_version = @zeitgeist_version@ +zeitgeist_version_info = @zeitgeist_version_info@ +pkglib_LTLIBRARIES = imageperceptor.la +imageperceptor_la_SOURCES = export.cpp \ + imageperceptor.h \ + imageperceptor.cpp \ + imageperceptor_c.cpp + + +# -module tells automake we're not building a library but a loadable module +# so we don't need the "lib" prefix in the module name +imageperceptor_la_LDFLAGS = -module -version-info 0:0:0 +AM_CPPFLAGS = -I${top_srcdir}/lib @RUBY_CPPFLAGS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .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 plugin/imageperceptor/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugin/imageperceptor/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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +imageperceptor.la: $(imageperceptor_la_OBJECTS) $(imageperceptor_la_DEPENDENCIES) + $(imageperceptor_la_LINK) -rpath $(pkglibdir) $(imageperceptor_la_OBJECTS) $(imageperceptor_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imageperceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imageperceptor_c.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ mv -f $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ mv -f $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ mv -f $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + 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-dvi: install-dvi-am + +install-exec-am: install-pkglibLTLIBRARIES + +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-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + 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-pkglibLTLIBRARIES + +# 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: Added: trunk/spark/plugin/imageperceptor/export.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/export.cpp (rev 0) +++ trunk/spark/plugin/imageperceptor/export.cpp 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,26 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 RoboCup Soccer Server 3D Maintenance Group + $Id:$ + + 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; version 2 of the License. + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "imageperceptor.h" +#include <zeitgeist/zeitgeist.h> + +ZEITGEIST_EXPORT_BEGIN() + ZEITGEIST_EXPORT(ImagePerceptor); +ZEITGEIST_EXPORT_END() Added: trunk/spark/plugin/imageperceptor/imageperceptor.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor.cpp (rev 0) +++ trunk/spark/plugin/imageperceptor/imageperceptor.cpp 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,210 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 RoboCup Soccer Server 3D Maintenance Group + $Id:$ + + 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; version 2 of the License. + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +// #include <IL/il.h> +// #include <IL/ilu.h> +// #include <sstream> +#include <GL/gl.h> +#include "imageperceptor.h" +#include <zeitgeist/logserver/logserver.h> + +#define USE_FBO + +// using namespace kerosin; +using namespace oxygen; +using namespace boost; +using namespace zeitgeist; +using namespace salt; +using namespace std; + +ImagePerceptor::ImagePerceptor() : oxygen::Perceptor() +{ + mFramesRendered = 0; +} + +ImagePerceptor::~ImagePerceptor() +{ +} + +#define REG_GL_EXT_FUN(_ptr, _function) \ + static _ptr _function = (_ptr) mOpenGLServer->GetExtension(#_function); \ + if ( !_function ){ \ + GetLog()->Error()<<"(Image Perceptor) ERROR: can not get "#_function"\n"; \ + } + +void ImagePerceptor::OnLink() +{ + mCamera = shared_dynamic_cast<Camera>( GetCore()->New("oxygen/Camera") ); + if ( 0 != mCamera.get() ) + { + AddChildReference(mCamera); + } + else + { + GetLog()->Error() + <<"(ImagePerceptor) ERROR: can not create camera\n"; + } + + RegisterCachedPath(mRenderServer, "/sys/server/render"); + + if (mRenderServer.expired()) + { + GetLog()->Error() + << "(ImagePerceptor) ERROR: RenderServer not found\n"; + } + + RegisterCachedPath(mOpenGLServer,"/sys/server/opengl"); + + if (mOpenGLServer.expired()) + { + GetLog()->Error() + << "(ImagePerceptor) ERROR: OpenGLServer not found\n"; + } + + // create a framebuffer object + REG_GL_EXT_FUN( PFNGLGENFRAMEBUFFERSEXTPROC, glGenFramebuffersEXT ); + REG_GL_EXT_FUN( PFNGLGENRENDERBUFFERSEXTPROC, glGenRenderbuffersEXT); + + glGenFramebuffersEXT(1, &mFBOId); + glGenRenderbuffersEXT(1, &mRBOId); + glGenRenderbuffersEXT(1, &mDepthBuffer); + +} + +void ImagePerceptor::OnUnlink() +{ + REG_GL_EXT_FUN( PFNGLDELETEFRAMEBUFFERSEXTPROC, glDeleteFramebuffersEXT ); + REG_GL_EXT_FUN( PFNGLDELETERENDERBUFFERSEXTPROC, glDeleteRenderbuffersEXT ); + glDeleteFramebuffersEXT(1, &mFBOId); + glDeleteRenderbuffersEXT(1, &mRBOId); +} + +bool ImagePerceptor::Percept(boost::shared_ptr<PredicateList> predList) +{ + if ( !Render() ) + return false; + + Predicate &predicate = predList->AddPredicate(); + predicate.name = "Image"; + predicate.parameter.Clear(); + + // ParameterList &sizeElement = predicate.parameter.AddList(); + // sizeElement.AddValue(std::string("s")); + // sizeElement.AddValue(mCamera->GetViewportWidth()); + // sizeElement.AddValue(mCamera->GetViewportHeight()); + + predicate.parameter.AddValue(mData); + return true; +} + +bool ImagePerceptor::Render() +{ + if ( + (mOpenGLServer.expired()) || + (mRenderServer.expired()) + ) + { + return false; + } + + int w = mCamera->GetViewportWidth(); + int h = mCamera->GetViewportHeight(); + +#ifdef USE_FBO + REG_GL_EXT_FUN( PFNGLBINDFRAMEBUFFEREXTPROC, glBindFramebufferEXT ); + REG_GL_EXT_FUN( PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT ); + REG_GL_EXT_FUN( PFNGLRENDERBUFFERSTORAGEEXTPROC, glRenderbufferStorageEXT ); + REG_GL_EXT_FUN( PFNGLBINDRENDERBUFFEREXTPROC, glBindRenderbufferEXT); + REG_GL_EXT_FUN( PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT ); + + + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFBOId); + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mRBOId); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, w, h); + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_RENDERBUFFER_EXT, mRBOId); + + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mDepthBuffer); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, w, h); + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, mDepthBuffer); + + + // check FBO status + GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if(status != GL_FRAMEBUFFER_COMPLETE_EXT){ + GetLog()->Error()<<"fbo error!\n"; + } +#endif + + // setup the camera + boost::shared_ptr<Camera> oldCamera = mRenderServer->GetCamera(); + mRenderServer->SetCamera(mCamera); + mRenderServer->Render(); + +#ifdef USE_FBO +#else + glReadBuffer(GL_BACK); +#endif + int size = 3*w*h; + if ( mData.size() != size ) + mData.resize(size); + glReadPixels(0, 0, + w, h, + GL_RGB, + GL_UNSIGNED_BYTE, + const_cast<char*>(mData.data())); + + ++mFramesRendered; +#ifdef USE_FBO + // unbind FBO + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); +#endif + mRenderServer->SetCamera(oldCamera); + + return true; +} + +void ImagePerceptor::SetViewport(unsigned int x, unsigned int y, unsigned int w, unsigned int h) +{ + if ( 0!= mCamera ){ + mCamera->SetViewport(x,y,w,h); + } +} + +void ImagePerceptor::SetFOV(float fov) +{ + if ( 0!= mCamera ){ + mCamera->SetFOV(fov); + } +} + +void ImagePerceptor::SetZNear(float zNear) +{ + if ( 0!= mCamera ){ + mCamera->SetZNear(zNear); + } +} + +void ImagePerceptor::SetZFar(float zFar) +{ + if ( 0!= mCamera ){ + mCamera->SetZFar(zFar); + } +} Added: trunk/spark/plugin/imageperceptor/imageperceptor.h =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor.h (rev 0) +++ trunk/spark/plugin/imageperceptor/imageperceptor.h 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,73 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 RoboCup Soccer Server 3D Maintenance Group + $Id:$ + + 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; version 2 of the License. + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef IMAGEPERCEPTOR_H +#define IMAGEPERCEPTOR_H + +#include <oxygen/agentaspect/perceptor.h> +#include <oxygen/sceneserver/camera.h> +#include <oxygen/sceneserver/sceneserver.h> +#include <kerosin/renderserver/baserenderserver.h> +#include <kerosin/openglserver/openglserver.h> + +class ImagePerceptor : public oxygen::Perceptor +{ +public: + ImagePerceptor(); + virtual ~ImagePerceptor(); + + //! \return true, if valid data is available and false otherwise. + bool Percept(boost::shared_ptr<oxygen::PredicateList> predList); + + bool Render(); + + virtual void OnLink(); + virtual void OnUnlink(); + + void SetViewport(unsigned int x, unsigned int y, unsigned int w, unsigned int h); + + void SetFOV(float fov); + + void SetZNear(float zNear); + + void SetZFar(float zFar); + +private: + boost::shared_ptr<oxygen::Camera> mCamera; + + /** cached reference to the RenderServer */ + CachedPath<kerosin::BaseRenderServer> mRenderServer; + + /** cached reference to the OpenGLServer */ + CachedPath<kerosin::OpenGLServer> mOpenGLServer; + + /** total frames rendered */ + int mFramesRendered; + + std::string mData; + + unsigned int mFBOId; + unsigned int mRBOId; + unsigned int mDepthBuffer; +}; + +DECLARE_CLASS(ImagePerceptor); + +#endif //IMAGEPERCEPTOR_H Added: trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp (rev 0) +++ trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp 2009-01-22 11:21:46 UTC (rev 30) @@ -0,0 +1,100 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 RoboCup Soccer Server 3D Maintenance Group + $Id:$ + + 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; version 2 of the License. + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "imageperceptor.h" + +using namespace boost; +using namespace oxygen; + +FUNCTION(ImagePerceptor, setViewport) +{ + unsigned int x,y,w,h; + + if ( + (in.GetSize() != 4) || + (! in.GetValue(in[0], x) ) || + (! in.GetValue(in[1], y) ) || + (! in.GetValue(in[2], w) ) || + (! in.GetValue(in[3], h) ) + ) + { + return false; + } + + obj->SetViewport(x, y, w, h); + return true; +} + +FUNCTION(ImagePerceptor, setFOV) +{ + float fov; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in[0], fov) ) + ) + { + return false; + } + + obj->SetFOV(fov); + return true; +} + +FUNCTION(ImagePerceptor, setZNear) +{ + float zNear; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in[0], zNear) ) + ) + { + return false; + } + + obj->SetZNear(zNear); + return true; +} + +FUNCTION(ImagePerceptor, setZFar) +{ + float zFar; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in[0], zFar) ) + ) + { + return false; + } + + obj->SetZFar(zFar); + return true; +} + +void CLASS(ImagePerceptor)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Perceptor); + DEFINE_FUNCTION(setViewport); + DEFINE_FUNCTION(setFOV); + DEFINE_FUNCTION(setZNear); + DEFINE_FUNCTION(setZFar); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |