You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Braden M. <br...@us...> - 2007-01-23 10:06:24
|
Update of /cvsroot/openvrml/openvrml/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6069/src Modified Files: Makefile.am Log Message: Added openvrml-player, a stand-alone container for openvrml-gtkplug; libcurl is used for resource fetching. Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.am 1 Oct 2006 05:47:07 -0000 1.7 --- Makefile.am 23 Jan 2007 10:06:19 -0000 1.8 *************** *** 1 **** ! SUBDIRS = libopenvrml libopenvrml-gl openvrml-gtkplug --- 1 ---- ! SUBDIRS = libopenvrml libopenvrml-gl openvrml-gtkplug openvrml-player |
From: Braden M. <br...@us...> - 2007-01-23 10:06:23
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6069 Modified Files: ChangeLog configure.ac Log Message: Added openvrml-player, a stand-alone container for openvrml-gtkplug; libcurl is used for resource fetching. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** configure.ac 30 Dec 2006 23:37:43 -0000 1.104 --- configure.ac 23 Jan 2007 10:06:19 -0000 1.105 *************** *** 21,24 **** --- 21,25 ---- [src/libopenvrml-gl/openvrml-gl-config.h] [src/openvrml-gtkplug/Makefile] + [src/openvrml-player/Makefile] [examples/Makefile] [tests/Makefile] *************** *** 112,115 **** --- 113,119 ---- [have_js=no])]) PKG_CHECK_MODULES([GTK], [gtk+-2.0 gthread-2.0], , [have_gtk=no]) + PKG_CHECK_MODULES([GLADE], [libglade-2.0], , [have_libglade=no]) + PKG_CHECK_MODULES([GNOME], [libgnome-2.0], , [have_gnome=no]) + PKG_CHECK_MODULES([CURL], [libcurl], , [have_libcurl=no]) AC_PATH_XTRA AX_CHECK_GLU *************** *** 295,298 **** --- 299,313 ---- # + # build openvrml-player + # + AC_ARG_ENABLE([player], + [AC_HELP_STRING([--disable-player], + [do not build OpenVRML Player])]) + AS_IF([test X$enable_player != Xno], + [AS_IF([test X$enable_gtkplug = Xno], + [AC_MSG_FAILURE([OpenVRML Player cannot be built without the GtkPlug application])])]) + AM_CONDITIONAL([ENABLE_PLAYER], [test X$enable_player != Xno]) + + # # build Mozilla plug-in # Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1430 retrieving revision 1.1431 diff -C2 -d -r1.1430 -r1.1431 *** ChangeLog 23 Jan 2007 05:52:06 -0000 1.1430 --- ChangeLog 23 Jan 2007 10:06:19 -0000 1.1431 *************** *** 1,4 **** --- 1,18 ---- 2007-01-23 Braden McDaniel <br...@en...> + Added openvrml-player, a stand-alone container for + openvrml-gtkplug; libcurl is used for resource fetching. + + * configure.ac: Output src/openvrml-player/Makefile; check for + libglade, libgnome, and libcurl; allow building openvrml-player to + be disabled. + * src/Makefile.am (SUBDIRS): Added openvrml-player. + * src/openvrml-player/Makefile.am: Makefile for openvrml-player. + * src/openvrml-player/openvrml-player.glade: libglade XML input. + * src/openvrml-player/player.cpp: Stand-alone container for + openvrml-gtkplug; libcurl is used for resource fetching. + + 2007-01-23 Braden McDaniel <br...@en...> + Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. |
From: Braden M. <br...@us...> - 2007-01-23 09:55:03
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-player In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv851/src/openvrml-player Added Files: Tag: OpenVRML-0_16-BRANCH .cvsignore Makefile.am openvrml-player.glade player.cpp Log Message: Added openvrml-player, a stand-alone container for openvrml-gtkplug; libcurl is used for resource fetching. --- NEW FILE: player.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- // // Copyright 2006 Braden McDaniel // // 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 // # include <map> # include <memory> # include <list> # include <stdexcept> # include <string> # include <vector> # include <boost/concept_check.hpp> # include <boost/lexical_cast.hpp> # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/ref.hpp> # include <curl/curl.h> # include <libgnomevfs/gnome-vfs.h> # include <libgnome/libgnome.h> # include <gtk/gtk.h> # include <glade/glade.h> # ifdef HAVE_CONFIG_H # include <config.h> # endif using namespace boost::multi_index::detail; // for scope_guard extern "C" { void openvrml_player_watch_child(GPid pid, gint status, gpointer data); gboolean openvrml_player_request_data_available(GIOChannel * source, GIOCondition condition, gpointer data); gboolean openvrml_player_curl_prepare(GSource * source, gint * timeout); gboolean openvrml_player_curl_check(GSource * source); gboolean openvrml_player_curl_dispatch(GSource * source, GSourceFunc callback, gpointer user_data); void openvrml_player_curl_finalize(GSource * source); gboolean openvrml_player_curl_source_callback(gpointer data); size_t openvrml_player_curl_write(void * ptr, size_t size, size_t nmemb, void * stream); void openvrml_player_on_about_activated(GtkWindow * window); void openvrml_player_on_filechooserdialog_file_activated( GtkFileChooser * chooser, gpointer user_data); void openvrml_player_quit(); } namespace { G_GNUC_INTERNAL const char app_name[] = "OpenVRML Player"; G_GNUC_INTERNAL const char app_id[] = "openvrml-player"; G_GNUC_INTERNAL GIOChannel * command_channel; G_GNUC_INTERNAL GIOChannel * request_channel; G_GNUC_INTERNAL guint request_channel_watch_id; G_GNUC_INTERNAL ssize_t write_command(const std::string & command); G_GNUC_INTERNAL GSource * curl_source_new(CURLM * multi_handle); class G_GNUC_INTERNAL curl_stream_data { CURL * const handle_; std::vector<char> url_; bool initialized_; public: curl_stream_data(CURL * handle, const char * url); CURL * handle() const; const char * url() const; void initialize(); bool initialized() const; }; typedef std::map<CURL *, curl_stream_data> stream_data_map_t; struct curl_source_callback_data { GSource * curl_source; stream_data_map_t stream_data_map; }; struct request_data { std::stringstream request_line; curl_source_callback_data * source_callback_data; }; } int main(int argc, char * argv[]) { using std::string; using std::vector; using boost::lexical_cast; using boost::ref; if (!gnome_vfs_init()) { g_printerr("GnomeVFS initialization failed"); return EXIT_FAILURE; } if (curl_global_init(CURL_GLOBAL_ALL) != 0) { g_printerr("libcurl initialization failed"); return EXIT_FAILURE; } gchar ** remaining_args = 0; GOptionEntry option_entries[] = { { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args, "a URI for a VRML or X3D world", "[URI]" }, { 0, '\0', 0, G_OPTION_ARG_NONE, 0, 0, 0 } }; GOptionContext * const option_context = g_option_context_new("- render VRML/X3D worlds"); static const gchar * const translation_domain = 0; g_option_context_add_main_entries(option_context, option_entries, translation_domain); GnomeProgram * const program = gnome_program_init(app_id, PACKAGE_VERSION, LIBGNOME_MODULE, argc, argv, GNOME_PARAM_GOPTION_CONTEXT, option_context, GNOME_PARAM_NONE); const gchar * const gladedir = g_getenv("OPENVRML_PLAYER_GLADEDIR"); string glade_file_str; const gchar * glade_file = 0; if (gladedir) { glade_file_str = string(gladedir) + "/openvrml-player.glade"; glade_file = glade_file_str.c_str(); } if (!glade_file) { static const gboolean only_if_exists = true; glade_file = gnome_program_locate_file(program, GNOME_FILE_DOMAIN_APP_DATADIR, "/glade/openvrml-player.glade", only_if_exists, 0); } g_return_val_if_fail(glade_file, EXIT_FAILURE); GladeXML * const xml = glade_xml_new(glade_file, 0, 0); glade_xml_signal_autoconnect(xml); // // The OPENVRML_GTKPLUG environment variable overrides the default // path to the child process executable. To allow OPENVRML_GTKPLUG // to include arguments (rather than just be a path to an // executable), it is parsed with g_shell_parse_argv. This is // particularly useful in case we want to run the child process in // a harness like valgrind. // gint openvrml_gtkplug_cmd_argc = 0; gchar ** openvrml_gtkplug_cmd_argv = 0; scope_guard openvrml_gtkplug_cmd_argv_guard = make_guard(g_strfreev, ref(openvrml_gtkplug_cmd_argv)); boost::ignore_unused_variable_warning(openvrml_gtkplug_cmd_argv_guard); const gchar * const openvrml_gtkplug_cmd = g_getenv("OPENVRML_GTKPLUG"); if (!openvrml_gtkplug_cmd) { openvrml_gtkplug_cmd_argc = 1; openvrml_gtkplug_cmd_argv = static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); if (!openvrml_gtkplug_cmd_argv) { throw std::bad_alloc(); } openvrml_gtkplug_cmd_argv[0] = g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-gtkplug"); if (!openvrml_gtkplug_cmd_argv[0]) { throw std::bad_alloc(); } } else { GError * error = 0; scope_guard error_guard = make_guard(g_error_free, ref(error)); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, &openvrml_gtkplug_cmd_argc, &openvrml_gtkplug_cmd_argv, &error); if (!succeeded) { throw std::runtime_error(error ? error->message : "g_shell_parse_argv failure"); } error_guard.dismiss(); } GtkWidget * const socket = glade_xml_get_widget(xml, "socket"); string socket_id_arg = lexical_cast<string>(gtk_socket_get_id(GTK_SOCKET(socket))); const char * socket_id_arg_c_str = socket_id_arg.c_str(); vector<char> socket_id_arg_vec( socket_id_arg_c_str, socket_id_arg_c_str + socket_id_arg.length() + 1); const gint child_argv_size = openvrml_gtkplug_cmd_argc + 2; gchar ** const child_argv = static_cast<gchar **>(g_malloc(sizeof (gchar *) * child_argv_size)); if (!argv) { throw std::bad_alloc(); } scope_guard child_argv_guard = make_guard(g_free, child_argv); boost::ignore_unused_variable_warning(child_argv_guard); gint i; for (i = 0; i < openvrml_gtkplug_cmd_argc; ++i) { child_argv[i] = openvrml_gtkplug_cmd_argv[i]; } child_argv[i++] = &socket_id_arg_vec.front(); child_argv[i] = 0; gchar * const working_dir = g_get_current_dir(); if (!working_dir) { throw std::bad_alloc(); }; scope_guard working_dir_guard = make_guard(g_free, working_dir); boost::ignore_unused_variable_warning(working_dir_guard); gchar ** envp = 0; GPid child_pid; gint standard_input, standard_output; gint * const standard_error = 0; GError * error = 0; scope_guard error_guard = make_guard(g_error_free, ref(error)); gboolean succeeded = g_spawn_async_with_pipes(working_dir, child_argv, envp, G_SPAWN_DO_NOT_REAP_CHILD, 0, 0, &child_pid, &standard_input, &standard_output, standard_error, &error); if (!succeeded) { throw std::runtime_error(error ? error->message : "g_spawn_async_with_pipes failure"); } g_child_watch_add(child_pid, openvrml_player_watch_child, 0); // // Don't dismiss "error_guard" yet; we reuse "error" below. // ::command_channel = g_io_channel_unix_new(standard_input); if (!::command_channel) { throw std::bad_alloc(); } GIOStatus status = g_io_channel_set_encoding(::command_channel, 0, // binary (no encoding) &error); if (status != G_IO_STATUS_NORMAL) { throw std::runtime_error(error ? error->message : "g_io_channel_set_encoding failure"); } error_guard.dismiss(); ::request_channel = g_io_channel_unix_new(standard_output); if (!::request_channel) { throw std::bad_alloc(); } CURLM * const multi_handle = curl_multi_init(); g_return_val_if_fail(multi_handle, EXIT_FAILURE); GSource * const curl_source = curl_source_new(multi_handle); scope_guard curl_source_guard = make_guard(g_source_unref, curl_source); boost::ignore_unused_variable_warning(curl_source_guard); curl_source_callback_data callback_data; callback_data.curl_source = curl_source; g_source_set_callback(curl_source, openvrml_player_curl_source_callback, &callback_data, 0); g_source_attach(curl_source, 0); request_data req_data; req_data.source_callback_data = &callback_data; ::request_channel_watch_id = g_io_add_watch(::request_channel, G_IO_IN, openvrml_player_request_data_available, &req_data); GtkWidget * const window = glade_xml_get_widget(xml, "window"); gtk_widget_show(window); gtk_main(); curl_multi_cleanup(multi_handle); curl_global_cleanup(); } namespace { typedef std::list<GPollFD> poll_fds_t; struct CURLSource { GSource source; CURLM * multi_handle; size_t outstanding_handles; fd_set read_fds; fd_set write_fds; fd_set exc_fds; int max_fd; poll_fds_t * poll_fds; }; GSource * curl_source_new(CURLM * const multi_handle) { g_return_val_if_fail(multi_handle, 0); static GSourceFuncs curl_source_funcs = { openvrml_player_curl_prepare, openvrml_player_curl_check, openvrml_player_curl_dispatch, openvrml_player_curl_finalize }; CURLSource * const source = static_cast<CURLSource *>( static_cast<void *>( g_source_new(&curl_source_funcs, sizeof (CURLSource)))); source->multi_handle = multi_handle; source->outstanding_handles = 0; FD_ZERO(&source->read_fds); FD_ZERO(&source->write_fds); FD_ZERO(&source->exc_fds); source->max_fd = -1; source->poll_fds = new poll_fds_t; return static_cast<GSource *>(static_cast<void *>(source)); } G_GNUC_INTERNAL void reset_fds(CURLSource & curl_source) { FD_ZERO(&curl_source.read_fds); FD_ZERO(&curl_source.write_fds); FD_ZERO(&curl_source.exc_fds); curl_source.max_fd = -1; const CURLMcode result = curl_multi_fdset(curl_source.multi_handle, &curl_source.read_fds, &curl_source.write_fds, &curl_source.exc_fds, &curl_source.max_fd); if (result != CURLM_OK) { g_critical("%s", curl_multi_strerror(result)); } if (curl_source.max_fd < 0) { return; } // // Resize the list of fds to be polled; initialize any new entries. // const poll_fds_t::size_type prev_size = curl_source.poll_fds->size(); curl_source.poll_fds->resize(curl_source.max_fd + 1); if (curl_source.poll_fds->size() > prev_size) { poll_fds_t::iterator pos = curl_source.poll_fds->begin(); std::advance(pos, prev_size); for (gint fd = prev_size; pos != curl_source.poll_fds->end(); ++pos, ++fd) { pos->fd = fd; pos->events = 0; pos->revents = 0; } } for (poll_fds_t::iterator pos = curl_source.poll_fds->begin(); pos != curl_source.poll_fds->end(); ++pos) { gushort events = 0; if (FD_ISSET(pos->fd, &curl_source.read_fds)) { events |= G_IO_IN | G_IO_HUP | G_IO_ERR; } if (FD_ISSET(pos->fd, &curl_source.write_fds)) { events |= G_IO_OUT | G_IO_ERR; } if (FD_ISSET(pos->fd, &curl_source.exc_fds)) { events |= G_IO_ERR; } // // No change. // if (events == pos->events) { continue; } // // Changed; but already in the list of fds to poll. Just update // the event flags. // if (events && pos->events) { pos->events = events; continue; } pos->events = events; if (events) { g_source_add_poll(&curl_source.source, &(*pos)); } else { g_source_remove_poll(&curl_source.source, &(*pos)); pos->revents = 0; } } } } gboolean openvrml_player_curl_prepare(GSource * const source, gint * const timeout_) { CURLSource * const curl_source = static_cast<CURLSource *>(static_cast<void *>(source)); reset_fds(*curl_source); long t; *timeout_ = (curl_multi_timeout(curl_source->multi_handle, &t) == CURLM_OK) ? gint(t) : -1; return *timeout_ != -1; } gboolean openvrml_player_curl_check(GSource * const source) { CURLSource * const curl_source = static_cast<CURLSource *>(static_cast<void *>(source)); FD_ZERO(&curl_source->read_fds); FD_ZERO(&curl_source->write_fds); FD_ZERO(&curl_source->exc_fds); bool events_pending = false; for (poll_fds_t::const_iterator pos = curl_source->poll_fds->begin(); pos != curl_source->poll_fds->end(); ++pos) { gushort revents = pos->revents; if (revents == 0) { continue; } events_pending = true; if (revents & (G_IO_IN | G_IO_PRI)) { FD_SET(pos->fd, &curl_source->read_fds); } if (revents & G_IO_OUT) { FD_SET(pos->fd, &curl_source->write_fds); } if (revents & (G_IO_ERR | G_IO_HUP)) { FD_SET(pos->fd, &curl_source->exc_fds); } } const bool ready_for_dispatch = events_pending || curl_source->outstanding_handles > 0; return ready_for_dispatch; } gboolean openvrml_player_curl_dispatch(GSource * const source, const GSourceFunc callback, const gpointer user_data) { CURLSource * const curl_source = static_cast<CURLSource *>(static_cast<void *>(source)); int running_handles; CURLMcode perform_result; do { perform_result = curl_multi_perform(curl_source->multi_handle, &running_handles); } while (perform_result == CURLM_CALL_MULTI_PERFORM); if (running_handles == 0) { reset_fds(*curl_source); } if (callback) { (*callback)(user_data); } return true; } void openvrml_player_curl_finalize(GSource * const source) { CURLSource * const curl_source = static_cast<CURLSource *>(static_cast<void *>(source)); reset_fds(*curl_source); delete curl_source->poll_fds; } gboolean openvrml_player_curl_source_callback(const gpointer data) { curl_source_callback_data * const callback_data = static_cast<curl_source_callback_data *>(data); CURLSource * const curl_source = static_cast<CURLSource *>( static_cast<void *>(callback_data->curl_source)); CURLMsg * msg; int msgs_in_queue; while ((msg = curl_multi_info_read(curl_source->multi_handle, &msgs_in_queue))) { if (msg->msg == CURLMSG_DONE) { const stream_data_map_t::size_type num_erased = callback_data->stream_data_map.erase(msg->easy_handle); g_assert(num_erased == 1); g_assert(curl_source->outstanding_handles > 0); --curl_source->outstanding_handles; std::ostringstream command; command << "destroy-stream " << ptrdiff_t(msg->easy_handle) << '\n'; const ssize_t bytes_written = ::write_command(command.str()); g_return_val_if_fail( bytes_written == ssize_t(command.str().length()), false); // // Note that the call to curl_multi_remove_handle invalidates the // data pointed to by msg. Save the easy_handle in a temporary // variable so we can use it with curl_easy_cleanup below. // CURL * const easy_handle = msg->easy_handle; const CURLMcode multi_remove_result = curl_multi_remove_handle(curl_source->multi_handle, easy_handle); if (multi_remove_result != CURLM_OK) { g_critical("%s", curl_multi_strerror(multi_remove_result)); } curl_easy_cleanup(easy_handle); } } return true; } gboolean openvrml_player_request_data_available(GIOChannel * const source, GIOCondition, const gpointer data) { using std::string; using std::vector; using boost::ref; request_data & req_data = *static_cast<request_data *>(data); gchar c; do { gsize bytes_read; GError * error = 0; scope_guard error_guard = make_guard(g_error_free, ref(error)); const GIOStatus status = g_io_channel_read_chars(source, &c, 1, &bytes_read, &error); if (status == G_IO_STATUS_ERROR) { if (error) { g_warning(error->message); } return false; } if (status == G_IO_STATUS_EOF) { return false; } if (status == G_IO_STATUS_AGAIN) { continue; } g_return_val_if_fail(status == G_IO_STATUS_NORMAL, false); g_assert(bytes_read == 1); if (c != '\n') { req_data.request_line.put(c); } error_guard.dismiss(); } while (g_io_channel_get_buffer_condition(source) & G_IO_IN); if (c == '\n') { string request_type; req_data.request_line >> request_type; if (request_type == "get-url") { typedef std::map<CURL *, curl_stream_data> stream_data_map_t; string url, target; req_data.request_line >> url >> target; CURL * const handle = curl_easy_init(); g_assert(req_data.source_callback_data); stream_data_map_t::iterator pos = req_data.source_callback_data->stream_data_map.insert( std::make_pair(handle, curl_stream_data(handle, url.c_str()))) .first; g_assert(pos != req_data.source_callback_data->stream_data_map.end()); curl_stream_data & stream_data = pos->second; CURLcode setopt_result; setopt_result = curl_easy_setopt(handle, CURLOPT_URL, stream_data.url()); if (setopt_result != CURLE_OK) { g_critical("%s", curl_easy_strerror(setopt_result)); return false; } setopt_result = curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, openvrml_player_curl_write); if (setopt_result != CURLE_OK) { g_critical("%s", curl_easy_strerror(setopt_result)); return false; } setopt_result = curl_easy_setopt(handle, CURLOPT_WRITEDATA, &stream_data); g_assert(setopt_result == CURLE_OK); CURLSource * const curl_source = static_cast<CURLSource *>( static_cast<void *>( req_data.source_callback_data->curl_source)); const CURLMcode add_handle_result = curl_multi_add_handle(curl_source->multi_handle, handle); if (add_handle_result != CURLM_OK) { g_critical("%s", curl_multi_strerror(add_handle_result)); return false; } ++curl_source->outstanding_handles; std::ostringstream command; command << "get-url-result " << url << ' ' << 0 << '\n'; const ssize_t bytes_written = write_command(command.str()); g_return_val_if_fail( bytes_written == ssize_t(command.str().length()), false); if (req_data.source_callback_data->stream_data_map.size() == 1) { int running_handles; CURLMcode perform_result; do { perform_result = curl_multi_perform(curl_source->multi_handle, &running_handles); } while (perform_result == CURLM_CALL_MULTI_PERFORM); } } req_data.request_line.clear(); } return true; } size_t openvrml_player_curl_write(void * const ptr, const size_t size, const size_t nmemb, void * const stream) { curl_stream_data & stream_data = *static_cast<curl_stream_data *>(stream); if (!stream_data.initialized()) { using boost::ref; const char * type = 0; CURLcode result = curl_easy_getinfo(stream_data.handle(), CURLINFO_CONTENT_TYPE, &type); boost::ignore_unused_variable_warning(result); GnomeVFSFileInfo * info = 0; scope_guard info_guard = make_guard(gnome_vfs_file_info_unref, ref(info)); if (!type) { info = gnome_vfs_file_info_new(); GnomeVFSResult get_file_info_result = gnome_vfs_get_file_info(stream_data.url(), info, GNOME_VFS_FILE_INFO_GET_MIME_TYPE); if (get_file_info_result != GNOME_VFS_OK) { g_critical("%s", gnome_vfs_result_to_string(get_file_info_result)); } type = gnome_vfs_file_info_get_mime_type(info); } else { info_guard.dismiss(); } std::ostringstream command; command << "new-stream " << ptrdiff_t(stream_data.handle()) << ' ' << (type ? type : "application/octet-stream") << ' ' << stream_data.url() << '\n'; write_command(command.str()); stream_data.initialize(); } std::ostringstream command; command << "write " << ptrdiff_t(stream_data.handle()) << ' ' << size * nmemb << '\n'; const char * data; for (data = static_cast<char *>(ptr); data != static_cast<char *>(ptr) + size * nmemb; ++data) { command.put(*data); } const ssize_t bytes_written = ::write_command(command.str()); g_assert(bytes_written == ssize_t(command.str().length())); return size_t(data - static_cast<char *>(ptr)); } void openvrml_player_on_about_activated(GtkWindow * const parent) { const gchar website[] = "http://openvrml.org"; const gchar * authors[] = { "Braden McDaniel <br...@en...>", 0 }; const gchar copyright[] = "Copyright 2006"; const gchar license[] = "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.\n\n" "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.\n\n" "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"; gtk_show_about_dialog(parent, "name", app_name, "version", PACKAGE_VERSION, "website", website, "authors", authors, "copyright", copyright, "license", license, "wrap-license", true, NULL); } void openvrml_player_on_filechooserdialog_file_activated( GtkFileChooser * const chooser, gpointer) { gtk_widget_hide(GTK_WIDGET(chooser)); const gchar * const uri = gtk_file_chooser_get_uri(chooser); std::ostringstream command; command << "load-url " << uri << std::endl; ::write_command(command.str()); } void openvrml_player_quit() { gboolean succeeded = g_source_remove(::request_channel_watch_id); g_assert(succeeded); GError * error = 0; const gboolean flush = false; GIOStatus status = g_io_channel_shutdown(::request_channel, flush, &error); if (status != G_IO_STATUS_NORMAL) { if (error) { g_printerr(error->message); g_error_free(error); } } g_io_channel_unref(::request_channel); error = 0; status = g_io_channel_shutdown(::command_channel, flush, &error); if (status != G_IO_STATUS_NORMAL) { if (error) { g_printerr(error->message); g_error_free(error); } } g_io_channel_unref(::command_channel); } void openvrml_player_watch_child(const GPid pid, gint /* status */, gpointer /* data */) { g_spawn_close_pid(pid); gtk_main_quit(); } namespace { ssize_t write_command(const std::string & command) { g_assert(::command_channel); gsize bytes_written; GError * error = 0; GIOStatus status = g_io_channel_write_chars(::command_channel, command.data(), command.length(), &bytes_written, &error); if (status != G_IO_STATUS_NORMAL) { if (error) { g_printerr(error->message); g_error_free(error); } return -1; } do { status = g_io_channel_flush(::command_channel, &error); } while (status == G_IO_STATUS_AGAIN); if (status != G_IO_STATUS_NORMAL) { if (error) { g_printerr(error->message); g_error_free(error); } return -1; } return bytes_written; } curl_stream_data::curl_stream_data(CURL * const handle, const char * const url): handle_(handle), url_(url, url + strlen(url) + 1), // Get the trailing null. initialized_(false) {} CURL * curl_stream_data::handle() const { return this->handle_; } const char * curl_stream_data::url() const { return &this->url_.front(); } void curl_stream_data::initialize() { this->initialized_ = true; } bool curl_stream_data::initialized() const { return this->initialized_; } } // namespace --- NEW FILE: .cvsignore --- Makefile Makefile.in openvrml-player --- NEW FILE: openvrml-player.glade --- <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <glade-interface> <widget class="GtkWindow" id="window"> <property name="default-width">640</property> <property name="default-height">480</property> <signal name="delete-event" handler="openvrml_player_quit"/> <child> <widget class="GtkVBox" id="vbox1"> <property name="visible">True</property> <child> <widget class="GtkMenuBar" id="menubar1"> <property name="visible">True</property> <child> <widget class="GtkMenuItem" id="menuitem1"> <property name="visible">True</property> <property name="label" translatable="yes">_File</property> <property name="use_underline">True</property> <child> <widget class="GtkMenu" id="menu1"> <property name="visible">True</property> <child> <widget class="GtkImageMenuItem" id="imagemenuitem2"> <property name="visible">True</property> <property name="label" translatable="yes">gtk-open</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <signal name="activate" handler="gtk_widget_show" object="filechooserdialog"/> </widget> </child> <child> <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> <property name="visible">True</property> </widget> </child> <child> <widget class="GtkImageMenuItem" id="imagemenuitem5"> <property name="visible">True</property> <property name="label" translatable="yes">gtk-quit</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <signal name="activate" handler="openvrml_player_quit"/> </widget> </child> </widget> </child> </widget> </child> <child> <widget class="GtkMenuItem" id="menuitem4"> <property name="visible">True</property> <property name="label" translatable="yes">_Help</property> <property name="use_underline">True</property> <child> <widget class="GtkMenu" id="menu3"> <property name="visible">True</property> <child> <widget class="GtkImageMenuItem" id="imagemenuitem10"> <property name="visible">True</property> <property name="label" translatable="yes">gtk-about</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <signal name="activate" handler="openvrml_player_on_about_activated" object="window"/> </widget> </child> </widget> </child> </widget> </child> </widget> <packing> <property name="expand">False</property> </packing> </child> <child> <widget class="GtkHBox" id="hbox1"> <property name="visible">True</property> <child> <widget class="GtkEntry" id="entry1"> <property name="visible">True</property> </widget> </child> </widget> <packing> <property name="expand">False</property> <property name="position">1</property> </packing> </child> <child> <widget class="GtkSocket" id="socket"> <property name="visible">True</property> </widget> </child> <child> <widget class="GtkStatusbar" id="statusbar1"> <property name="visible">True</property> </widget> <packing> <property name="expand">False</property> <property name="position">3</property> </packing> </child> </widget> </child> </widget> <widget class="GtkFileChooserDialog" id="filechooserdialog"> <property name="border_width">5</property> <property name="has_separator">False</property> <signal name="delete-event" handler="gtk_widget_hide_on_delete"/> <signal name="file-activated" handler="openvrml_player_on_filechooserdialog_file_activated"/> <child internal-child="vbox"> <widget class="GtkVBox" id="dialog-vbox2"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property> <property name="spacing">2</property> <child> <placeholder/> </child> <child internal-child="action_area"> <widget class="GtkHButtonBox" id="dialog-action_area2"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property> <property name="layout_style">GTK_BUTTONBOX_END</property> <child> <placeholder/> </child> <child> <placeholder/> </child> </widget> <packing> <property name="expand">False</property> <property name="pack_type">GTK_PACK_END</property> </packing> </child> </widget> </child> </widget> </glade-interface> --- NEW FILE: Makefile.am --- AM_CPPFLAGS = \ -DG_DISABLE_DEPRECATED \ -DGTK_DISABLE_DEPRECATED \ -DGNOME_DISABLE_DEPRECATED \ -DOPENVRML_PLAYER_PKGDATADIR_=\"$(datadir)/openvrml-player\" \ -DOPENVRML_LIBEXECDIR_=\"$(libexecdir)\" AM_CXXFLAGS = @GNOME_CFLAGS@ @GLADE_CFLAGS@ @CURL_CFLAGS@ AM_LDFLAGS = -export-dynamic @GNOME_LIBS@ @GLADE_LIBS@ @CURL_LIBS@ gladedir = $(datadir)/openvrml-player/glade if ENABLE_PLAYER bin_PROGRAMS = openvrml-player glade_DATA = openvrml-player.glade endif openvrml_player_SOURCES = player.cpp EXTRA_DIST = \ $(openvrml_player_SOURCES) \ $(glade_DATA) |
From: Braden M. <br...@us...> - 2007-01-23 09:54:59
|
Update of /cvsroot/openvrml/openvrml/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv851/src Modified Files: Tag: OpenVRML-0_16-BRANCH Makefile.am Log Message: Added openvrml-player, a stand-alone container for openvrml-gtkplug; libcurl is used for resource fetching. Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/Makefile.am,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** Makefile.am 1 Oct 2006 05:48:29 -0000 1.6.2.1 --- Makefile.am 23 Jan 2007 09:54:57 -0000 1.6.2.2 *************** *** 1 **** ! SUBDIRS = libopenvrml libopenvrml-gl openvrml-gtkplug --- 1 ---- ! SUBDIRS = libopenvrml libopenvrml-gl openvrml-gtkplug openvrml-player |
From: Braden M. <br...@us...> - 2007-01-23 09:54:59
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv851 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog configure.ac Log Message: Added openvrml-player, a stand-alone container for openvrml-gtkplug; libcurl is used for resource fetching. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.92.2.12 retrieving revision 1.92.2.13 diff -C2 -d -r1.92.2.12 -r1.92.2.13 *** configure.ac 23 Jan 2007 06:39:56 -0000 1.92.2.12 --- configure.ac 23 Jan 2007 09:54:57 -0000 1.92.2.13 *************** *** 21,24 **** --- 21,25 ---- [src/libopenvrml-gl/openvrml-gl-config.h] [src/openvrml-gtkplug/Makefile] + [src/openvrml-player/Makefile] [examples/Makefile] [tests/Makefile] *************** *** 112,115 **** --- 113,119 ---- [have_js=no])]) PKG_CHECK_MODULES([GTK], [gtk+-2.0 gthread-2.0], , [have_gtk=no]) + PKG_CHECK_MODULES([GLADE], [libglade-2.0], , [have_libglade=no]) + PKG_CHECK_MODULES([GNOME], [libgnome-2.0], , [have_gnome=no]) + PKG_CHECK_MODULES([CURL], [libcurl], , [have_libcurl=no]) AC_PATH_XTRA AX_CHECK_GLU *************** *** 295,298 **** --- 299,313 ---- # + # build openvrml-player + # + AC_ARG_ENABLE([player], + [AC_HELP_STRING([--disable-player], + [do not build OpenVRML Player])]) + AS_IF([test X$enable_player != Xno], + [AS_IF([test X$enable_gtkplug = Xno], + [AC_MSG_FAILURE([OpenVRML Player cannot be built without the GtkPlug application])])]) + AM_CONDITIONAL([ENABLE_PLAYER], [test X$enable_player != Xno]) + + # # build Mozilla plug-in # Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.105 retrieving revision 1.1310.2.106 diff -C2 -d -r1.1310.2.105 -r1.1310.2.106 *** ChangeLog 23 Jan 2007 06:39:55 -0000 1.1310.2.105 --- ChangeLog 23 Jan 2007 09:54:57 -0000 1.1310.2.106 *************** *** 1,4 **** --- 1,18 ---- 2007-01-23 Braden McDaniel <br...@en...> + Added openvrml-player, a stand-alone container for + openvrml-gtkplug; libcurl is used for resource fetching. + + * configure.ac: Output src/openvrml-player/Makefile; check for + libglade, libgnome, and libcurl; allow building openvrml-player to + be disabled. + * src/Makefile.am (SUBDIRS): Added openvrml-player. + * src/openvrml-player/Makefile.am: Makefile for openvrml-player. + * src/openvrml-player/openvrml-player.glade: libglade XML input. + * src/openvrml-player/player.cpp: Stand-alone container for + openvrml-gtkplug; libcurl is used for resource fetching. + + 2007-01-23 Braden McDaniel <br...@en...> + * configure.ac: Removed redundant checks to see whether openvrml-gtkplug should be built (apparent cruft). |
From: Braden M. <br...@us...> - 2007-01-23 06:39:57
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20877 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog configure.ac Log Message: Removed redundant checks to see whether openvrml-gtkplug should be built (apparent cruft). Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.92.2.11 retrieving revision 1.92.2.12 diff -C2 -d -r1.92.2.11 -r1.92.2.12 *** configure.ac 30 Dec 2006 23:37:06 -0000 1.92.2.11 --- configure.ac 23 Jan 2007 06:39:56 -0000 1.92.2.12 *************** *** 306,317 **** fi - if test X$enable_gtkplug != Xno; then - if test X$have_gtk = Xno; then - AC_MSG_FAILURE([GTK+ is required to build the GtkPlug]) - fi - fi - AM_CONDITIONAL([ENABLE_GTKPLUG], - [test X$enable_gtkplug != Xno -a X$have_gtk != Xno]) - # # build examples --- 306,309 ---- Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.104 retrieving revision 1.1310.2.105 diff -C2 -d -r1.1310.2.104 -r1.1310.2.105 *** ChangeLog 23 Jan 2007 05:51:55 -0000 1.1310.2.104 --- ChangeLog 23 Jan 2007 06:39:55 -0000 1.1310.2.105 *************** *** 1,4 **** --- 1,9 ---- 2007-01-23 Braden McDaniel <br...@en...> + * configure.ac: Removed redundant checks to see whether + openvrml-gtkplug should be built (apparent cruft). + + 2007-01-23 Braden McDaniel <br...@en...> + Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. |
From: Braden M. <br...@us...> - 2007-01-23 05:52:11
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2396/src/openvrml-gtkplug Modified Files: main.cpp Log Message: Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/main.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** main.cpp 4 Jan 2007 06:34:01 -0000 1.10 --- main.cpp 23 Jan 2007 05:52:07 -0000 1.11 *************** *** 135,138 **** --- 135,150 ---- pos->second->buf_.put(this->in_->get()); } + } else if (command == "load-url") { + string url; + command_line_stream >> url; + + const gchar * urls[] = { g_strdup(url.c_str()), 0 }; + scope_guard urls_guard = + make_guard(g_free, + const_cast<void *>( + static_cast<const void *>(urls[0]))); + boost::ignore_unused_variable_warning(urls_guard); + + gtk_vrml_browser_load_url(this->vrml_browser_, urls, 0); } } |
From: Braden M. <br...@us...> - 2007-01-23 05:52:11
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2396 Modified Files: ChangeLog Log Message: Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1429 retrieving revision 1.1430 diff -C2 -d -r1.1429 -r1.1430 *** ChangeLog 23 Jan 2007 04:08:39 -0000 1.1429 --- ChangeLog 23 Jan 2007 05:52:06 -0000 1.1430 *************** *** 1,2 **** --- 1,13 ---- + 2007-01-23 Braden McDaniel <br...@en...> + + Added load-url command to openvrml-gtkplug; this facilitates + loading a new world into an existing component instance. + + * doc/openvrml-gtkplug.texi: Added description of load-url + command. + * src/openvrml-gtkplug/main.cpp + (command_istream_reader::operator()() const): Call + gtk_vrml_browser_load_url in response to a 'load-url' command. + 2007-01-22 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-01-23 05:52:11
|
Update of /cvsroot/openvrml/openvrml/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2396/doc Modified Files: openvrml-gtkplug.texi Log Message: Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. Index: openvrml-gtkplug.texi =================================================================== RCS file: /cvsroot/openvrml/openvrml/doc/openvrml-gtkplug.texi,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** openvrml-gtkplug.texi 30 Nov 2006 06:47:42 -0000 1.5 --- openvrml-gtkplug.texi 23 Jan 2007 05:52:07 -0000 1.6 *************** *** 264,267 **** --- 264,283 ---- @section Commands + @cindex load-url + @subsection @code{load-url} + + The @code{load-url} command initiates loading of a VRML or X3D world. + + This command takes the following form: + + @example + load-url @var{url} + @end example + + @table @var + @item url + A URL for a VRML or X3D world. + @end table + @cindex get-url-result @subsection @code{get-url-result} |
From: Braden M. <br...@us...> - 2007-01-23 05:51:57
|
Update of /cvsroot/openvrml/openvrml/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2005/doc Modified Files: Tag: OpenVRML-0_16-BRANCH openvrml-gtkplug.texi Log Message: Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. Index: openvrml-gtkplug.texi =================================================================== RCS file: /cvsroot/openvrml/openvrml/doc/openvrml-gtkplug.texi,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** openvrml-gtkplug.texi 30 Nov 2006 06:47:32 -0000 1.1.2.5 --- openvrml-gtkplug.texi 23 Jan 2007 05:51:55 -0000 1.1.2.6 *************** *** 264,267 **** --- 264,283 ---- @section Commands + @cindex load-url + @subsection @code{load-url} + + The @code{load-url} command initiates loading of a VRML or X3D world. + + This command takes the following form: + + @example + load-url @var{url} + @end example + + @table @var + @item url + A URL for a VRML or X3D world. + @end table + @cindex get-url-result @subsection @code{get-url-result} |
From: Braden M. <br...@us...> - 2007-01-23 05:51:57
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2005 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.103 retrieving revision 1.1310.2.104 diff -C2 -d -r1.1310.2.103 -r1.1310.2.104 *** ChangeLog 23 Jan 2007 04:08:06 -0000 1.1310.2.103 --- ChangeLog 23 Jan 2007 05:51:55 -0000 1.1310.2.104 *************** *** 1,2 **** --- 1,13 ---- + 2007-01-23 Braden McDaniel <br...@en...> + + Added load-url command to openvrml-gtkplug; this facilitates + loading a new world into an existing component instance. + + * doc/openvrml-gtkplug.texi: Added description of load-url + command. + * src/openvrml-gtkplug/main.cpp + (command_istream_reader::operator()() const): Call + gtk_vrml_browser_load_url in response to a 'load-url' command. + 2007-01-22 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-01-23 05:51:57
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2005/src/openvrml-gtkplug Modified Files: Tag: OpenVRML-0_16-BRANCH main.cpp Log Message: Added load-url command to openvrml-gtkplug; this facilitates loading a new world into an existing component instance. Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/main.cpp,v retrieving revision 1.2.2.9 retrieving revision 1.2.2.10 diff -C2 -d -r1.2.2.9 -r1.2.2.10 *** main.cpp 4 Jan 2007 06:33:51 -0000 1.2.2.9 --- main.cpp 23 Jan 2007 05:51:56 -0000 1.2.2.10 *************** *** 135,138 **** --- 135,150 ---- pos->second->buf_.put(this->in_->get()); } + } else if (command == "load-url") { + string url; + command_line_stream >> url; + + const gchar * urls[] = { g_strdup(url.c_str()), 0 }; + scope_guard urls_guard = + make_guard(g_free, + const_cast<void *>( + static_cast<const void *>(urls[0]))); + boost::ignore_unused_variable_warning(urls_guard); + + gtk_vrml_browser_load_url(this->vrml_browser_, urls, 0); } } |
From: Braden M. <br...@us...> - 2007-01-23 04:08:41
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26194/src/openvrml-gtkplug Modified Files: gtkvrmlbrowser.cpp Log Message: Because of the way rendering is currently intertwined with the core runtime, we can't safely do much while the browser is loading a new world. So, use an openvrml::browser_event::initialized event to trigger making the widget usable again. Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/gtkvrmlbrowser.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gtkvrmlbrowser.cpp 4 Jan 2007 03:44:11 -0000 1.9 --- gtkvrmlbrowser.cpp 23 Jan 2007 04:08:39 -0000 1.10 *************** *** 111,115 **** --- 111,131 ---- }; + + class GtkGLViewer; + + class G_GNUC_INTERNAL browser_listener : + public openvrml::browser_listener { + + GtkGLViewer & viewer_; + + public: + explicit browser_listener(GtkGLViewer & viewer); + + private: + virtual void do_browser_changed(const openvrml::browser_event & event); + }; + class G_GNUC_INTERNAL GtkGLViewer : public openvrml::gl::viewer { + friend class browser_listener; friend void (::gtk_vrml_browser_load_url)(GtkVrmlBrowser * vrml_browser, *************** *** 123,129 **** --- 139,152 ---- GdkEventExpose *, gpointer); + friend gboolean + (::gtk_vrml_browser_motion_notify_event)(GtkWidget *, + GdkEventMotion *, + gpointer); ::resource_fetcher fetcher_; openvrml::browser browser_; + ::browser_listener browser_listener_; + bool browser_initialized_; + boost::mutex browser_initialized_mutex_; GtkVrmlBrowser & vrml_browser_; guint timer; *************** *** 177,180 **** --- 200,208 ---- while (url && *url) { url_vec.push_back(*(url++)); } while (parameter && *parameter) { param_vec.push_back(*(parameter++)); } + + { + boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); + viewer.browser_initialized_ = false; + } viewer.browser_.load_url(url_vec, param_vec); } *************** *** 184,187 **** --- 212,219 ---- { GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); + { + boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); + viewer.browser_initialized_ = false; + } viewer.browser_.set_world(in); } *************** *** 275,278 **** --- 307,313 ---- GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); + boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); + if (!viewer.browser_initialized_) { return true; } + if (event->count == 0 && gdk_gl_drawable_make_current(gl_drawable, gl_context)) { *************** *** 457,465 **** GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { ! GtkGLViewer * const viewer = ! static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! g_assert(viewer); ! viewer->input(&info); } return true; --- 492,503 ---- GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); + if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { ! g_assert(GTK_VRML_BROWSER(widget)->viewer); ! GtkGLViewer & viewer = ! *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); ! if (!viewer.browser_initialized_) { return true; } ! viewer.input(&info); } return true; *************** *** 535,539 **** const int get_url_result = this->streambuf_->get_url_result(); if (get_url_result != 0) { ! this->setstate(std::ios_base::badbit); } --- 573,577 ---- const int get_url_result = this->streambuf_->get_url_result(); if (get_url_result != 0) { ! this->setstate(ios_base::badbit); } *************** *** 561,564 **** --- 599,619 ---- } + browser_listener::browser_listener(GtkGLViewer & viewer): + viewer_(viewer) + {} + + void + browser_listener::do_browser_changed(const openvrml::browser_event & event) + { + if (event.id() == openvrml::browser_event::initialized) { + using boost::mutex; + mutex::scoped_lock lock(this->viewer_.browser_initialized_mutex_); + this->viewer_.browser_initialized_ = true; + gdk_threads_enter(); + this->viewer_.post_redraw(); + gdk_threads_leave(); + } + } + // // We use stdout for communication with the host process; so send *************** *** 569,576 **** --- 624,634 ---- fetcher_(request_channel), browser_(this->fetcher_, std::cerr, std::cerr), + browser_listener_(*this), + browser_initialized_(true), vrml_browser_(vrml_browser), timer(0), redrawNeeded(false) { + this->browser_.add_listener(this->browser_listener_); this->browser_.viewer(this); } *************** *** 579,582 **** --- 637,641 ---- { if (this->timer) { g_source_remove(timer); } + this->browser_.remove_listener(this->browser_listener_); } |
From: Braden M. <br...@us...> - 2007-01-23 04:08:40
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26194 Modified Files: ChangeLog Log Message: Because of the way rendering is currently intertwined with the core runtime, we can't safely do much while the browser is loading a new world. So, use an openvrml::browser_event::initialized event to trigger making the widget usable again. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1428 retrieving revision 1.1429 diff -C2 -d -r1.1428 -r1.1429 *** ChangeLog 22 Jan 2007 23:38:01 -0000 1.1428 --- ChangeLog 23 Jan 2007 04:08:39 -0000 1.1429 *************** *** 1,4 **** --- 1,39 ---- 2007-01-22 Braden McDaniel <br...@en...> + Because of the way rendering is currently intertwined with the + core runtime, we can't safely do much while the browser is loading + a new world. So, use an openvrml::browser_event::initialized + event to trigger making the widget usable again. + + * src/openvrml-gtkplug/gtkvrmlbrowser.cpp + (browser_listener): Added implementation of + openvrml::browser_listener to respond to browser events. + (GtkGLViewer): Granted friendship to browser_listener; granted + friendship to gtk_vrml_browser_motion_notify_event. Added members + browser_listener_, browser_initialized_, and + browser_initialized_mutex_. + (gtk_vrml_browser_load_url(GtkVrmlBrowser *, const gchar **, const + gchar **)): Set browser_initialized_ to false before loading a new + world. + (gtk_vrml_browser_set_world(GtkVrmlBrowser *, + openvrml::resource_istream &)): Set browser_initialized_ to false + before loading a new world. + (gtk_vrml_browser_expose_event(GtkWidget *, GdkEventExpose *, + gpointer)): Don't redraw if browser_initialized_ is false. + (gtk_vrml_browser_motion_notify_event(GtkWidget *, + GdkEventMotion*, gpointer)): If browser_initialized_ is false, + bail. + (browser_listener::browser_listener(GtkGLViewer &)): Added + constructor definition. + (browser_listener::do_browser_changed(const + openvrml::browser_event &)): Added function definition. + (GtkGLViewer::GtkGLViewer(GIOChannel &, GtkVrmlBrowser &)): + Initialize browser_listener_ and browser_initialized_. Add + browser_listener_ to the browser. + (GtkGLViewer::~GtkGLViewer()): Remove browser_listener_ from the + browser. + + 2007-01-22 Braden McDaniel <br...@en...> + Separated specification of the view frustum from specification of the viewpoint. The former needs to happen before the background |
From: Braden M. <br...@us...> - 2007-01-23 04:08:12
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26117 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Because of the way rendering is currently intertwined with the core runtime, we can't safely do much while the browser is loading a new world. So, use an openvrml::browser_event::initialized event to trigger making the widget usable again. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.102 retrieving revision 1.1310.2.103 diff -C2 -d -r1.1310.2.102 -r1.1310.2.103 *** ChangeLog 22 Jan 2007 22:58:37 -0000 1.1310.2.102 --- ChangeLog 23 Jan 2007 04:08:06 -0000 1.1310.2.103 *************** *** 1,4 **** --- 1,39 ---- 2007-01-22 Braden McDaniel <br...@en...> + Because of the way rendering is currently intertwined with the + core runtime, we can't safely do much while the browser is loading + a new world. So, use an openvrml::browser_event::initialized + event to trigger making the widget usable again. + + * src/openvrml-gtkplug/gtkvrmlbrowser.cpp + (browser_listener): Added implementation of + openvrml::browser_listener to respond to browser events. + (GtkGLViewer): Granted friendship to browser_listener; granted + friendship to gtk_vrml_browser_motion_notify_event. Added members + browser_listener_, browser_initialized_, and + browser_initialized_mutex_. + (gtk_vrml_browser_load_url(GtkVrmlBrowser *, const gchar **, const + gchar **)): Set browser_initialized_ to false before loading a new + world. + (gtk_vrml_browser_set_world(GtkVrmlBrowser *, + openvrml::resource_istream &)): Set browser_initialized_ to false + before loading a new world. + (gtk_vrml_browser_expose_event(GtkWidget *, GdkEventExpose *, + gpointer)): Don't redraw if browser_initialized_ is false. + (gtk_vrml_browser_motion_notify_event(GtkWidget *, + GdkEventMotion*, gpointer)): If browser_initialized_ is false, + bail. + (browser_listener::browser_listener(GtkGLViewer &)): Added + constructor definition. + (browser_listener::do_browser_changed(const + openvrml::browser_event &)): Added function definition. + (GtkGLViewer::GtkGLViewer(GIOChannel &, GtkVrmlBrowser &)): + Initialize browser_listener_ and browser_initialized_. Add + browser_listener_ to the browser. + (GtkGLViewer::~GtkGLViewer()): Remove browser_listener_ from the + browser. + + 2007-01-22 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp (openvrml::gl::viewer::insert_background(const |
From: Braden M. <br...@us...> - 2007-01-23 04:08:12
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26117/src/openvrml-gtkplug Modified Files: Tag: OpenVRML-0_16-BRANCH gtkvrmlbrowser.cpp Log Message: Because of the way rendering is currently intertwined with the core runtime, we can't safely do much while the browser is loading a new world. So, use an openvrml::browser_event::initialized event to trigger making the widget usable again. Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/gtkvrmlbrowser.cpp,v retrieving revision 1.2.2.7 retrieving revision 1.2.2.8 diff -C2 -d -r1.2.2.7 -r1.2.2.8 *** gtkvrmlbrowser.cpp 4 Jan 2007 03:43:40 -0000 1.2.2.7 --- gtkvrmlbrowser.cpp 23 Jan 2007 04:08:08 -0000 1.2.2.8 *************** *** 111,115 **** --- 111,131 ---- }; + + class GtkGLViewer; + + class G_GNUC_INTERNAL browser_listener : + public openvrml::browser_listener { + + GtkGLViewer & viewer_; + + public: + explicit browser_listener(GtkGLViewer & viewer); + + private: + virtual void do_browser_changed(const openvrml::browser_event & event); + }; + class G_GNUC_INTERNAL GtkGLViewer : public openvrml::gl::viewer { + friend class browser_listener; friend void (::gtk_vrml_browser_load_url)(GtkVrmlBrowser * vrml_browser, *************** *** 123,128 **** --- 139,151 ---- GdkEventExpose *, gpointer); + friend gboolean + (::gtk_vrml_browser_motion_notify_event)(GtkWidget *, + GdkEventMotion *, + gpointer); ::browser browser_; + ::browser_listener browser_listener_; + bool browser_initialized_; + boost::mutex browser_initialized_mutex_; GtkVrmlBrowser & vrml_browser_; guint timer; *************** *** 176,179 **** --- 199,207 ---- while (url && *url) { url_vec.push_back(*(url++)); } while (parameter && *parameter) { param_vec.push_back(*(parameter++)); } + + { + boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); + viewer.browser_initialized_ = false; + } viewer.browser_.load_url(url_vec, param_vec); } *************** *** 183,186 **** --- 211,218 ---- { GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); + { + boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); + viewer.browser_initialized_ = false; + } viewer.browser_.set_world(in); } *************** *** 274,277 **** --- 306,312 ---- GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); + boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); + if (!viewer.browser_initialized_) { return true; } + if (event->count == 0 && gdk_gl_drawable_make_current(gl_drawable, gl_context)) { *************** *** 456,464 **** GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { ! GtkGLViewer * const viewer = ! static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! g_assert(viewer); ! viewer->input(&info); } return true; --- 491,502 ---- GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); + if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { ! g_assert(GTK_VRML_BROWSER(widget)->viewer); ! GtkGLViewer & viewer = ! *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); ! if (!viewer.browser_initialized_) { return true; } ! viewer.input(&info); } return true; *************** *** 539,543 **** const int get_url_result = this->streambuf_->get_url_result(); if (get_url_result != 0) { ! this->setstate(std::ios_base::badbit); } --- 577,581 ---- const int get_url_result = this->streambuf_->get_url_result(); if (get_url_result != 0) { ! this->setstate(ios_base::badbit); } *************** *** 565,575 **** --- 603,633 ---- } + browser_listener::browser_listener(GtkGLViewer & viewer): + viewer_(viewer) + {} + + void + browser_listener::do_browser_changed(const openvrml::browser_event & event) + { + if (event.id() == openvrml::browser_event::initialized) { + using boost::mutex; + mutex::scoped_lock lock(this->viewer_.browser_initialized_mutex_); + this->viewer_.browser_initialized_ = true; + gdk_threads_enter(); + this->viewer_.post_redraw(); + gdk_threads_leave(); + } + } + GtkGLViewer::GtkGLViewer(GIOChannel & request_channel, GtkVrmlBrowser & vrml_browser): browser_(request_channel), + browser_listener_(*this), + browser_initialized_(true), vrml_browser_(vrml_browser), timer(0), redrawNeeded(false) { + this->browser_.add_listener(this->browser_listener_); this->browser_.viewer(this); } *************** *** 578,581 **** --- 636,640 ---- { if (this->timer) { g_source_remove(timer); } + this->browser_.remove_listener(this->browser_listener_); } |
From: Braden M. <br...@us...> - 2007-01-22 23:38:05
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13318/src/libopenvrml/openvrml Modified Files: browser.cpp viewer.cpp viewer.h Log Message: Separated specification of the view frustum from specification of the viewpoint. The former needs to happen before the background is rendered; the latter needs to happen after it. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** browser.cpp 15 Jan 2007 17:34:05 -0000 1.201 --- browser.cpp 22 Jan 2007 23:38:01 -0000 1.202 *************** *** 6457,6467 **** if (!this->viewer_) { return; } - // - // Per-node_metatype rendering happens before viewer::set_viewpoint is called - // This is important for things like background rendering, since - // viewer::insert_background must be called before viewer::set_viewpoint. - // - this->node_metatype_map_.render(*this->viewer_); - if (this->new_view) { this->viewer_->reset_user_navigation(); --- 6457,6460 ---- *************** *** 6474,6477 **** --- 6467,6481 ---- const float visibilityLimit = nav_info.visibility_limit(); + this->viewer_->set_frustum(this->active_viewpoint_->field_of_view(), + avatarSize, + visibilityLimit); + + // + // Per-node_metatype rendering happens before viewer::set_viewpoint is called + // This is important for things like background rendering, since + // viewer::insert_background must be called before viewer::set_viewpoint. + // + this->node_metatype_map_.render(*this->viewer_); + // Activate the headlight. // ambient is supposed to be 0 according to the spec... *************** *** 6497,6501 **** this->viewer_->set_viewpoint(position, orientation, - this->active_viewpoint_->field_of_view(), avatarSize, visibilityLimit); --- 6501,6504 ---- Index: viewer.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/viewer.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** viewer.h 31 Oct 2006 03:43:06 -0000 1.13 --- viewer.h 22 Jan 2007 23:38:01 -0000 1.14 *************** *** 175,181 **** const vec2f & translation); void set_viewpoint(const vec3f & position, const rotation & orientation, - float field_of_view, float avatar_size, float visibility_limit); --- 175,183 ---- const vec2f & translation); + void set_frustum(float field_of_view, + float avatar_size, + float visibility_limit); void set_viewpoint(const vec3f & position, const rotation & orientation, float avatar_size, float visibility_limit); *************** *** 324,330 **** const vec2f & translation) = 0; virtual void do_set_viewpoint(const vec3f & position, const rotation & orientation, - float field_of_view, float avatar_size, float visibility_limit) = 0; --- 326,334 ---- const vec2f & translation) = 0; + virtual void do_set_frustum(float field_of_view, + float avatar_size, + float visibility_limit) = 0; virtual void do_set_viewpoint(const vec3f & position, const rotation & orientation, float avatar_size, float visibility_limit) = 0; Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/viewer.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** viewer.cpp 8 Nov 2006 06:58:46 -0000 1.15 --- viewer.cpp 22 Jan 2007 23:38:01 -0000 1.16 *************** *** 1065,1068 **** --- 1065,1094 ---- /** + * @brief Set the frustum. + * + * This function delegates to @c viewer::do_set_frustum. + * + * @param[in] field_of_view field of view. + * @param[in] avatar_size avatar size. + * @param[in] visibility_limit visibility limit. + */ + void openvrml::viewer::set_frustum(const float field_of_view, + const float avatar_size, + const float visibility_limit) + { + this->do_set_frustum(field_of_view, avatar_size, visibility_limit); + } + + /** + * @fn void openvrml::viewer::set_frustum(float field_of_view, float avatar_size, float visibility_limit) + * + * @brief Set the frustum. + * + * @param[in] field_of_view field of view. + * @param[in] avatar_size avatar size. + * @param[in] visibility_limit visibility limit. + */ + + /** * @brief Set the viewpoint. * *************** *** 1071,1075 **** * @param[in] position position. * @param[in] orientation orientation. - * @param[in] field_of_view field of view. * @param[in] avatar_size avatar size. * @param[in] visibility_limit visiblity limit. --- 1097,1100 ---- *************** *** 1077,1081 **** void openvrml::viewer::set_viewpoint(const vec3f & position, const rotation & orientation, - const float field_of_view, const float avatar_size, const float visibility_limit) --- 1102,1105 ---- *************** *** 1083,1087 **** this->do_set_viewpoint(position, orientation, - field_of_view, avatar_size, visibility_limit); --- 1107,1110 ---- *************** *** 1089,1093 **** /** ! * @fn void openvrml::viewer::do_set_viewpoint(const vec3f & position, const rotation & orientation, float field_of_view, float avatar_size, float visibility_limit) * * @brief Set the viewpoint. --- 1112,1116 ---- /** ! * @fn void openvrml::viewer::do_set_viewpoint(const vec3f & position, const rotation & orientation, float avatar_size, float visibility_limit) * * @brief Set the viewpoint. *************** *** 1095,1099 **** * @param[in] position position. * @param[in] orientation orientation. - * @param[in] field_of_view field of view. * @param[in] avatar_size avatar size. * @param[in] visibility_limit visiblity limit. --- 1118,1121 ---- |
From: Braden M. <br...@us...> - 2007-01-22 23:38:05
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13318/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp viewer.h Log Message: Separated specification of the view frustum from specification of the viewpoint. The former needs to happen before the background is rendered; the latter needs to happen after it. Index: viewer.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** viewer.h 22 Jan 2007 04:32:23 -0000 1.16 --- viewer.h 22 Jan 2007 23:38:01 -0000 1.17 *************** *** 297,303 **** const vec2f & translation); virtual void do_set_viewpoint(const vec3f & position, const openvrml::rotation & orientation, - float fieldOfView, float avatarSize, float visibilityLimit); --- 297,305 ---- const vec2f & translation); + virtual void do_set_frustum(float field_of_view, + float avatar_size, + float visibility_limit); virtual void do_set_viewpoint(const vec3f & position, const openvrml::rotation & orientation, float avatarSize, float visibilityLimit); Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** viewer.cpp 22 Jan 2007 22:58:47 -0000 1.59 --- viewer.cpp 22 Jan 2007 23:38:01 -0000 1.60 *************** *** 3806,3809 **** --- 3806,3830 ---- } + void openvrml::gl::viewer::do_set_frustum(float field_of_view, + const float avatar_size, + const float visibility_limit) + { + glMatrixMode(GL_PROJECTION); + if (!this->select_mode) { glLoadIdentity(); } + + (field_of_view *= 180.0) /= pi; + const float aspect = float(this->win_width) / this->win_height; + const float znear = (avatar_size > 0.0) + ? float(0.5 * avatar_size) + : 0.01f; + const float zfar = (visibility_limit > 0.0) + ? visibility_limit + : 30000.0f; + gluPerspective(field_of_view, aspect, znear, zfar); + + this->frustum(openvrml::frustum(field_of_view, aspect, znear, zfar)); + glMatrixMode(GL_MODELVIEW); + } + namespace { *************** *** 3847,3851 **** * @param[in] position position. * @param[in] orientation orientation. - * @param[in] fieldOfView field of view. * @param[in] avatarSize avatar size. * @param[in] visibilityLimit visiblity limit. --- 3868,3871 ---- *************** *** 3854,3875 **** openvrml::gl::viewer::do_set_viewpoint(const vec3f & position, const openvrml::rotation & orientation, - const float fieldOfView, const float avatarSize, const float visibilityLimit) { ! glMatrixMode( GL_PROJECTION ); ! if (!this->select_mode) { glLoadIdentity(); } ! ! float field_of_view = float(fieldOfView * 180.0 / pi); ! float aspect = float(this->win_width) / this->win_height; ! float znear = (avatarSize > 0.0) ! ? float(0.5 * avatarSize) ! : 0.01f; ! float zfar = (visibilityLimit > 0.0) ! ? visibilityLimit ! : 30000.0f; ! gluPerspective(field_of_view, aspect, znear, zfar); ! ! this->frustum(openvrml::frustum(field_of_view, aspect, znear, zfar)); glMatrixMode(GL_MODELVIEW); --- 3874,3886 ---- openvrml::gl::viewer::do_set_viewpoint(const vec3f & position, const openvrml::rotation & orientation, const float avatarSize, const float visibilityLimit) { ! const float znear = (avatarSize > 0.0) ! ? float(0.5 * avatarSize) ! : 0.01f; ! const float zfar = (visibilityLimit > 0.0) ! ? visibilityLimit ! : 30000.0f; glMatrixMode(GL_MODELVIEW); |
From: Braden M. <br...@us...> - 2007-01-22 23:38:05
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13318 Modified Files: ChangeLog Log Message: Separated specification of the view frustum from specification of the viewpoint. The former needs to happen before the background is rendered; the latter needs to happen after it. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1427 retrieving revision 1.1428 diff -C2 -d -r1.1427 -r1.1428 *** ChangeLog 22 Jan 2007 22:58:47 -0000 1.1427 --- ChangeLog 22 Jan 2007 23:38:01 -0000 1.1428 *************** *** 1,4 **** --- 1,33 ---- 2007-01-22 Braden McDaniel <br...@en...> + Separated specification of the view frustum from specification of + the viewpoint. The former needs to happen before the background + is rendered; the latter needs to happen after it. + + * src/libopenvrml/openvrml/browser.cpp + (openvrml::browser::render()): Render the node_metatypes after + setting the view frustum. + * src/libopenvrml/openvrml/viewer.cpp + (openvrml::viewer::set_frustum(float, float, float)): Added + function definition. + (openvrml::viewer::set_viewpoint(const vec3f &, const rotation & + orientation, float, float)): Removed field_of_view parameter. + * src/libopenvrml/openvrml/viewer.h + (openvrml::viewer): Added member functions set_frustum and + do_set_frustum. Removed field_of_view parameter from set_viewpoint + and do_set_viewpoint. + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (openvrml::gl::viewer::do_set_frustum(float, float, float)): Added + function. + (openvrml::gl::viewer::do_set_viewpoint(const vec3f &, const + openvrml::rotation &, float, float)): Removed fieldOfView + parameter; moved specification of the view frustum to + do_set_frustum. + * src/libopenvrml-gl/openvrml/gl/viewer.h + (openvrml::gl::viewer): Added member function do_set_frustum; + removed fieldOfView parameter from do_set_viewpoint. + + 2007-01-22 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp (openvrml::gl::viewer::insert_background(const |
From: Braden M. <br...@us...> - 2007-01-22 22:58:49
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29922 Modified Files: ChangeLog Log Message: Enabled #if 0'd code to put the background in a display list. So far, it seems harmless. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1426 retrieving revision 1.1427 diff -C2 -d -r1.1426 -r1.1427 *** ChangeLog 22 Jan 2007 21:10:09 -0000 1.1426 --- ChangeLog 22 Jan 2007 22:58:47 -0000 1.1427 *************** *** 1,4 **** --- 1,14 ---- 2007-01-22 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (openvrml::gl::viewer::insert_background(const + std::vector<float>&, const std::vector<color> &, const + std::vector<float> &, const std::vector<color> &, const image &, + const image &, const image &, const image &, const image &, const + image &)): Enabled #if 0'd code to put the background in a display + list. So far, it seems harmless. + + 2007-01-22 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/vrml97node.cpp (viewpoint_node::viewpoint_node(const node_type &, const |
From: Braden M. <br...@us...> - 2007-01-22 22:58:48
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29922/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Enabled #if 0'd code to put the background in a display list. So far, it seems harmless. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** viewer.cpp 22 Jan 2007 04:32:23 -0000 1.58 --- viewer.cpp 22 Jan 2007 22:58:47 -0000 1.59 *************** *** 1200,1211 **** // Need to separate the geometry from the transformation so the // dlist doesn't have to get rebuilt for every mouse movement... - # if 0 // Don't bother with a dlist if we aren't drawing anything ! if (!this->select_mode ! && (!skyAngle.empty() || !groundAngle.empty() || pixels)) { glid = glGenLists(1); glNewList(glid, GL_COMPILE_AND_EXECUTE); } - # endif glClearColor(r, g, b, a); --- 1200,1215 ---- // Need to separate the geometry from the transformation so the // dlist doesn't have to get rebuilt for every mouse movement... // Don't bother with a dlist if we aren't drawing anything ! if (!this->select_mode && (!skyAngle.empty() ! || !groundAngle.empty() ! || !front.array().empty() ! || !back.array().empty() ! || !left.array().empty() ! || !right.array().empty() ! || !top.array().empty() ! || !bottom.array().empty())) { glid = glGenLists(1); glNewList(glid, GL_COMPILE_AND_EXECUTE); } glClearColor(r, g, b, a); |
From: Braden M. <br...@us...> - 2007-01-22 22:58:39
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29896/src/libopenvrml-gl/openvrml/gl Modified Files: Tag: OpenVRML-0_16-BRANCH viewer.cpp Log Message: Enabled #if 0'd code to put the background in a display list. So far, it seems harmless. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.43.2.11 retrieving revision 1.43.2.12 diff -C2 -d -r1.43.2.11 -r1.43.2.12 *** viewer.cpp 22 Jan 2007 04:32:12 -0000 1.43.2.11 --- viewer.cpp 22 Jan 2007 22:58:37 -0000 1.43.2.12 *************** *** 1192,1203 **** // Need to separate the geometry from the transformation so the // dlist doesn't have to get rebuilt for every mouse movement... - # if 0 // Don't bother with a dlist if we aren't drawing anything ! if (!this->select_mode ! && (!skyAngle.empty() || !groundAngle.empty() || pixels)) { glid = glGenLists(1); glNewList(glid, GL_COMPILE_AND_EXECUTE); } - # endif glClearColor(r, g, b, a); --- 1192,1207 ---- // Need to separate the geometry from the transformation so the // dlist doesn't have to get rebuilt for every mouse movement... // Don't bother with a dlist if we aren't drawing anything ! if (!this->select_mode && (!skyAngle.empty() ! || !groundAngle.empty() ! || !front.array().empty() ! || !back.array().empty() ! || !left.array().empty() ! || !right.array().empty() ! || !top.array().empty() ! || !bottom.array().empty())) { glid = glGenLists(1); glNewList(glid, GL_COMPILE_AND_EXECUTE); } glClearColor(r, g, b, a); |
From: Braden M. <br...@us...> - 2007-01-22 22:58:39
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29896 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Enabled #if 0'd code to put the background in a display list. So far, it seems harmless. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.101 retrieving revision 1.1310.2.102 diff -C2 -d -r1.1310.2.101 -r1.1310.2.102 *** ChangeLog 22 Jan 2007 04:32:10 -0000 1.1310.2.101 --- ChangeLog 22 Jan 2007 22:58:37 -0000 1.1310.2.102 *************** *** 1,2 **** --- 1,12 ---- + 2007-01-22 Braden McDaniel <br...@en...> + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (openvrml::gl::viewer::insert_background(const + std::vector<float>&, const std::vector<color> &, const + std::vector<float> &, const std::vector<color> &, const image &, + const image &, const image &, const image &, const image &, const + image &)): Enabled #if 0'd code to put the background in a display + list. So far, it seems harmless. + 2007-01-21 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-01-22 21:10:43
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18269 Modified Files: ChangeLog Log Message: Reordered user_view_transform_ initialization to match declaration order. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1425 retrieving revision 1.1426 diff -C2 -d -r1.1425 -r1.1426 *** ChangeLog 22 Jan 2007 04:32:23 -0000 1.1425 --- ChangeLog 22 Jan 2007 21:10:09 -0000 1.1426 *************** *** 1,2 **** --- 1,9 ---- + 2007-01-22 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/vrml97node.cpp + (viewpoint_node::viewpoint_node(const node_type &, const + boost::shared_ptr<openvrml::scope> &)): Reordered + user_view_transform_ initialization to match declaration order. + 2007-01-21 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-01-22 21:10:16
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18269/src/libopenvrml/openvrml Modified Files: vrml97node.cpp Log Message: Reordered user_view_transform_ initialization to match declaration order. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** vrml97node.cpp 15 Jan 2007 17:34:06 -0000 1.119 --- vrml97node.cpp 22 Jan 2007 21:10:09 -0000 1.120 *************** *** 26747,26752 **** parent_transform(make_mat4f()), final_transformation(make_mat4f()), ! user_view_transform_(make_mat4f()), ! final_transformation_dirty(true) {} --- 26747,26752 ---- parent_transform(make_mat4f()), final_transformation(make_mat4f()), ! final_transformation_dirty(true), ! user_view_transform_(make_mat4f()) {} |