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...> - 2005-11-29 01:10:54
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11770 Modified Files: ChangeLog Log Message: externproto_node_class::externproto_node_class can throw boost::thread_resource_error. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1057 retrieving revision 1.1058 diff -C2 -d -r1.1057 -r1.1058 *** ChangeLog 29 Nov 2005 00:48:56 -0000 1.1057 --- ChangeLog 29 Nov 2005 01:10:44 -0000 1.1058 *************** *** 1,4 **** --- 1,10 ---- 2005-11-28 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp + (externproto_node_class::externproto_node_class): Can throw + boost::thread_resource_error. + + 2005-11-28 Braden McDaniel <br...@en...> + Doc-comment improvements. |
From: Braden M. <br...@us...> - 2005-11-29 00:49:08
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5963/src/libopenvrml/openvrml Modified Files: browser.cpp vrml97node.cpp Log Message: Doc-comment improvements. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** browser.cpp 28 Nov 2005 22:32:35 -0000 1.107 --- browser.cpp 29 Nov 2005 00:48:56 -0000 1.108 *************** *** 1015,1019 **** /** ! * @var abstract_proto_node::proto_eventin::listeners proto_node::proto_eventin::listeners_ * * @brief Set of event listeners to which events are delegated for --- 1015,1019 ---- /** ! * @var abstract_proto_node::proto_eventin::listeners abstract_proto_node::proto_eventin::listeners_ * * @brief Set of event listeners to which events are delegated for *************** *** 1378,1382 **** * @internal * ! * @class proto_node::proto_eventout * * @brief PROTO eventOut handler class template. --- 1378,1382 ---- * @internal * ! * @class abstract_proto_node::proto_eventout * * @brief PROTO eventOut handler class template. *************** *** 1475,1479 **** /** ! * @var abstract_proto_node::proto_eventout::listener_t proto_node::proto_eventout::listener * * @brief Listens for events emitted from nodes in the @c PROTO --- 1475,1479 ---- /** ! * @var abstract_proto_node::proto_eventout::listener_t abstract_proto_node::proto_eventout::listener * * @brief Listens for events emitted from nodes in the @c PROTO *************** *** 5682,5685 **** --- 5682,5691 ---- }; + /** + * @brief Construct. + * + * @param scene the <code>scene</code> in which the EXTERNPROTO occurs. + * @param uris the list of alternative implementation identifiers. + */ externproto_node_class:: externproto_node_class(openvrml::scene & scene, *************** *** 5691,5694 **** --- 5697,5703 ---- } + /** + * @brief Destroy. + */ externproto_node_class::~externproto_node_class() throw () {} Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** vrml97node.cpp 27 Nov 2005 06:13:00 -0000 1.86 --- vrml97node.cpp 29 Nov 2005 00:48:56 -0000 1.87 *************** *** 1312,1316 **** /** ! * @var abstract_node<Derived>::exposedfield<openvrml::sfnode> abstract_indexed_set_node<Derived>::color_ * * @brief color exposedField. --- 1312,1316 ---- /** ! * @var openvrml::node_impl_util::abstract_node<Derived>::exposedfield<openvrml::sfnode> abstract_indexed_set_node<Derived>::color_ * [...1489 lines suppressed...] * @brief enabled exposedField. --- 24708,24712 ---- /** ! * @var openvrml::node_impl_util::abstract_node<visibility_sensor_node>::exposedfield<openvrml::sfbool> visibility_sensor_node::enabled_ * * @brief enabled exposedField. *************** *** 24714,24718 **** /** ! * @var abstract_node<visibility_sensor_node>::exposedfield<openvrml::sfvec3f> visibility_sensor_node::size_ * * @brief size exposedField. --- 24714,24718 ---- /** ! * @var openvrml::node_impl_util::abstract_node<visibility_sensor_node>::exposedfield<openvrml::sfvec3f> visibility_sensor_node::size_ * * @brief size exposedField. |
From: Braden M. <br...@us...> - 2005-11-29 00:49:06
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5963 Modified Files: ChangeLog Log Message: Doc-comment improvements. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1056 retrieving revision 1.1057 diff -C2 -d -r1.1056 -r1.1057 *** ChangeLog 28 Nov 2005 22:32:35 -0000 1.1056 --- ChangeLog 29 Nov 2005 00:48:56 -0000 1.1057 *************** *** 1,4 **** --- 1,11 ---- 2005-11-28 Braden McDaniel <br...@en...> + Doc-comment improvements. + + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/vrml97node.cpp + + 2005-11-28 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp (externproto_node::set_proto_node): Changed proto_eventin to |
From: Braden M. <br...@us...> - 2005-11-28 22:32:45
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3385 Modified Files: ChangeLog Log Message: Changed proto_eventin to eventin and proto_eventout to eventout; required for Microsoft cl 13.10.3077. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1055 retrieving revision 1.1056 diff -C2 -d -r1.1055 -r1.1056 *** ChangeLog 28 Nov 2005 04:03:47 -0000 1.1055 --- ChangeLog 28 Nov 2005 22:32:35 -0000 1.1056 *************** *** 1,2 **** --- 1,9 ---- + 2005-11-28 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/browser.cpp + (externproto_node::set_proto_node): Changed proto_eventin to + eventin and proto_eventout to eventout; required for Microsoft cl + 13.10.3077. + 2005-11-27 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2005-11-28 22:32:42
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3385/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Changed proto_eventin to eventin and proto_eventout to eventout; required for Microsoft cl 13.10.3077. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** browser.cpp 28 Nov 2005 04:03:47 -0000 1.106 --- browser.cpp 28 Nov 2005 22:32:35 -0000 1.107 *************** *** 6079,6086 **** map_entry != this->eventin_map.end(); ++map_entry) { ! openvrml::event_listener & proto_eventin = this->proto_node_->event_listener(map_entry->first); bool succeeded = eventin_is(map_entry->second->type(), ! proto_eventin, *map_entry->second); assert(succeeded); --- 6079,6086 ---- map_entry != this->eventin_map.end(); ++map_entry) { ! openvrml::event_listener & eventin = this->proto_node_->event_listener(map_entry->first); bool succeeded = eventin_is(map_entry->second->type(), ! eventin, *map_entry->second); assert(succeeded); *************** *** 6091,6098 **** map_entry != this->eventout_map.end(); ++map_entry) { ! openvrml::event_emitter & proto_eventout = this->proto_node_->event_emitter(map_entry->first); bool succeeded = eventout_is(map_entry->second->value().type(), ! proto_eventout, *map_entry->second); assert(succeeded); --- 6091,6098 ---- map_entry != this->eventout_map.end(); ++map_entry) { ! openvrml::event_emitter & eventout = this->proto_node_->event_emitter(map_entry->first); bool succeeded = eventout_is(map_entry->second->value().type(), ! eventout, *map_entry->second); assert(succeeded); |
From: Braden M. <br...@us...> - 2005-11-28 04:04:00
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10460/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Load EXTERNPROTO implementations (asynchronously). Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** browser.cpp 27 Nov 2005 16:58:15 -0000 1.105 --- browser.cpp 28 Nov 2005 04:03:47 -0000 1.106 *************** *** 314,318 **** --- 314,324 ---- abstract_proto_node::~abstract_proto_node() throw () {} + } // namespace openvrml + + namespace { + class externproto_node; + } + namespace openvrml { /** *************** *** 350,353 **** --- 356,361 ---- */ class OPENVRML_LOCAL proto_node : public abstract_proto_node { + friend class ::externproto_node; + template <typename FieldValue> class proto_exposedfield : public proto_eventin<FieldValue>, *************** *** 2294,2297 **** --- 2302,2308 ---- (*node)->initialize(*this->scene(), timestamp); } + if (!this->impl_nodes.empty()) { + this->impl_nodes.front()->modified(true); + } } *************** *** 2738,2748 **** namespace { class OPENVRML_LOCAL externproto_node_class : public openvrml::node_class { ! std::vector<std::string> alt_uris; public: ! externproto_node_class( ! openvrml::scene & scene, ! const std::vector<std::string> & uris) throw (); virtual ~externproto_node_class() throw (); --- 2749,2769 ---- namespace { + class externproto_node_type; + class OPENVRML_LOCAL externproto_node_class : public openvrml::node_class { ! struct load_proto; ! ! mutable boost::mutex mutex_; ! boost::shared_ptr<openvrml::node_class> proto_node_class_; ! ! typedef std::vector<boost::shared_ptr<externproto_node_type> > ! externproto_node_types; ! ! mutable externproto_node_types externproto_node_types_; public: ! externproto_node_class(openvrml::scene & scene, ! const std::vector<std::string> & uris) ! throw (); virtual ~externproto_node_class() throw (); *************** *** 2752,2762 **** --- 2773,2797 ---- const openvrml::node_interface_set & interfaces) const throw (openvrml::unsupported_interface, std::bad_alloc); + + void set_proto_node_class( + const boost::shared_ptr<openvrml::proto_node_class> & proto_node_class) + throw (std::bad_alloc); }; + class externproto_node; + class OPENVRML_LOCAL externproto_node_type : public openvrml::node_type { + mutable boost::mutex mutex_; openvrml::node_interface_set interfaces_; boost::shared_ptr<openvrml::node_class> owning_ptr_to_class_; + typedef std::vector<boost::intrusive_ptr<externproto_node> > + externproto_nodes; + + mutable externproto_nodes externproto_nodes_; + + boost::shared_ptr<openvrml::proto_node_type> proto_node_type_; + public: externproto_node_type(const openvrml::node_class & c, *************** *** 2771,2774 **** --- 2806,2812 ---- throw (); + void set_proto_node_type(openvrml::proto_node_class & proto_node_class) + throw (std::bad_alloc); + private: virtual const openvrml::node_interface_set & do_interfaces() const *************** *** 2791,2805 **** public FieldValue, public proto_eventin<FieldValue>, ! public openvrml::field_value_emitter<FieldValue> { public: ! explicit externproto_exposedfield(externproto_node & node) throw (); virtual ~externproto_exposedfield() throw (); private: virtual void do_process_event(const FieldValue & value, double timestamp) throw (std::bad_alloc); - virtual const std::string do_eventout_id() const throw (); }; --- 2829,2846 ---- public FieldValue, public proto_eventin<FieldValue>, ! public proto_eventout<FieldValue> { public: ! explicit externproto_exposedfield( ! externproto_node & node, ! const FieldValue & initial_value = FieldValue()) throw (); virtual ~externproto_exposedfield() throw (); private: + virtual std::auto_ptr<openvrml::field_value> do_clone() const + throw (std::bad_alloc); virtual void do_process_event(const FieldValue & value, double timestamp) throw (std::bad_alloc); }; *************** *** 2832,2835 **** --- 2873,2878 ---- field_map field_map_; + boost::intrusive_ptr<openvrml::proto_node> proto_node_; + public: externproto_node(const externproto_node_type & type, *************** *** 2840,2844 **** --- 2883,2895 ---- virtual ~externproto_node() throw (); + virtual bool modified() const; + + void set_proto_node(openvrml::proto_node_type & node_type) + throw (std::bad_alloc); + private: + virtual void do_initialize(double timestamp) + throw (std::bad_alloc); + virtual const openvrml::field_value & do_field(const std::string & id) const *************** *** 2852,2855 **** --- 2903,2934 ---- do_event_emitter(const std::string & id) throw (openvrml::unsupported_interface); + + virtual void do_shutdown(double timestamp) throw (); + + virtual openvrml::script_node * to_script() throw (); + virtual openvrml::appearance_node * to_appearance() throw (); + virtual openvrml::bounded_volume_node * to_bounded_volume() throw (); + virtual openvrml::child_node * to_child() throw (); + virtual openvrml::color_node * to_color() throw (); + virtual openvrml::coordinate_node * to_coordinate() throw (); + virtual openvrml::font_style_node * to_font_style() throw () ; + virtual openvrml::geometry_node * to_geometry() throw (); + virtual openvrml::grouping_node * to_grouping() throw (); + virtual openvrml::light_node * to_light() throw (); + virtual openvrml::material_node * to_material() throw (); + virtual openvrml::navigation_info_node * to_navigation_info() throw (); + virtual openvrml::normal_node * to_normal() throw (); + virtual openvrml::pointing_device_sensor_node * + to_pointing_device_sensor() throw (); + virtual openvrml::scoped_light_node * to_scoped_light() throw (); + virtual openvrml::sound_source_node * to_sound_source() throw (); + virtual openvrml::texture_node * to_texture() throw (); + virtual openvrml::texture_coordinate_node * to_texture_coordinate() + throw (); + virtual openvrml::texture_transform_node * to_texture_transform() + throw (); + virtual openvrml::time_dependent_node * to_time_dependent() throw (); + virtual openvrml::transform_node * to_transform() throw (); + virtual openvrml::viewpoint_node * to_viewpoint() throw (); }; *************** *** 5508,5517 **** namespace { externproto_node_class:: externproto_node_class(openvrml::scene & scene, ! const std::vector<std::string> & /* uris */) ! throw (): node_class(scene.browser()) ! {} externproto_node_class::~externproto_node_class() throw () --- 5587,5693 ---- namespace { + struct OPENVRML_LOCAL externproto_node_class::load_proto { + load_proto(externproto_node_class & externproto_class, + openvrml::scene & scene, + const std::vector<std::string> & alt_uris): + externproto_node_class_(&externproto_class), + scene_(&scene), + alt_uris_(alt_uris) + {} + + void operator()() const throw () + try { + using openvrml::unreachable_url; + try { + using std::auto_ptr; + using std::string; + using std::vector; + using boost::algorithm::iequals; + using boost::dynamic_pointer_cast; + using boost::shared_ptr; + using openvrml::resource_istream; + using openvrml::node_class_id; + + auto_ptr<resource_istream> in = + this->scene_->get_resource(this->alt_uris_); + if (!(*in)) { throw unreachable_url(); } + + // + // We don't actually do anything with this; but the parser + // wants it. + // + std::vector<boost::intrusive_ptr<openvrml::node> > nodes; + + if (iequals(in->type(), "model/vrml") + || iequals(in->type(), "x-world/x-vrml")) { + Vrml97Scanner scanner(*in); + openvrml::Vrml97Parser parser(scanner, in->url()); + parser.vrmlScene(*this->scene_, nodes); + } else if (iequals(in->type(), "model/x3d+vrml")) { + X3DVrmlScanner scanner(*in); + openvrml::X3DVrmlParser parser(scanner, in->url()); + parser.vrmlScene(*this->scene_, nodes); + } else { + throw openvrml::bad_media_type(in->type()); + } + + shared_ptr<openvrml::proto_node_class> proto_node_class; + for (vector<string>::const_iterator alt_uri = + this->alt_uris_.begin(); + alt_uri != this->alt_uris_.end() && !proto_node_class; + ++alt_uri) { + const uri absolute_uri = !relative(uri(*alt_uri)) + ? uri(*alt_uri) + : uri(*alt_uri).resolve_against( + uri(this->scene_->url())); + + const shared_ptr<openvrml::node_class> node_class = + this->scene_->browser() + .node_class(node_class_id(absolute_uri)); + + proto_node_class = + dynamic_pointer_cast<openvrml::proto_node_class>( + node_class); + } + + if (!proto_node_class) { + this->scene_->browser().err + << "no PROTO definition at <" << in->url() << ">" + << std::endl; + return; + } + + this->externproto_node_class_ + ->set_proto_node_class(proto_node_class); + + } catch (std::exception & ex) { + this->scene_->browser().err << ex.what() << std::endl; + throw unreachable_url(); + } catch (...) { + // + // The implementation of resource_istream is provided by + // the user; and unfortunately, operations on it could + // throw anything. + // + throw unreachable_url(); + } + } catch (std::exception & ex) { + this->scene_->browser().err << ex.what() << std::endl; + } + + private: + externproto_node_class * externproto_node_class_; + openvrml::scene * scene_; + std::vector<std::string> alt_uris_; + }; + externproto_node_class:: externproto_node_class(openvrml::scene & scene, ! const std::vector<std::string> & uris) throw (): node_class(scene.browser()) ! { ! boost::function0<void> f = load_proto(*this, scene, uris); ! boost::thread t(f); ! } externproto_node_class::~externproto_node_class() throw () *************** *** 5524,5531 **** throw (openvrml::unsupported_interface, std::bad_alloc) { ! using openvrml::node_type; ! return boost::shared_ptr<node_type>( ! static_cast<node_type *>( ! new externproto_node_type(*this, id, interfaces))); } --- 5700,5741 ---- throw (openvrml::unsupported_interface, std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->mutex_); ! ! if (this->proto_node_class_) { ! return this->proto_node_class_->create_type(id, interfaces); ! } ! ! using boost::shared_ptr; ! const shared_ptr<externproto_node_type> node_type( ! new externproto_node_type(*this, id, interfaces)); ! ! this->externproto_node_types_.push_back(node_type); ! ! return node_type; ! } ! ! void externproto_node_class::set_proto_node_class( ! const boost::shared_ptr<openvrml::proto_node_class> & proto_node_class) ! throw (std::bad_alloc) ! { ! using boost::shared_ptr; ! using boost::static_pointer_cast; ! ! boost::mutex::scoped_lock lock(this->mutex_); ! this->proto_node_class_ = proto_node_class; ! ! // ! // Now that we have a proto_node_class, we need to tell all the ! // externproto_node_types we've created so that they can in turn ! // tell the externproto_nodes they've created. ! // ! for (externproto_node_types::const_iterator node_type = ! this->externproto_node_types_.begin(); ! node_type != this->externproto_node_types_.end(); ! ++node_type) { ! assert(*node_type); ! (*node_type)->set_proto_node_type(*proto_node_class); ! } ! this->externproto_node_types_.clear(); } *************** *** 5555,5561 **** --- 5765,5798 ---- const boost::shared_ptr<openvrml::node_class> & node_class) throw () { + assert(node_class); + assert(!this->owning_ptr_to_class_); this->owning_ptr_to_class_ = node_class; } + void + externproto_node_type:: + set_proto_node_type(openvrml::proto_node_class & proto_node_class) + throw (std::bad_alloc) + { + boost::mutex::scoped_lock lock(this->mutex_); + + assert(!this->proto_node_type_); + + using boost::static_pointer_cast; + + this->proto_node_type_ = + static_pointer_cast<openvrml::proto_node_type>( + proto_node_class.create_type(this->id(), + this->interfaces_)); + + for (externproto_nodes::const_iterator node = + this->externproto_nodes_.begin(); + node != this->externproto_nodes_.end(); + ++node) { + (*node)->set_proto_node(*this->proto_node_type_); + } + this->externproto_nodes_.clear(); + } + const openvrml::node_interface_set & externproto_node_type::do_interfaces() const throw() *************** *** 5570,5577 **** throw (openvrml::unsupported_interface, std::bad_cast, std::bad_alloc) { ! using openvrml::node; ! return boost::intrusive_ptr<node>( ! static_cast<node *>( ! new externproto_node(*this, scope, initial_values))); } --- 5807,5821 ---- throw (openvrml::unsupported_interface, std::bad_cast, std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->mutex_); ! ! if (this->proto_node_type_) { ! return this->proto_node_type_->create_node(scope, initial_values); ! } ! ! const boost::intrusive_ptr<externproto_node> result( ! new externproto_node(*this, scope, initial_values)); ! ! this->externproto_nodes_.push_back(result); ! return result; } *************** *** 5579,5588 **** template <typename FieldValue> externproto_node::externproto_exposedfield<FieldValue>:: ! externproto_exposedfield(externproto_node & node) throw (): openvrml::node_event_listener(node), openvrml::event_emitter(static_cast<openvrml::field_value &>(*this)), proto_eventin<FieldValue>(node), ! openvrml::field_value_emitter<FieldValue>( ! static_cast<FieldValue &>(*this)) {} --- 5823,5833 ---- template <typename FieldValue> externproto_node::externproto_exposedfield<FieldValue>:: ! externproto_exposedfield(externproto_node & node, ! const FieldValue & initial_value) throw (): openvrml::node_event_listener(node), openvrml::event_emitter(static_cast<openvrml::field_value &>(*this)), + FieldValue(initial_value), proto_eventin<FieldValue>(node), ! proto_eventout<FieldValue>(node, initial_value) {} *************** *** 5593,5596 **** --- 5838,5854 ---- template <typename FieldValue> + std::auto_ptr<openvrml::field_value> + externproto_node::externproto_exposedfield<FieldValue>::do_clone() const + throw (std::bad_alloc) + { + using boost::polymorphic_downcast; + return std::auto_ptr<openvrml::field_value>( + new externproto_exposedfield<FieldValue>( + *polymorphic_downcast<externproto_node *>(&this->node()), + *this)); + } + + + template <typename FieldValue> void externproto_node::externproto_exposedfield<FieldValue>:: do_process_event(const FieldValue & value, const double timestamp) *************** *** 5603,5622 **** } - template <typename FieldValue> - const std::string - externproto_node::externproto_exposedfield<FieldValue>:: - do_eventout_id() const throw () - { - using boost::polymorphic_downcast; - externproto_node & node = - *polymorphic_downcast<externproto_node *>(&this->node()); - field_map::const_iterator pos = - std::find_if(node.field_map_.begin(), - node.field_map_.end(), - externproto_field_equal_to(*this)); - assert(pos != node.field_map_.end()); - return pos->first; - } - const boost::shared_ptr<openvrml::field_value> externproto_node::create_exposedfield(externproto_node & node, --- 5861,5864 ---- *************** *** 5814,5821 **** --- 6056,6124 ---- {} + bool externproto_node::modified() const + { + return this->proto_node_ + ? this->proto_node_->modified() + : false; + } + + void + externproto_node::set_proto_node(openvrml::proto_node_type & node_type) + throw (std::bad_alloc) + { + boost::recursive_mutex::scoped_lock lock(this->mutex()); + + using boost::static_pointer_cast; + + this->proto_node_ = + static_pointer_cast<openvrml::proto_node>( + node_type.create_node(this->scope(), this->field_map_)); + + for (eventin_map_t::const_iterator map_entry = + this->eventin_map.begin(); + map_entry != this->eventin_map.end(); + ++map_entry) { + openvrml::event_listener & proto_eventin = + this->proto_node_->event_listener(map_entry->first); + bool succeeded = eventin_is(map_entry->second->type(), + proto_eventin, + *map_entry->second); + assert(succeeded); + } + + for (eventout_map_t::const_iterator map_entry = + this->eventout_map.begin(); + map_entry != this->eventout_map.end(); + ++map_entry) { + openvrml::event_emitter & proto_eventout = + this->proto_node_->event_emitter(map_entry->first); + bool succeeded = eventout_is(map_entry->second->value().type(), + proto_eventout, + *map_entry->second); + assert(succeeded); + } + + if (this->scene()) { + this->proto_node_->initialize(*this->scene(), + openvrml::browser::current_time()); + } + } + + void externproto_node::do_initialize(const double timestamp) + throw (std::bad_alloc) + { + if (this->proto_node_) { + this->proto_node_->initialize(*this->scene(), timestamp); + } + } + const openvrml::field_value & externproto_node::do_field(const std::string & id) const throw (openvrml::unsupported_interface) { + if (this->proto_node_) { + return this->proto_node_->do_field(id); + } + field_map::const_iterator pos = this->field_map_.find(id); if (pos == this->field_map_.end()) { *************** *** 5831,5834 **** --- 6134,6141 ---- throw (openvrml::unsupported_interface) { + if (this->proto_node_) { + return this->proto_node_->do_event_listener(id); + } + eventin_map_t::const_iterator pos = this->eventin_map.find(id); if (pos == this->eventin_map.end()) { *************** *** 5844,5847 **** --- 6151,6158 ---- throw (openvrml::unsupported_interface) { + if (this->proto_node_) { + return this->proto_node_->do_event_emitter(id); + } + eventout_map_t::const_iterator pos = this->eventout_map.find(id); if (pos == this->eventout_map.end()) { *************** *** 5852,5855 **** --- 6163,6446 ---- return *pos->second; } + + void externproto_node::do_shutdown(const double timestamp) throw () + { + if (this->proto_node_) { + this->proto_node_->shutdown(timestamp); + } + } + + /** + * @brief Cast to a script_node. + * + * @return a pointer to the first node in the implementation if that node + * is a script_node, or 0 otherwise. + */ + openvrml::script_node * externproto_node::to_script() throw () + { + using namespace openvrml; + return node_cast<script_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to an appearance_node. + * + * @return a pointer to the first node in the implementation if that node + * is an appearance_node, or 0 otherwise. + */ + openvrml::appearance_node * externproto_node::to_appearance() throw () + { + using namespace openvrml; + return node_cast<appearance_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>bounded_volume_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>bounded_volume_node</code>, or 0 otherwise. + */ + openvrml::bounded_volume_node * externproto_node::to_bounded_volume() + throw () + { + using namespace openvrml; + return node_cast<bounded_volume_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a child_node. + * + * @return a pointer to the first node in the implementation if that node + * is a child_node, or 0 otherwise. + */ + openvrml::child_node * externproto_node::to_child() throw () + { + using namespace openvrml; + return node_cast<child_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a color_node. + * + * @return a pointer to the first node in the implementation if that node + * is a color_node, or 0 otherwise. + */ + openvrml::color_node * externproto_node::to_color() throw () + { + using namespace openvrml; + return node_cast<color_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a coordinate_node. + * + * @return a pointer to the first node in the implementation if that node + * is a coordinate_node, or 0 otherwise. + */ + openvrml::coordinate_node * externproto_node::to_coordinate() throw () + { + using namespace openvrml; + return node_cast<coordinate_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a font_style_node. + * + * @return a pointer to the first node in the implementation if that node + * is a font_style_node, or 0 otherwise. + */ + openvrml::font_style_node * externproto_node::to_font_style() throw () + { + using namespace openvrml; + return node_cast<font_style_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a geometry_node. + * + * @return a pointer to the first node in the implementation if that node + * is a geometry_node, or 0 otherwise. + */ + openvrml::geometry_node * externproto_node::to_geometry() throw () + { + using namespace openvrml; + return node_cast<geometry_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>grouping_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>grouping_node</code>, or 0 otherwise. + */ + openvrml::grouping_node * externproto_node::to_grouping() throw () + { + using namespace openvrml; + return node_cast<grouping_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>light_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>light_node</code>, or 0 otherwise. + */ + openvrml::light_node * externproto_node::to_light() throw () + { + using namespace openvrml; + return node_cast<light_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a material_node. + * + * @return a pointer to the first node in the implementation if that node + * is a material_node, or 0 otherwise. + */ + openvrml::material_node * externproto_node::to_material() throw () + { + using namespace openvrml; + return node_cast<material_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>navigation_info_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>navigation_info_node</code>, or 0 otherwise. + */ + openvrml::navigation_info_node * externproto_node::to_navigation_info() + throw () + { + using namespace openvrml; + return node_cast<navigation_info_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a normal_node. + * + * @return a pointer to the first node in the implementation if that node + * is a normal_node, or 0 otherwise. + */ + openvrml::normal_node * externproto_node::to_normal() throw () + { + using namespace openvrml; + return node_cast<normal_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>pointing_device_sensor_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>pointing_device_sensor_node</code>, or 0 otherwise. + */ + openvrml::pointing_device_sensor_node * + externproto_node::to_pointing_device_sensor() + throw () + { + using namespace openvrml; + return node_cast<pointing_device_sensor_node *>( + this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>scoped_light_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>scoped_light_node</code>, or 0 otherwise. + */ + openvrml::scoped_light_node * externproto_node::to_scoped_light() throw () + { + using namespace openvrml; + return node_cast<scoped_light_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a sound_source_node. + * + * @return a pointer to the first node in the implementation if that node + * is a sound_source_node, or 0 otherwise. + */ + openvrml::sound_source_node * externproto_node::to_sound_source() throw () + { + using namespace openvrml; + return node_cast<sound_source_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a texture_node. + * + * @return a pointer to the first node in the implementation if that node + * is a texture_node, or 0 otherwise. + */ + openvrml::texture_node * externproto_node::to_texture() throw () + { + using namespace openvrml; + return node_cast<texture_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a texture_coordinate_node. + * + * @return a pointer to the first node in the implementation if that node + * is a texture_coordinate_node, or 0 otherwise. + */ + openvrml::texture_coordinate_node * + externproto_node::to_texture_coordinate() + throw () + { + using namespace openvrml; + return node_cast<texture_coordinate_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a texture_transform_node. + * + * @return a pointer to the first node in the implementation if that node + * is a texture_transform_node, or 0 otherwise. + */ + openvrml::texture_transform_node * externproto_node::to_texture_transform() + throw () + { + using namespace openvrml; + return node_cast<texture_transform_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a <code>time_dependent_node</code>. + * + * @return a pointer to the first node in the implementation if that node + * is a <code>time_dependent_node</code>, or 0 otherwise. + */ + openvrml::time_dependent_node * externproto_node::to_time_dependent() + throw () + { + using namespace openvrml; + return node_cast<time_dependent_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a transform_node. + * + * @return a pointer to the first node in the implementation if that node + * is a transform_node, or 0 otherwise. + */ + openvrml::transform_node * externproto_node::to_transform() throw () + { + using namespace openvrml; + return node_cast<transform_node *>(this->proto_node_.get()); + } + + /** + * @brief Cast to a viewpoint_node. + * + * @return a pointer to the first node in the implementation if that node + * is a viewpoint_node, or 0 otherwise. + */ + openvrml::viewpoint_node * externproto_node::to_viewpoint() throw () + { + using namespace openvrml; + return node_cast<viewpoint_node *>(this->proto_node_.get()); + } } // namespace *************** *** 7531,7534 **** --- 8122,8129 ---- throw unreachable_url(); } catch (...) { + // + // The implementation of resource_istream is provided by the user; + // and unfortunately, operations on it could throw anything. + // throw unreachable_url(); } *************** *** 8309,8313 **** } catch (antlr::ANTLRException & ex) { scene.browser().err << ex.getMessage() << endl; ! } catch (std::bad_alloc & ex) { scene.browser().err << ex.what() << endl; throw unreachable_url(); --- 8904,8908 ---- } catch (antlr::ANTLRException & ex) { scene.browser().err << ex.getMessage() << endl; ! } catch (std::exception & ex) { scene.browser().err << ex.what() << endl; throw unreachable_url(); *************** *** 8565,8569 **** .resolve_against(uri(this->url())); ! in = this->browser().get_resource(absolute_uri); if (!(*in)) { throw unreachable_url(); } break; --- 9160,9168 ---- .resolve_against(uri(this->url())); ! try { ! in = this->browser().get_resource(absolute_uri); ! } catch (...) { ! throw unreachable_url(); ! } if (!(*in)) { throw unreachable_url(); } break; |
From: Braden M. <br...@us...> - 2005-11-28 04:04:00
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10460 Modified Files: ChangeLog Log Message: Load EXTERNPROTO implementations (asynchronously). Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1054 retrieving revision 1.1055 diff -C2 -d -r1.1054 -r1.1055 *** ChangeLog 28 Nov 2005 02:56:11 -0000 1.1054 --- ChangeLog 28 Nov 2005 04:03:47 -0000 1.1055 *************** *** 1,4 **** --- 1,28 ---- 2005-11-27 Braden McDaniel <br...@en...> + Load EXTERNPROTO implementations (asynchronously). + + * src/libopenvrml/openvrml/browser.cpp: Modified + externproto_node::externproto_exposedfield to inherit + abstract_proto_node::proto_eventout rather than + openvrml::field_value_emitter. Implemented do_clone for + externproto_node::externproto_exposedfield. For externproto_node, + implemented do_shutdown as well as all the virtual cast functions. + Constructing an externproto_node_class now initiates a new thread + using the function object externproto_node_class::load_proto. + This parses the VRML world at the given URI which incidentally + puts any PROTOs in that world into the browser's node_class map. + At that point externproto_node_class::set_proto_node_class is + called, which sets the proto_node_class to which the + externproto_node_class will delegate. + externproto_node_class::set_proto_node_class in turn calls + externproto_node_type::set_proto_node_type which provides the + externproto_node_type with the proto_node_type to which it + delegates. And finally externproto_node_type::set_proto_node_type + calls externproto_node::set_proto_node which provides the + externproto_node with the proto_node to which it delegates. + + 2005-11-27 Braden McDaniel <br...@en...> + Don't try to use relative URIs as node_class_id's. |
From: Braden M. <br...@us...> - 2005-11-28 02:56:20
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31673/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g Log Message: Don't try to use relative URIs as node_class_id's. Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Vrml97Parser.g 27 Nov 2005 20:15:49 -0000 1.40 --- Vrml97Parser.g 28 Nov 2005 02:56:12 -0000 1.41 *************** *** 695,699 **** --- 695,702 ---- options { defaultErrorHandler=false; } { + using std::string; using std::vector; + using boost::shared_ptr; + using boost::dynamic_pointer_cast; node_interface_set interfaces; *************** *** 704,707 **** --- 707,711 ---- } : KEYWORD_PROTO id:ID { + assert(scope); boost::shared_ptr<openvrml::scope> proto_scope(new openvrml::scope(id->getText(), scope)); *************** *** 717,721 **** is_map, routes] RBRACE { ! boost::shared_ptr<openvrml::node_class> node_class(new proto_node_class(scene.browser(), interfaces, --- 721,725 ---- is_map, routes] RBRACE { ! shared_ptr<openvrml::node_class> node_class(new proto_node_class(scene.browser(), interfaces, *************** *** 730,747 **** // First, construct the id for the node implementation. // ! std::string impl_id; do { impl_id = '#' + proto_scope->id() + impl_id; } while ((proto_scope = proto_scope->parent())->parent()); ! impl_id = scope->id() + impl_id; scene.browser().add_node_class(impl_id, node_class); // // PROTOs implicitly introduce a new node type as well. // ! const boost::shared_ptr<node_type> node_type = node_class->create_type(id->getText(), interfaces); assert(node_type); - assert(scope); if (!scope->add_type(node_type)) { using antlr::SemanticException; --- 734,756 ---- // First, construct the id for the node implementation. // ! string impl_id; do { impl_id = '#' + proto_scope->id() + impl_id; } while ((proto_scope = proto_scope->parent())->parent()); ! impl_id = proto_scope->id() + impl_id; scene.browser().add_node_class(impl_id, node_class); + if (!dynamic_pointer_cast<proto_node_class>( + scene.browser().node_class(node_class_id(this->uri)))) { + scene.browser().add_node_class(node_class_id(this->uri), + node_class); + } + // // PROTOs implicitly introduce a new node type as well. // ! const shared_ptr<node_type> node_type = node_class->create_type(id->getText(), interfaces); assert(node_type); if (!scope->add_type(node_type)) { using antlr::SemanticException; *************** *** 948,956 **** uri_list=externprotoUrlList { const vector<string> & alt_uris = uri_list.value(); ! for (vector<string>::const_iterator uri = alt_uris.begin(); ! uri != alt_uris.end(); ! ++uri) { const shared_ptr<openvrml::node_class> node_class = ! scene.browser().node_class(*uri); if (node_class) { node_type = node_class->create_type(id->getText(), --- 957,969 ---- uri_list=externprotoUrlList { const vector<string> & alt_uris = uri_list.value(); ! for (vector<string>::const_iterator resource_id = alt_uris.begin(); ! resource_id != alt_uris.end(); ! ++resource_id) { ! const ::uri absolute_uri = !relative(::uri(*resource_id)) ! ? ::uri(*resource_id) ! : ::uri(*resource_id) ! .resolve_against(::uri(this->uri)); const shared_ptr<openvrml::node_class> node_class = ! scene.browser().node_class(node_class_id(absolute_uri)); if (node_class) { node_type = node_class->create_type(id->getText(), *************** *** 964,971 **** new externproto_node_class(scene, alt_uris)); ! for (vector<string>::const_iterator uri = alt_uris.begin(); ! uri != alt_uris.end(); ! ++uri) { ! scene.browser().add_node_class(*uri, externproto_class); } --- 977,990 ---- new externproto_node_class(scene, alt_uris)); ! for (vector<string>::const_iterator resource_id = ! alt_uris.begin(); ! resource_id != alt_uris.end(); ! ++resource_id) { ! const ::uri absolute_uri = !relative(::uri(*resource_id)) ! ? ::uri(*resource_id) ! : ::uri(*resource_id) ! .resolve_against(::uri(this->uri)); ! scene.browser().add_node_class(node_class_id(absolute_uri), ! externproto_class); } |
From: Braden M. <br...@us...> - 2005-11-28 02:56:20
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31673 Modified Files: ChangeLog Log Message: Don't try to use relative URIs as node_class_id's. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1053 retrieving revision 1.1054 diff -C2 -d -r1.1053 -r1.1054 *** ChangeLog 27 Nov 2005 20:15:49 -0000 1.1053 --- ChangeLog 28 Nov 2005 02:56:11 -0000 1.1054 *************** *** 1,4 **** --- 1,21 ---- 2005-11-27 Braden McDaniel <br...@en...> + Don't try to use relative URIs as node_class_id's. + + * src/libopenvrml/openvrml/Vrml97Parser.g + (Vrml97Parser::proto): If the PROTO is the first one in the + stream, add the proto_node_class to the browser using the URI of + the resource without the fragment identifier; that is, the + proto_node_class is added to the browser twice under both + <http://example.com/world#proto-name> and + <http://example.com/world>. + (Vrml97Parser::externproto): If the implementation identifier for + the EXTERNPROTO is a relative URI, convert it to an absolute URI + before using it to attempt to retrieve a node_class from the + browser. Also, convert any relative URIs to absolute URIs before + adding externproto_node_classes to the browser. + + 2005-11-27 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/Vrml97Parser.g: Cosmetic changes. |
From: Braden M. <br...@us...> - 2005-11-27 20:16:00
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13386 Modified Files: ChangeLog Log Message: Cosmetic changes. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1052 retrieving revision 1.1053 diff -C2 -d -r1.1052 -r1.1053 *** ChangeLog 27 Nov 2005 16:58:13 -0000 1.1052 --- ChangeLog 27 Nov 2005 20:15:49 -0000 1.1053 *************** *** 1,4 **** --- 1,8 ---- 2005-11-27 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/Vrml97Parser.g: Cosmetic changes. + + 2005-11-27 Braden McDaniel <br...@en...> + externproto_node_class will need to be constructed with an openvrml::scene rather than an openvrml::browser. |
From: Braden M. <br...@us...> - 2005-11-27 20:15:57
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13386/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g Log Message: Cosmetic changes. Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Vrml97Parser.g 27 Nov 2005 16:58:15 -0000 1.39 --- Vrml97Parser.g 27 Nov 2005 20:15:49 -0000 1.40 *************** *** 637,645 **** const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } ! { ! boost::intrusive_ptr<openvrml::node> node; ! boost::shared_ptr<node_type> nodeType; ! } ! : node=nodeStatement[scene, scope, std::string()] { // // If we are unable to parse a node, node will be null. --- 637,644 ---- const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } ! { ! boost::intrusive_ptr<openvrml::node> node; ! } ! : node=nodeStatement[scene, scope, std::string()] { // // If we are unable to parse a node, node will be null. *************** *** 647,652 **** if (node) { nodes.push_back(node); } } ! | protoStatement[scene, scope] ! | routeStatement[*scope] ; --- 646,651 ---- if (node) { nodes.push_back(node); } } ! | protoStatement[scene, scope] ! | routeStatement[*scope] ; *************** *** 688,693 **** // XXX handle an exception here. // ! : externproto[scene, scope] ! | proto[scene, scope] ; --- 687,692 ---- // XXX handle an exception here. // ! : externproto[scene, scope] ! | proto[scene, scope] ; *************** *** 844,854 **** boost::intrusive_ptr<openvrml::node> n; } ! : (protoStatement[scene, scope])* ! n=protoNodeStatement[scene, ! scope, ! interfaces, ! is_map, ! routes, ! std::string()] { assert(n); --- 843,852 ---- boost::intrusive_ptr<openvrml::node> n; } ! : (protoStatement[scene, scope])* n=protoNodeStatement[scene, ! scope, ! interfaces, ! is_map, ! routes, ! std::string()] { assert(n); *************** *** 886,891 **** impl_nodes.push_back(n); } ! | protoStatement[scene, scope] ! | protoRouteStatement[*scope, routes] ; --- 884,889 ---- impl_nodes.push_back(n); } ! | protoStatement[scene, scope] ! | protoRouteStatement[*scope, routes] ; *************** *** 946,950 **** shared_ptr<node_type> node_type; } ! : KEYWORD_EXTERNPROTO id:ID LBRACKET (externInterfaceDeclaration[interfaces])* RBRACKET uri_list=externprotoUrlList { --- 944,948 ---- shared_ptr<node_type> node_type; } ! : KEYWORD_EXTERNPROTO id:ID LBRACKET (externInterfaceDeclaration[interfaces])* RBRACKET uri_list=externprotoUrlList { *************** *** 1028,1033 **** interfaceType returns [node_interface::type_id interface_type] options { defaultErrorHandler=false; } ! : interface_type=eventInterfaceType ! | interface_type=fieldInterfaceType ; --- 1026,1031 ---- interfaceType returns [node_interface::type_id interface_type] options { defaultErrorHandler=false; } ! : interface_type=eventInterfaceType ! | interface_type=fieldInterfaceType ; *************** *** 1189,1205 **** initial_value_map initial_values; node_interface_set interfaces; ! boost::shared_ptr<node_type> nodeType; } ! : { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ( ! nodeBodyElement[scene, ! scope, ! script_node_interface_set, ! initial_values] ! | scriptInterfaceDeclaration[scene, ! scope, ! interfaces, ! initial_values, ! node_id] ! )* RBRACE { n = intrusive_ptr<openvrml::node>( new script_node(scene.browser().script_node_class_, --- 1187,1203 ---- initial_value_map initial_values; node_interface_set interfaces; ! boost::shared_ptr<openvrml::node_type> node_type; } ! : { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ! ( nodeBodyElement[scene, ! scope, ! script_node_interface_set, ! initial_values] ! | scriptInterfaceDeclaration[scene, ! scope, ! interfaces, ! initial_values, ! node_id] ! )* RBRACE { n = intrusive_ptr<openvrml::node>( new script_node(scene.browser().script_node_class_, *************** *** 1209,1215 **** if (!node_id.empty()) { n->id(node_id); } } ! | nodeTypeId:ID { ! nodeType = scope->find_type(nodeTypeId->getText()); ! if (!nodeType) { throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", --- 1207,1213 ---- if (!node_id.empty()) { n->id(node_id); } } ! | nodeTypeId:ID { ! node_type = scope->find_type(nodeTypeId->getText()); ! if (!node_type) { throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", *************** *** 1221,1229 **** } LBRACE (nodeBodyElement[scene, scope, ! nodeType->interfaces(), initial_values])* RBRACE { ! n = boost::intrusive_ptr<openvrml::node>( ! nodeType->create_node(scope, initial_values)); if (!node_id.empty()) { n->id(node_id); } --- 1219,1226 ---- } LBRACE (nodeBodyElement[scene, scope, ! node_type->interfaces(), initial_values])* RBRACE { ! n = node_type->create_node(scope, initial_values); if (!node_id.empty()) { n->id(node_id); } *************** *** 1309,1313 **** field_value::type_id ft(field_value::invalid_type_id); } ! : it=eventInterfaceType ft=fieldType id:ID { const node_interface interface(it, ft, id->getText()); const bool succeeded = interfaces.insert(interface).second; --- 1306,1310 ---- field_value::type_id ft(field_value::invalid_type_id); } ! : it=eventInterfaceType ft=fieldType id:ID { const node_interface interface(it, ft, id->getText()); const bool succeeded = interfaces.insert(interface).second; *************** *** 1324,1332 **** } } ! | scriptFieldInterfaceDeclaration[scene, ! scope, ! interfaces, ! initial_values, ! node_id] ; --- 1321,1329 ---- } } ! | scriptFieldInterfaceDeclaration[scene, ! scope, ! interfaces, ! initial_values, ! node_id] ; *************** *** 1383,1391 **** node_interface_set interfaces; is_list is_mappings; ! boost::shared_ptr<node_type> nodeType; } : ( ! { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ( ! protoNodeBodyElement[scene, scope, proto_interfaces, --- 1380,1388 ---- node_interface_set interfaces; is_list is_mappings; ! boost::shared_ptr<openvrml::node_type> node_type; } : ( ! { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ! ( protoNodeBodyElement[scene, scope, proto_interfaces, *************** *** 1395,1407 **** initial_values, is_mappings] ! | protoScriptInterfaceDeclaration[scene, ! scope, ! proto_interfaces, ! is_map, ! routes, ! node_id, ! interfaces, ! initial_values, ! is_mappings] )* RBRACE { n = boost::intrusive_ptr<openvrml::node>( --- 1392,1404 ---- initial_values, is_mappings] ! | protoScriptInterfaceDeclaration[scene, ! scope, ! proto_interfaces, ! is_map, ! routes, ! node_id, ! interfaces, ! initial_values, ! is_mappings] )* RBRACE { n = boost::intrusive_ptr<openvrml::node>( *************** *** 1412,1419 **** if (!node_id.empty()) { n->id(node_id); } } ! ! | nodeTypeId:ID { ! nodeType = scope->find_type(nodeTypeId->getText()); ! if (!nodeType) { throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", --- 1409,1415 ---- if (!node_id.empty()) { n->id(node_id); } } ! | nodeTypeId:ID { ! node_type = scope->find_type(nodeTypeId->getText()); ! if (!node_type) { throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", *************** *** 1428,1435 **** is_map, routes, ! nodeType->interfaces(), initial_values, is_mappings])* RBRACE { ! n = nodeType->create_node(scope, initial_values); if (!node_id.empty()) { n->id(node_id); } } --- 1424,1431 ---- is_map, routes, ! node_type->interfaces(), initial_values, is_mappings])* RBRACE { ! n = node_type->create_node(scope, initial_values); if (!node_id.empty()) { n->id(node_id); } } *************** *** 1472,1477 **** } ( {impl_node_interface->type == node_interface::field_id || impl_node_interface->type == node_interface::exposedfield_id}? ! ( ! fv=protoFieldValue[scene, scope, proto_interfaces, --- 1468,1472 ---- } ( {impl_node_interface->type == node_interface::field_id || impl_node_interface->type == node_interface::exposedfield_id}? ! ( fv=protoFieldValue[scene, scope, proto_interfaces, *************** *** 1488,1492 **** | isStatement[impl_node_interface->id, is_mappings] ) ! | isStatement[impl_node_interface->id, is_mappings] ) | protoRouteStatement[*scope, routes] --- 1483,1487 ---- | isStatement[impl_node_interface->id, is_mappings] ) ! | isStatement[impl_node_interface->id, is_mappings] ) | protoRouteStatement[*scope, routes] *************** *** 1561,1565 **** bool succeeded; } ! : KEYWORD_FIELD ft=fieldType id:ID { succeeded = interfaces.insert(node_interface(node_interface::field_id, --- 1556,1560 ---- bool succeeded; } ! : KEYWORD_FIELD ft=fieldType id:ID { succeeded = interfaces.insert(node_interface(node_interface::field_id, *************** *** 1589,1593 **** assert(succeeded); } ! | isStatement[id->getText(), is_mappings] { using std::auto_ptr; using boost::shared_ptr; --- 1584,1588 ---- assert(succeeded); } ! | isStatement[id->getText(), is_mappings] { using std::auto_ptr; using boost::shared_ptr; *************** *** 1615,1638 **** using openvrml::field_value; } ! : FIELDTYPE_MFCOLOR { ft = field_value::mfcolor_id; } ! | FIELDTYPE_MFFLOAT { ft = field_value::mffloat_id; } ! | FIELDTYPE_MFINT32 { ft = field_value::mfint32_id; } ! | FIELDTYPE_MFNODE { ft = field_value::mfnode_id; } ! | FIELDTYPE_MFROTATION { ft = field_value::mfrotation_id; } ! | FIELDTYPE_MFSTRING { ft = field_value::mfstring_id; } ! | FIELDTYPE_MFTIME { ft = field_value::mftime_id; } ! | FIELDTYPE_MFVEC2F { ft = field_value::mfvec2f_id; } ! | FIELDTYPE_MFVEC3F { ft = field_value::mfvec3f_id; } ! | FIELDTYPE_SFBOOL { ft = field_value::sfbool_id; } ! | FIELDTYPE_SFCOLOR { ft = field_value::sfcolor_id; } ! | FIELDTYPE_SFFLOAT { ft = field_value::sffloat_id; } ! | FIELDTYPE_SFIMAGE { ft = field_value::sfimage_id; } ! | FIELDTYPE_SFINT32 { ft = field_value::sfint32_id; } ! | FIELDTYPE_SFNODE { ft = field_value::sfnode_id; } ! | FIELDTYPE_SFROTATION { ft = field_value::sfrotation_id; } ! | FIELDTYPE_SFSTRING { ft = field_value::sfstring_id; } ! | FIELDTYPE_SFTIME { ft = field_value::sftime_id; } ! | FIELDTYPE_SFVEC2F { ft = field_value::sfvec2f_id; } ! | FIELDTYPE_SFVEC3F { ft = field_value::sfvec3f_id; } ; --- 1610,1633 ---- using openvrml::field_value; } ! : FIELDTYPE_MFCOLOR { ft = field_value::mfcolor_id; } ! | FIELDTYPE_MFFLOAT { ft = field_value::mffloat_id; } ! | FIELDTYPE_MFINT32 { ft = field_value::mfint32_id; } ! | FIELDTYPE_MFNODE { ft = field_value::mfnode_id; } ! | FIELDTYPE_MFROTATION { ft = field_value::mfrotation_id; } ! | FIELDTYPE_MFSTRING { ft = field_value::mfstring_id; } ! | FIELDTYPE_MFTIME { ft = field_value::mftime_id; } ! | FIELDTYPE_MFVEC2F { ft = field_value::mfvec2f_id; } ! | FIELDTYPE_MFVEC3F { ft = field_value::mfvec3f_id; } ! | FIELDTYPE_SFBOOL { ft = field_value::sfbool_id; } ! | FIELDTYPE_SFCOLOR { ft = field_value::sfcolor_id; } ! | FIELDTYPE_SFFLOAT { ft = field_value::sffloat_id; } ! | FIELDTYPE_SFIMAGE { ft = field_value::sfimage_id; } ! | FIELDTYPE_SFINT32 { ft = field_value::sfint32_id; } ! | FIELDTYPE_SFNODE { ft = field_value::sfnode_id; } ! | FIELDTYPE_SFROTATION { ft = field_value::sfrotation_id; } ! | FIELDTYPE_SFSTRING { ft = field_value::sfstring_id; } ! | FIELDTYPE_SFTIME { ft = field_value::sftime_id; } ! | FIELDTYPE_SFVEC2F { ft = field_value::sfvec2f_id; } ! | FIELDTYPE_SFVEC3F { ft = field_value::sfvec3f_id; } ; *************** *** 1643,1649 **** returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? fv=nodeFieldValue[scene, scope, ft, node_id] ! | fv=nonNodeFieldValue[ft] ; --- 1638,1644 ---- returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? fv=nodeFieldValue[scene, scope, ft, node_id] ! | fv=nonNodeFieldValue[ft] ; *************** *** 1657,1661 **** returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? fv=protoNodeFieldValue[scene, scope, --- 1652,1656 ---- returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? fv=protoNodeFieldValue[scene, scope, *************** *** 1667,1671 **** assert(fv); } ! | fv=nonNodeFieldValue[ft] { assert(fv); } ; --- 1662,1666 ---- assert(fv); } ! | fv=nonNodeFieldValue[ft] { assert(fv); } ; *************** *** 1673,1694 **** returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { ft == field_value::sfbool_id }? fv=sfBoolValue ! | { ft == field_value::sfcolor_id }? fv=sfColorValue ! | { ft == field_value::sffloat_id }? fv=sfFloatValue ! | { ft == field_value::sfimage_id }? fv=sfImageValue ! | { ft == field_value::sfint32_id }? fv=sfInt32Value ! | { ft == field_value::sfrotation_id }? fv=sfRotationValue ! | { ft == field_value::sfstring_id }? fv=sfStringValue ! | { ft == field_value::sftime_id }? fv=sfTimeValue ! | { ft == field_value::sfvec2f_id }? fv=sfVec2fValue ! | { ft == field_value::sfvec3f_id }? fv=sfVec3fValue ! | { ft == field_value::mfcolor_id }? fv=mfColorValue ! | { ft == field_value::mffloat_id }? fv=mfFloatValue ! | { ft == field_value::mfint32_id }? fv=mfInt32Value ! | { ft == field_value::mfrotation_id }? fv=mfRotationValue ! | { ft == field_value::mfstring_id }? fv=mfStringValue ! | { ft == field_value::mftime_id }? fv=mfTimeValue ! | { ft == field_value::mfvec2f_id }? fv=mfVec2fValue ! | fv=mfVec3fValue ; --- 1668,1689 ---- returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { ft == field_value::sfbool_id }? fv=sfBoolValue ! | { ft == field_value::sfcolor_id }? fv=sfColorValue ! | { ft == field_value::sffloat_id }? fv=sfFloatValue ! | { ft == field_value::sfimage_id }? fv=sfImageValue ! | { ft == field_value::sfint32_id }? fv=sfInt32Value ! | { ft == field_value::sfrotation_id }? fv=sfRotationValue ! | { ft == field_value::sfstring_id }? fv=sfStringValue ! | { ft == field_value::sftime_id }? fv=sfTimeValue ! | { ft == field_value::sfvec2f_id }? fv=sfVec2fValue ! | { ft == field_value::sfvec3f_id }? fv=sfVec3fValue ! | { ft == field_value::mfcolor_id }? fv=mfColorValue ! | { ft == field_value::mffloat_id }? fv=mfFloatValue ! | { ft == field_value::mfint32_id }? fv=mfInt32Value ! | { ft == field_value::mfrotation_id }? fv=mfRotationValue ! | { ft == field_value::mfstring_id }? fv=mfStringValue ! | { ft == field_value::mftime_id }? fv=mfTimeValue ! | { ft == field_value::mfvec2f_id }? fv=mfVec2fValue ! | fv=mfVec3fValue ; *************** *** 1702,1707 **** using openvrml::field_value; } ! : { ft == field_value::sfnode_id }? ! fv=sfNodeValue[scene, scope, script_node_id] | fv=mfNodeValue[scene, scope, script_node_id] ; --- 1697,1703 ---- using openvrml::field_value; } ! : { ft == field_value::sfnode_id }? fv=sfNodeValue[scene, ! scope, ! script_node_id] | fv=mfNodeValue[scene, scope, script_node_id] ; *************** *** 1716,1725 **** returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { ft == field_value::sfnode_id }? ! fv=protoSfNodeValue[scene, ! scope, ! proto_interfaces, ! is_map, routes, ! script_node_id] | fv=protoMfNodeValue[scene, scope, --- 1712,1721 ---- returns [boost::shared_ptr<field_value> fv] options { defaultErrorHandler=false; } ! : { ft == field_value::sfnode_id }? fv=protoSfNodeValue[scene, ! scope, ! proto_interfaces, ! is_map, ! routes, ! script_node_id] | fv=protoMfNodeValue[scene, scope, *************** *** 1735,1745 **** bool val(false); } ! : val=boolValue { sbv.reset(new sfbool(val)); } ; boolValue returns [bool val = false] options { defaultErrorHandler=false; } ! : KEYWORD_TRUE { val = true; } ! | KEYWORD_FALSE { val = false; } ; --- 1731,1741 ---- bool val(false); } ! : val=boolValue { sbv.reset(new sfbool(val)); } ; boolValue returns [bool val = false] options { defaultErrorHandler=false; } ! : KEYWORD_TRUE { val = true; } ! | KEYWORD_FALSE { val = false; } ; *************** *** 1749,1753 **** color c; } ! : colorValue[c] { scv.reset(new sfcolor(c)); } ; --- 1745,1749 ---- color c; } ! : colorValue[c] { scv.reset(new sfcolor(c)); } ; *************** *** 1775,1781 **** float r, g, b; } ! : r=colorComponent g=colorComponent b=colorComponent { c.r(r); ! c.g(g); ! c.b(b); } ; --- 1771,1777 ---- float r, g, b; } ! : r=colorComponent g=colorComponent b=colorComponent { c.r(r); ! c.g(g); ! c.b(b); } ; *************** *** 1785,1789 **** colorComponent returns [float val = 0.0f] options { defaultErrorHandler=false; } ! : val=floatValue { if (val < 0.0 || val > 1.0) { this->reportWarning( --- 1781,1785 ---- colorComponent returns [float val = 0.0f] options { defaultErrorHandler=false; } ! : val=floatValue { if (val < 0.0 || val > 1.0) { this->reportWarning( *************** *** 1803,1807 **** float f; } ! : f=floatValue { sfv.reset(new sffloat(f)); } ; --- 1799,1803 ---- float f; } ! : f=floatValue { sfv.reset(new sffloat(f)); } ; *************** *** 1826,1831 **** floatValue returns [float val] options { defaultErrorHandler=false; } ! : f0:REAL { std::istringstream(f0->getText()) >> val; } ! | f1:INTEGER { std::istringstream(f1->getText()) >> val; } ; --- 1822,1827 ---- floatValue returns [float val] options { defaultErrorHandler=false; } ! : f0:REAL { std::istringstream(f0->getText()) >> val; } ! | f1:INTEGER { std::istringstream(f1->getText()) >> val; } ; *************** *** 1868,1872 **** long i; } ! : i=intValue { siv.reset(new sfint32(i)); } ; --- 1864,1868 ---- long i; } ! : i=intValue { siv.reset(new sfint32(i)); } ; *************** *** 2004,2009 **** sfRotationValue returns [boost::shared_ptr<field_value> srv] options { defaultErrorHandler=false; } ! { rotation r; } ! : rotationValue[r] { srv.reset(new sfrotation(r)); } ; --- 2000,2007 ---- sfRotationValue returns [boost::shared_ptr<field_value> srv] options { defaultErrorHandler=false; } ! { ! rotation r; ! } ! : rotationValue[r] { srv.reset(new sfrotation(r)); } ; *************** *** 2031,2039 **** rotationValue[rotation & r] options { defaultErrorHandler=false; } ! { ! using openvrml_::fequal; ! float x, y, z, angle; ! } ! : x=floatValue y=floatValue z=floatValue angle=floatValue { vec3f axis(x, y, z); --- 2029,2037 ---- rotationValue[rotation & r] options { defaultErrorHandler=false; } ! { ! using openvrml_::fequal; ! float x, y, z, angle; ! } ! : x=floatValue y=floatValue z=floatValue angle=floatValue { vec3f axis(x, y, z); *************** *** 2054,2059 **** sfStringValue returns [boost::shared_ptr<field_value> ssv] options { defaultErrorHandler=false; } ! { std::string s; } ! : s=stringValue { ssv.reset(new sfstring(s)); } ; --- 2052,2059 ---- sfStringValue returns [boost::shared_ptr<field_value> ssv] options { defaultErrorHandler=false; } ! { ! std::string s; ! } ! : s=stringValue { ssv.reset(new sfstring(s)); } ; *************** *** 2079,2084 **** stringValue returns [std::string str] options { defaultErrorHandler=false; } ! : s:STRING ! { using std::string; const string & token_text(s->getText()); --- 2079,2083 ---- stringValue returns [std::string str] options { defaultErrorHandler=false; } ! : s:STRING { using std::string; const string & token_text(s->getText()); *************** *** 2102,2107 **** sfTimeValue returns [boost::shared_ptr<field_value> stv] options { defaultErrorHandler=false; } ! { double t(0.0); } ! : t=doubleValue { stv.reset(new sftime(t)); } ; --- 2101,2108 ---- sfTimeValue returns [boost::shared_ptr<field_value> stv] options { defaultErrorHandler=false; } ! { ! double t(0.0); ! } ! : t=doubleValue { stv.reset(new sftime(t)); } ; *************** *** 2126,2137 **** doubleValue returns [double val = 0.0] options { defaultErrorHandler=false; } ! : d0:REAL { std::istringstream(d0->getText()) >> val; } ! | d1:INTEGER { std::istringstream(d1->getText()) >> val; } ; sfVec2fValue returns [boost::shared_ptr<field_value> svv] options { defaultErrorHandler=false; } ! { vec2f v; } ! : vec2fValue[v] { svv.reset(new sfvec2f(v)); } ; --- 2127,2140 ---- doubleValue returns [double val = 0.0] options { defaultErrorHandler=false; } ! : d0:REAL { std::istringstream(d0->getText()) >> val; } ! | d1:INTEGER { std::istringstream(d1->getText()) >> val; } ; sfVec2fValue returns [boost::shared_ptr<field_value> svv] options { defaultErrorHandler=false; } ! { ! vec2f v; ! } ! : vec2fValue[v] { svv.reset(new sfvec2f(v)); } ; *************** *** 2159,2164 **** float x, y; } ! : x=floatValue y=floatValue { v.x(x); ! v.y(y); } ; --- 2162,2167 ---- float x, y; } ! : x=floatValue y=floatValue { v.x(x); ! v.y(y); } ; *************** *** 2168,2172 **** vec3f v; } ! : vec3fValue[v] { svv.reset(new sfvec3f(v)); } ; --- 2171,2175 ---- vec3f v; } ! : vec3fValue[v] { svv.reset(new sfvec3f(v)); } ; *************** *** 2194,2199 **** float x, y, z; } ! : x=floatValue y=floatValue z=floatValue { v.x(x); ! v.y(y); ! v.z(z); } ; --- 2197,2202 ---- float x, y, z; } ! : x=floatValue y=floatValue z=floatValue { v.x(x); ! v.y(y); ! v.z(z); } ; |
From: Braden M. <br...@us...> - 2005-11-27 16:58:27
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv941/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g X3DVrmlParser.g browser.cpp Log Message: externproto_node_class will need to be constructed with an openvrml::scene rather than an openvrml::browser. Index: X3DVrmlParser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/X3DVrmlParser.g,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** X3DVrmlParser.g 27 Nov 2005 06:13:00 -0000 1.7 --- X3DVrmlParser.g 27 Nov 2005 16:58:15 -0000 1.8 *************** *** 207,211 **** : profile=profileStatement { scene.profile_ = profile; } (componentStatement)* (metaStatement)* ! (statement[scene.browser(), nodes, root_scope])* ; --- 207,211 ---- : profile=profileStatement { scene.profile_ = profile; } (componentStatement)* (metaStatement)* ! (statement[scene, nodes, root_scope])* ; Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** browser.cpp 27 Nov 2005 06:13:00 -0000 1.104 --- browser.cpp 27 Nov 2005 16:58:15 -0000 1.105 *************** *** 2743,2747 **** public: externproto_node_class( ! openvrml::browser & b, const std::vector<std::string> & uris) throw (); virtual ~externproto_node_class() throw (); --- 2743,2747 ---- public: externproto_node_class( ! openvrml::scene & scene, const std::vector<std::string> & uris) throw (); virtual ~externproto_node_class() throw (); *************** *** 5509,5516 **** externproto_node_class:: ! externproto_node_class(openvrml::browser & b, const std::vector<std::string> & /* uris */) throw (): ! node_class(b) {} --- 5509,5516 ---- externproto_node_class:: ! externproto_node_class(openvrml::scene & scene, const std::vector<std::string> & /* uris */) throw (): ! node_class(scene.browser()) {} Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Vrml97Parser.g 27 Nov 2005 06:13:00 -0000 1.38 --- Vrml97Parser.g 27 Nov 2005 16:58:15 -0000 1.39 *************** *** 630,637 **** const boost::shared_ptr<openvrml::scope> root_scope(root_scope_auto_ptr); } ! : (statement[scene.browser(), nodes, root_scope])* ; ! statement[openvrml::browser & browser, std::vector<boost::intrusive_ptr<openvrml::node> > & nodes, const boost::shared_ptr<openvrml::scope> & scope] --- 630,637 ---- const boost::shared_ptr<openvrml::scope> root_scope(root_scope_auto_ptr); } ! : (statement[scene, nodes, root_scope])* ; ! statement[openvrml::scene & scene, std::vector<boost::intrusive_ptr<openvrml::node> > & nodes, const boost::shared_ptr<openvrml::scope> & scope] *************** *** 641,645 **** boost::shared_ptr<node_type> nodeType; } ! : node=nodeStatement[browser, scope, std::string()] { // // If we are unable to parse a node, node will be null. --- 641,645 ---- boost::shared_ptr<node_type> nodeType; } ! : node=nodeStatement[scene, scope, std::string()] { // // If we are unable to parse a node, node will be null. *************** *** 647,660 **** if (node) { nodes.push_back(node); } } ! | protoStatement[browser, scope] | routeStatement[*scope] ; ! nodeStatement[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const std::string & script_node_id] returns [boost::intrusive_ptr<openvrml::node> n] options { defaultErrorHandler=false; } ! : KEYWORD_DEF id0:ID n=node[browser, scope, id0->getText()] | KEYWORD_USE id1:ID { if (id1->getText() == script_node_id) { --- 647,660 ---- if (node) { nodes.push_back(node); } } ! | protoStatement[scene, scope] | routeStatement[*scope] ; ! nodeStatement[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const std::string & script_node_id] returns [boost::intrusive_ptr<openvrml::node> n] options { defaultErrorHandler=false; } ! : KEYWORD_DEF id0:ID n=node[scene, scope, id0->getText()] | KEYWORD_USE id1:ID { if (id1->getText() == script_node_id) { *************** *** 678,685 **** } } ! | n=node[browser, scope, std::string()] ; ! protoStatement[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } // --- 678,686 ---- } } ! | n=node[scene, scope, std::string()] ; ! protoStatement[openvrml::scene & scene, ! const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } // *************** *** 687,695 **** // XXX handle an exception here. // ! : externproto[browser, scope] ! | proto[browser, scope] ; ! proto[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } --- 688,696 ---- // XXX handle an exception here. // ! : externproto[scene, scope] ! | proto[scene, scope] ; ! proto[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } *************** *** 706,715 **** boost::shared_ptr<openvrml::scope> proto_scope(new openvrml::scope(id->getText(), scope)); ! } LBRACKET (protoInterfaceDeclaration[browser, scope, id->getText(), interfaces, default_value_map])* RBRACKET ! LBRACE protoBody[browser, proto_scope, interfaces, --- 707,716 ---- boost::shared_ptr<openvrml::scope> proto_scope(new openvrml::scope(id->getText(), scope)); ! } LBRACKET (protoInterfaceDeclaration[scene, scope, id->getText(), interfaces, default_value_map])* RBRACKET ! LBRACE protoBody[scene, proto_scope, interfaces, *************** *** 718,722 **** routes] RBRACE { boost::shared_ptr<openvrml::node_class> ! node_class(new proto_node_class(browser, interfaces, default_value_map, --- 719,723 ---- routes] RBRACE { boost::shared_ptr<openvrml::node_class> ! node_class(new proto_node_class(scene.browser(), interfaces, default_value_map, *************** *** 735,739 **** } while ((proto_scope = proto_scope->parent())->parent()); impl_id = scope->id() + impl_id; ! browser.add_node_class(impl_id, node_class); // --- 736,740 ---- } while ((proto_scope = proto_scope->parent())->parent()); impl_id = scope->id() + impl_id; ! scene.browser().add_node_class(impl_id, node_class); // *************** *** 757,761 **** protoInterfaceDeclaration[ ! openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & outer_scope, const std::string & proto_id, --- 758,762 ---- protoInterfaceDeclaration[ ! openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & outer_scope, const std::string & proto_id, *************** *** 794,798 **** new scope(proto_id + '.' + id1->getText(), outer_scope)); } ! fv=fieldValue[browser, field_decl_scope, ft, std::string()] { assert(fv); --- 795,799 ---- new scope(proto_id + '.' + id1->getText(), outer_scope)); } ! fv=fieldValue[scene, field_decl_scope, ft, std::string()] { assert(fv); *************** *** 828,832 **** ; ! protoBody[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & interfaces, --- 829,833 ---- ; ! protoBody[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & interfaces, *************** *** 843,848 **** boost::intrusive_ptr<openvrml::node> n; } ! : (protoStatement[browser, scope])* ! n=protoNodeStatement[browser, scope, interfaces, --- 844,849 ---- boost::intrusive_ptr<openvrml::node> n; } ! : (protoStatement[scene, scope])* ! n=protoNodeStatement[scene, scope, interfaces, *************** *** 854,858 **** impl_nodes.push_back(n); } ! (protoBodyStatement[browser, scope, interfaces, --- 855,859 ---- impl_nodes.push_back(n); } ! (protoBodyStatement[scene, scope, interfaces, *************** *** 862,871 **** ; ! protoBodyStatement[openvrml::browser & browser, ! const boost::shared_ptr<openvrml::scope> & scope, ! const node_interface_set & interfaces, ! std::vector<boost::intrusive_ptr<openvrml::node> > & impl_nodes, ! proto_node_class::is_map_t & is_map, ! proto_node_class::routes_t & routes] options { defaultErrorHandler=false; } { --- 863,873 ---- ; ! protoBodyStatement[ ! openvrml::scene & scene, ! const boost::shared_ptr<openvrml::scope> & scope, ! const node_interface_set & interfaces, ! std::vector<boost::intrusive_ptr<openvrml::node> > & impl_nodes, ! proto_node_class::is_map_t & is_map, ! proto_node_class::routes_t & routes] options { defaultErrorHandler=false; } { *************** *** 875,879 **** boost::intrusive_ptr<openvrml::node> n; } ! : n=protoNodeStatement[browser, scope, interfaces, --- 877,881 ---- boost::intrusive_ptr<openvrml::node> n; } ! : n=protoNodeStatement[scene, scope, interfaces, *************** *** 884,892 **** impl_nodes.push_back(n); } ! | protoStatement[browser, scope] | protoRouteStatement[*scope, routes] ; ! protoNodeStatement[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 886,894 ---- impl_nodes.push_back(n); } ! | protoStatement[scene, scope] | protoRouteStatement[*scope, routes] ; ! protoNodeStatement[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 899,903 **** using antlr::SemanticException; } ! : KEYWORD_DEF id0:ID n=protoNode[browser, scope, proto_interfaces, --- 901,905 ---- using antlr::SemanticException; } ! : KEYWORD_DEF id0:ID n=protoNode[scene, scope, proto_interfaces, *************** *** 924,928 **** } } ! | n=protoNode[browser, scope, proto_interfaces, --- 926,930 ---- } } ! | n=protoNode[scene, scope, proto_interfaces, *************** *** 932,936 **** ; ! externproto[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } --- 934,938 ---- ; ! externproto[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope] options { defaultErrorHandler=false; } *************** *** 952,956 **** ++uri) { const shared_ptr<openvrml::node_class> node_class = ! browser.node_class(*uri); if (node_class) { node_type = node_class->create_type(id->getText(), --- 954,958 ---- ++uri) { const shared_ptr<openvrml::node_class> node_class = ! scene.browser().node_class(*uri); if (node_class) { node_type = node_class->create_type(id->getText(), *************** *** 962,971 **** if (!node_type) { const shared_ptr<node_class> externproto_class( ! new externproto_node_class(browser, alt_uris)); for (vector<string>::const_iterator uri = alt_uris.begin(); uri != alt_uris.end(); ++uri) { ! browser.add_node_class(*uri, externproto_class); } --- 964,973 ---- if (!node_type) { const shared_ptr<node_class> externproto_class( ! new externproto_node_class(scene, alt_uris)); for (vector<string>::const_iterator uri = alt_uris.begin(); uri != alt_uris.end(); ++uri) { ! scene.browser().add_node_class(*uri, externproto_class); } *************** *** 1176,1180 **** ; ! node[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const std::string & node_id] --- 1178,1182 ---- ; ! node[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const std::string & node_id] *************** *** 1190,1198 **** } : { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ( ! nodeBodyElement[browser, scope, script_node_interface_set, initial_values] ! | scriptInterfaceDeclaration[browser, scope, interfaces, --- 1192,1200 ---- } : { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ( ! nodeBodyElement[scene, scope, script_node_interface_set, initial_values] ! | scriptInterfaceDeclaration[scene, scope, interfaces, *************** *** 1201,1205 **** )* RBRACE { n = intrusive_ptr<openvrml::node>( ! new script_node(browser.script_node_class_, scope, interfaces, --- 1203,1207 ---- )* RBRACE { n = intrusive_ptr<openvrml::node>( ! new script_node(scene.browser().script_node_class_, scope, interfaces, *************** *** 1217,1226 **** } ! } LBRACE (nodeBodyElement[browser, scope, nodeType->interfaces(), initial_values])* RBRACE { ! n = boost::intrusive_ptr<openvrml::node>(nodeType->create_node(scope, initial_values)); if (!node_id.empty()) { n->id(node_id); } --- 1219,1229 ---- } ! } LBRACE (nodeBodyElement[scene, scope, nodeType->interfaces(), initial_values])* RBRACE { ! n = boost::intrusive_ptr<openvrml::node>( ! nodeType->create_node(scope, initial_values)); if (!node_id.empty()) { n->id(node_id); } *************** *** 1248,1252 **** } ! nodeBodyElement[browser & b, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & interfaces, --- 1251,1255 ---- } ! nodeBodyElement[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & interfaces, *************** *** 1279,1283 **** } ft = interface->field_type; ! } fv=fieldValue[b, scope, ft, std::string()] { assert(fv); const bool succeeded = --- 1282,1286 ---- } ft = interface->field_type; ! } fv=fieldValue[scene, scope, ft, std::string()] { assert(fv); const bool succeeded = *************** *** 1292,1299 **** } | routeStatement[*scope] ! | protoStatement[b, scope] ; ! scriptInterfaceDeclaration[browser & b, const boost::shared_ptr<openvrml::scope> & scope, node_interface_set & interfaces, --- 1295,1302 ---- } | routeStatement[*scope] ! | protoStatement[scene, scope] ; ! scriptInterfaceDeclaration[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, node_interface_set & interfaces, *************** *** 1321,1325 **** } } ! | scriptFieldInterfaceDeclaration[b, scope, interfaces, --- 1324,1328 ---- } } ! | scriptFieldInterfaceDeclaration[scene, scope, interfaces, *************** *** 1329,1333 **** scriptFieldInterfaceDeclaration[ ! browser & b, const boost::shared_ptr<openvrml::scope> & scope, node_interface_set & interfaces, --- 1332,1336 ---- scriptFieldInterfaceDeclaration[ ! openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, node_interface_set & interfaces, *************** *** 1342,1346 **** boost::shared_ptr<field_value> fv; } ! : KEYWORD_FIELD ft=fieldType id:ID fv=fieldValue[b, scope, ft, --- 1345,1349 ---- boost::shared_ptr<field_value> fv; } ! : KEYWORD_FIELD ft=fieldType id:ID fv=fieldValue[scene, scope, ft, *************** *** 1366,1370 **** ; ! protoNode[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1369,1373 ---- ; ! protoNode[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1382,1388 **** boost::shared_ptr<node_type> nodeType; } ! : ( { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ( ! protoNodeBodyElement[browser, scope, proto_interfaces, --- 1385,1391 ---- boost::shared_ptr<node_type> nodeType; } ! : ( { !LT(1)->getText().compare("Script") }? scriptId:ID LBRACE ( ! protoNodeBodyElement[scene, scope, proto_interfaces, *************** *** 1392,1396 **** initial_values, is_mappings] ! | protoScriptInterfaceDeclaration[browser, scope, proto_interfaces, --- 1395,1399 ---- initial_values, is_mappings] ! | protoScriptInterfaceDeclaration[scene, scope, proto_interfaces, *************** *** 1403,1407 **** )* RBRACE { n = boost::intrusive_ptr<openvrml::node>( ! new script_node(browser.script_node_class_, scope, interfaces, --- 1406,1410 ---- )* RBRACE { n = boost::intrusive_ptr<openvrml::node>( ! new script_node(scene.browser().script_node_class_, scope, interfaces, *************** *** 1420,1424 **** } } ! LBRACE (protoNodeBodyElement[browser, scope, proto_interfaces, --- 1423,1427 ---- } } ! LBRACE (protoNodeBodyElement[scene, scope, proto_interfaces, *************** *** 1442,1446 **** ; ! protoNodeBodyElement[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1445,1449 ---- ; ! protoNodeBodyElement[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1470,1474 **** || impl_node_interface->type == node_interface::exposedfield_id}? ( ! fv=protoFieldValue[browser, scope, proto_interfaces, --- 1473,1477 ---- || impl_node_interface->type == node_interface::exposedfield_id}? ( ! fv=protoFieldValue[scene, scope, proto_interfaces, *************** *** 1488,1492 **** ) | protoRouteStatement[*scope, routes] ! | protoStatement[browser, scope] ; --- 1491,1495 ---- ) | protoRouteStatement[*scope, routes] ! | protoStatement[scene, scope] ; *************** *** 1500,1512 **** ; ! protoScriptInterfaceDeclaration[openvrml::browser & browser, ! const boost::shared_ptr<openvrml::scope> & scope, ! const node_interface_set & proto_interfaces, ! proto_node_class::is_map_t & is_map, ! proto_node_class::routes_t & routes, ! const std::string & script_node_id, ! node_interface_set & interfaces, ! initial_value_map & initial_values, ! is_list & is_mappings] options { defaultErrorHandler=false; } { --- 1503,1516 ---- ; ! protoScriptInterfaceDeclaration[ ! openvrml::scene & scene, ! const boost::shared_ptr<openvrml::scope> & scope, ! const node_interface_set & proto_interfaces, ! proto_node_class::is_map_t & is_map, ! proto_node_class::routes_t & routes, ! const std::string & script_node_id, ! node_interface_set & interfaces, ! initial_value_map & initial_values, ! is_list & is_mappings] options { defaultErrorHandler=false; } { *************** *** 1530,1534 **** } } (isStatement[id->getText(), is_mappings])? ! | protoScriptFieldInterfaceDeclaration[browser, scope, proto_interfaces, --- 1534,1538 ---- } } (isStatement[id->getText(), is_mappings])? ! | protoScriptFieldInterfaceDeclaration[scene, scope, proto_interfaces, *************** *** 1542,1546 **** protoScriptFieldInterfaceDeclaration[ ! openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1546,1550 ---- protoScriptFieldInterfaceDeclaration[ ! openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1573,1577 **** } } ( ! fv=protoFieldValue[browser, scope, proto_interfaces, --- 1577,1581 ---- } } ( ! fv=protoFieldValue[scene, scope, proto_interfaces, *************** *** 1633,1637 **** ; ! fieldValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const openvrml::field_value::type_id ft, --- 1637,1641 ---- ; ! fieldValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const openvrml::field_value::type_id ft, *************** *** 1640,1648 **** options { defaultErrorHandler=false; } : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? ! fv=nodeFieldValue[browser, scope, ft, node_id] | fv=nonNodeFieldValue[ft] ; ! protoFieldValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1644,1652 ---- options { defaultErrorHandler=false; } : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? ! fv=nodeFieldValue[scene, scope, ft, node_id] | fv=nonNodeFieldValue[ft] ; ! protoFieldValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1654,1658 **** options { defaultErrorHandler=false; } : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? ! fv=protoNodeFieldValue[browser, scope, proto_interfaces, --- 1658,1662 ---- options { defaultErrorHandler=false; } : { (ft == field_value::sfnode_id) || (ft == field_value::mfnode_id) }? ! fv=protoNodeFieldValue[scene, scope, proto_interfaces, *************** *** 1689,1693 **** ; ! nodeFieldValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, openvrml::field_value::type_id ft, --- 1693,1697 ---- ; ! nodeFieldValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, openvrml::field_value::type_id ft, *************** *** 1699,1707 **** } : { ft == field_value::sfnode_id }? ! fv=sfNodeValue[browser, scope, script_node_id] ! | fv=mfNodeValue[browser, scope, script_node_id] ; ! protoNodeFieldValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1703,1711 ---- } : { ft == field_value::sfnode_id }? ! fv=sfNodeValue[scene, scope, script_node_id] ! | fv=mfNodeValue[scene, scope, script_node_id] ; ! protoNodeFieldValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1713,1722 **** options { defaultErrorHandler=false; } : { ft == field_value::sfnode_id }? ! fv=protoSfNodeValue[browser, scope, proto_interfaces, is_map, routes, script_node_id] ! | fv=protoMfNodeValue[browser, scope, proto_interfaces, --- 1717,1726 ---- options { defaultErrorHandler=false; } : { ft == field_value::sfnode_id }? ! fv=protoSfNodeValue[scene, scope, proto_interfaces, is_map, routes, script_node_id] ! | fv=protoMfNodeValue[scene, scope, proto_interfaces, *************** *** 1895,1899 **** ; ! sfNodeValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const std::string & script_node_id] --- 1899,1903 ---- ; ! sfNodeValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const std::string & script_node_id] *************** *** 1903,1907 **** boost::intrusive_ptr<openvrml::node> n; } ! : n=nodeStatement[browser, scope, script_node_id] { snv.reset(new sfnode(n)); } --- 1907,1911 ---- boost::intrusive_ptr<openvrml::node> n; } ! : n=nodeStatement[scene, scope, script_node_id] { snv.reset(new sfnode(n)); } *************** *** 1909,1913 **** ; ! protoSfNodeValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1913,1917 ---- ; ! protoSfNodeValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1920,1924 **** boost::intrusive_ptr<openvrml::node> n; } ! : n=protoNodeStatement[browser, scope, proto_interfaces, --- 1924,1928 ---- boost::intrusive_ptr<openvrml::node> n; } ! : n=protoNodeStatement[scene, scope, proto_interfaces, *************** *** 1933,1937 **** ; ! mfNodeValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const std::string & script_node_id] --- 1937,1941 ---- ; ! mfNodeValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const std::string & script_node_id] *************** *** 1945,1949 **** mfnode & nodes = static_cast<mfnode &>(*mnv); } ! : n=nodeStatement[browser, scope, script_node_id] { if (n) { nodes.value(mfnode::value_type(1, n)); } } --- 1949,1953 ---- mfnode & nodes = static_cast<mfnode &>(*mnv); } ! : n=nodeStatement[scene, scope, script_node_id] { if (n) { nodes.value(mfnode::value_type(1, n)); } } *************** *** 1951,1955 **** mfnode::value_type value; } ( ! n=nodeStatement[browser, scope, script_node_id] { if (n) { value.push_back(n); } } --- 1955,1959 ---- mfnode::value_type value; } ( ! n=nodeStatement[scene, scope, script_node_id] { if (n) { value.push_back(n); } } *************** *** 1959,1963 **** ; ! protoMfNodeValue[openvrml::browser & browser, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, --- 1963,1967 ---- ; ! protoMfNodeValue[openvrml::scene & scene, const boost::shared_ptr<openvrml::scope> & scope, const node_interface_set & proto_interfaces, *************** *** 1974,1978 **** mfnode & nodes = static_cast<mfnode &>(*mnv); } ! : n=protoNodeStatement[browser, scope, proto_interfaces, --- 1978,1982 ---- mfnode & nodes = static_cast<mfnode &>(*mnv); } ! : n=protoNodeStatement[scene, scope, proto_interfaces, *************** *** 1985,1989 **** mfnode::value_type value; } ( ! n=protoNodeStatement[browser, scope, proto_interfaces, --- 1989,1993 ---- mfnode::value_type value; } ( ! n=protoNodeStatement[scene, scope, proto_interfaces, |
From: Braden M. <br...@us...> - 2005-11-27 16:58:23
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv941 Modified Files: ChangeLog Log Message: externproto_node_class will need to be constructed with an openvrml::scene rather than an openvrml::browser. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1051 retrieving revision 1.1052 diff -C2 -d -r1.1051 -r1.1052 *** ChangeLog 27 Nov 2005 07:11:35 -0000 1.1051 --- ChangeLog 27 Nov 2005 16:58:13 -0000 1.1052 *************** *** 1,8 **** 2005-11-27 Braden McDaniel <br...@en...> * mozilla-plugin/src/openvrml-player/player.cpp: Include OpenVRML headers before X11 headers. This avoids a conflict between the ! X11 headers and Boost headers. ! From Simon Barner <ba...@us...> 2005-11-27 Braden McDaniel <br...@en...> --- 1,100 ---- 2005-11-27 Braden McDaniel <br...@en...> + externproto_node_class will need to be constructed with an + openvrml::scene rather than an openvrml::browser. + + * src/libopenvrml/openvrml/Vrml97Parser.g + (Vrml97Parser::vrmlScene): Pass an openvrml::scene to the + statement production. + (Vrml97Parser::statement): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + nodeStatement and protoStatement productions. + (Vrml97Prser::nodeStatement): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the node + production. + (Vrml97Parser::protoStatement): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the externproto + and proto productions. + (Vrml97Parser::proto): Take an openvrml::scene argument instead of + an openvrml::browser; pass the scene to the + protoInterfaceDeclaration and protoBody productions. + (Vrml97Parser::protoInterfaceDeclaration): Take an openvrml::scene + argument instead of an openvrml::browser; pass the scene to the + fieldValue production. + (Vrml97Parser::protoBody): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + protoStatement, protoNodeStatement, and protoBodyStatement + productions. + (Vrml97Parser::protoBodyStatement): Take an openvrml::scene + argument instead of an openvrml::browser; pass the scene to the + protoNodeStatement and protoStatement productions. + (Vrml97Parser::protoNodeStatement): Take an openvrml::scene + argument instead of an openvrml::browser; pass the scene to the + protoNode production. + (Vrml97Parser::externproto): Take an openvrml::scene argument + instead of an openvrml::browser; construct externproto_node_class + with the scene. + (Vrml97Parser::node): Take an openvrml::scene argument instead of + an openvrml::browser; pass the scene to the nodeBodyElement and + scriptInterfaceDeclaration productions. + (Vrml97Parser::nodeBodyElement): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the fieldValue + and protoStatement productions. + (Vrml97Parser::scriptInterfaceDeclaration): Take an + openvrml::scene argument instead of an openvrml::browser; pass the + scene to the scriptFieldInterfaceDeclaration production. + (Vrml97Parser::scriptFieldInterfaceDeclaration): Take an + openvrml::scene argument instead of an openvrml::browser; pass the + scene to the fieldValue production. + (Vrml97Parser::protoNode): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + protoNodeBodyElement and protoScriptInterfaceDeclaration + productions. + (Vrml97Parser::protoNodeBodyElement): Take an openvrml::scene + argument instead of an openvrml::browser; pass the scene to the + protoFieldValue and protoStatement productions. + (Vrml97Parser::protoScriptInterfaceDeclaration): Take an + openvrml::scene argument instead of an openvrml::browser; pass the + scene to the protoScriptFieldInterfaceDeclaration. + (Vrml97Parser::protoScriptFieldInterfaceDeclaration): Take an + openvrml::scene argument instead of an openvrml::browser; pass the + scene to the protoFieldValue production. + (Vrml97Parser::fieldValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + nodeFieldValue production. + (Vrml97Parser::protoFieldValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + protoNodeFieldValue production. + (Vrml97Parser::nodeFieldValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the sfNodeValue + and mfNodeValue productions. + (Vrml97Parser::protoNodeFieldValue): Take an openvrml::scene + argument instead of an openvrml::browser; pass the scene to the + protoSfNodeValue and protoMfNodeValue productions. + (Vrml97Parser::sfNodeValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + nodeStatement production. + (Vrml97Parser::protoSfNodeValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + protoNodeStatement production. + (Vrml97Parser::mfNodeValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + nodeStatement production. + (Vrml97Parser::protoMfNodeValue): Take an openvrml::scene argument + instead of an openvrml::browser; pass the scene to the + protoNodeStatement production. + * src/libopenvrml/openvrml/Vrml97Parser.g + (X3DVrmlParser::vrmlScene): pass the scene to the statement + production. + * src/libopenvrml/openvrml/browser.cpp + (externproto_node_class::externproto_node_class): Change to take + an openvrml::scene instead of an openvrml::browser. + + 2005-11-27 Braden McDaniel <br...@en...> + * mozilla-plugin/src/openvrml-player/player.cpp: Include OpenVRML headers before X11 headers. This avoids a conflict between the ! X11 headers and Boost headers. From Simon Barner ! <ba...@us...> 2005-11-27 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2005-11-27 07:11:43
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1093 Modified Files: ChangeLog Log Message: Include OpenVRML headers before X11 headers. This avoids a conflict between the X11 headers and Boost headers. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1050 retrieving revision 1.1051 diff -C2 -d -r1.1050 -r1.1051 *** ChangeLog 27 Nov 2005 06:13:00 -0000 1.1050 --- ChangeLog 27 Nov 2005 07:11:35 -0000 1.1051 *************** *** 1,4 **** --- 1,11 ---- 2005-11-27 Braden McDaniel <br...@en...> + * mozilla-plugin/src/openvrml-player/player.cpp: Include OpenVRML + headers before X11 headers. This avoids a conflict between the + X11 headers and Boost headers. + From Simon Barner <ba...@us...> + + 2005-11-27 Braden McDaniel <br...@en...> + Changed error messages not to look so much like sentences. |
From: Braden M. <br...@us...> - 2005-11-27 07:11:43
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1093/mozilla-plugin/src/openvrml-player Modified Files: player.cpp Log Message: Include OpenVRML headers before X11 headers. This avoids a conflict between the X11 headers and Boost headers. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** player.cpp 30 Oct 2005 03:20:17 -0000 1.13 --- player.cpp 27 Nov 2005 07:11:36 -0000 1.14 *************** *** 26,29 **** --- 26,31 ---- # include <boost/thread/mutex.hpp> # include <boost/thread/thread.hpp> + # include <openvrml/browser.h> + # include <openvrml/gl/viewer.h> # include <unistd.h> # include <argp.h> *************** *** 32,37 **** # include <gtk/gtk.h> # include <gtk/gtkgl.h> - # include <openvrml/browser.h> - # include <openvrml/gl/viewer.h> namespace { --- 34,37 ---- |
From: Braden M. <br...@us...> - 2005-11-27 06:13:15
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25211 Modified Files: ChangeLog Log Message: Changed error messages not to look so much like sentences. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1049 retrieving revision 1.1050 diff -C2 -d -r1.1049 -r1.1050 *** ChangeLog 27 Nov 2005 05:30:21 -0000 1.1049 --- ChangeLog 27 Nov 2005 06:13:00 -0000 1.1050 *************** *** 1,2 **** --- 1,12 ---- + 2005-11-27 Braden McDaniel <br...@en...> + + Changed error messages not to look so much like sentences. + + * src/libopenvrml/openvrml/Vrml97Parser.g + * src/libopenvrml/openvrml/X3DVrmlParser.g + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/node.cpp + * src/libopenvrml/openvrml/vrml97node.cpp + 2005-11-26 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2005-11-27 06:13:11
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25211/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g X3DVrmlParser.g browser.cpp node.cpp vrml97node.cpp Log Message: Changed error messages not to look so much like sentences. Index: X3DVrmlParser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/X3DVrmlParser.g,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** X3DVrmlParser.g 26 Nov 2005 22:04:33 -0000 1.6 --- X3DVrmlParser.g 27 Nov 2005 06:13:00 -0000 1.7 *************** *** 219,224 **** if (false) { } else { ! throw antlr::SemanticException("Unsupported profile \"" ! + id->getText() + "\".", this->uri, id->getLine(), --- 219,224 ---- if (false) { } else { ! throw antlr::SemanticException("unsupported profile \"" ! + id->getText() + "\"", this->uri, id->getLine(), Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** browser.cpp 27 Nov 2005 05:30:21 -0000 1.103 --- browser.cpp 27 Nov 2005 06:13:00 -0000 1.104 *************** *** 7973,7977 **** */ openvrml::invalid_url::invalid_url(): ! bad_url("Invalid URI.") {} --- 7973,7977 ---- */ openvrml::invalid_url::invalid_url(): ! bad_url("invalid URI") {} *************** *** 8016,8020 **** */ openvrml::unreachable_url::unreachable_url(): ! bad_url("Unreachable URI.") {} --- 8016,8020 ---- */ openvrml::unreachable_url::unreachable_url(): ! bad_url("unreachable URI") {} *************** *** 8037,8041 **** */ openvrml::no_alternative_url::no_alternative_url(): ! bad_url("No alternative URI could be resolved.") {} --- 8037,8041 ---- */ openvrml::no_alternative_url::no_alternative_url(): ! bad_url("no alternative URI could be resolved") {} Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** vrml97node.cpp 26 Nov 2005 06:30:40 -0000 1.85 --- vrml97node.cpp 27 Nov 2005 06:13:00 -0000 1.86 *************** *** 19562,19566 **** error = FT_Init_FreeType(&this->freeTypeLibrary); if (error) { ! browser.err << "Error initializing FreeType library." << std::endl; } # endif // OPENVRML_ENABLE_RENDER_TEXT_NODE --- 19562,19566 ---- error = FT_Init_FreeType(&this->freeTypeLibrary); if (error) { ! browser.err << "error initializing FreeType library" << std::endl; } # endif // OPENVRML_ENABLE_RENDER_TEXT_NODE *************** *** 19576,19580 **** error = FT_Done_FreeType(this->freeTypeLibrary); if (error) { ! this->browser().err << "Error shutting down FreeType library." << std::endl; } --- 19576,19580 ---- error = FT_Done_FreeType(this->freeTypeLibrary); if (error) { ! this->browser().err << "error shutting down FreeType library" << std::endl; } *************** *** 20844,20848 **** // explicit FreeTypeError(FT_Error): ! std::runtime_error("FreeType error.") {} --- 20844,20848 ---- // explicit FreeTypeError(FT_Error): ! std::runtime_error("FreeType error") {} Index: node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** node.cpp 21 Nov 2005 06:07:09 -0000 1.67 --- node.cpp 27 Nov 2005 06:13:00 -0000 1.68 *************** *** 58,63 **** unsupported_interface(const node_interface & interface) throw (): ! std::logic_error("Unsupported interface \"" ! + boost::lexical_cast<std::string>(interface) + "\".") {} --- 58,63 ---- unsupported_interface(const node_interface & interface) throw (): ! std::logic_error("unsupported interface \"" ! + boost::lexical_cast<std::string>(interface) + "\"") {} *************** *** 900,904 **** */ openvrml::field_value_type_mismatch::field_value_type_mismatch(): ! std::logic_error("Field value types do not match.") {} --- 900,904 ---- */ openvrml::field_value_type_mismatch::field_value_type_mismatch(): ! std::logic_error("field value types do not match") {} Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Vrml97Parser.g 26 Nov 2005 22:04:33 -0000 1.37 --- Vrml97Parser.g 27 Nov 2005 06:13:00 -0000 1.38 *************** *** 669,675 **** scope->find_node(id1->getText())); if (!n) { ! throw SemanticException("Node \"" + id1->getText() + "\" has not been defined in " ! + "this scope.", this->uri, id1->getLine(), --- 669,675 ---- scope->find_node(id1->getText())); if (!n) { ! throw SemanticException("node \"" + id1->getText() + "\" has not been defined in " ! + "this scope", this->uri, id1->getLine(), *************** *** 746,752 **** if (!scope->add_type(node_type)) { using antlr::SemanticException; ! throw SemanticException("Node type \"" + node_type->id() + "\" has already been defined in " ! "this scope.", this->uri, id->getLine(), --- 746,752 ---- if (!scope->add_type(node_type)) { using antlr::SemanticException; ! throw SemanticException("node type \"" + node_type->id() + "\" has already been defined in " ! "this scope", this->uri, id->getLine(), *************** *** 915,921 **** scope->find_node(id1->getText())); if (!n) { ! throw SemanticException("Node \"" + id1->getText() + "\" has not been defined in " ! + "this scope.", this->uri, id1->getLine(), --- 915,921 ---- scope->find_node(id1->getText())); if (!n) { ! throw SemanticException("node \"" + id1->getText() + "\" has not been defined in " ! + "this scope", this->uri, id1->getLine(), *************** *** 988,994 **** if (!scope->add_type(node_type)) { using antlr::SemanticException; ! throw SemanticException("Node type \"" + node_type->id() + "\" has already been defined in " ! + "this scope.", this->uri, id->getLine(), --- 988,994 ---- if (!scope->add_type(node_type)) { using antlr::SemanticException; ! throw SemanticException("node type \"" + node_type->id() + "\" has already been defined in " ! + "this scope", this->uri, id->getLine(), *************** *** 1058,1064 **** scope.find_node(from_node_id->getText()); if (!from_node) { ! throw SemanticException("Node \"" + from_node_id->getText() + "\" has not been defined in this " ! "scope.", this->uri, from_node_id->getLine(), --- 1058,1064 ---- scope.find_node(from_node_id->getText()); if (!from_node) { ! throw SemanticException("node \"" + from_node_id->getText() + "\" has not been defined in this " ! "scope", this->uri, from_node_id->getLine(), *************** *** 1069,1075 **** scope.find_node(to_node_id->getText()); if (!to_node) { ! throw SemanticException("Node \"" + to_node_id->getText() + "\" has not been defined in this " ! "scope.", this->uri, to_node_id->getLine(), --- 1069,1075 ---- scope.find_node(to_node_id->getText()); if (!to_node) { ! throw SemanticException("node \"" + to_node_id->getText() + "\" has not been defined in this " ! "scope", this->uri, to_node_id->getLine(), *************** *** 1105,1111 **** scope.find_node(from_node_id->getText()); if (!from_node) { ! throw SemanticException("Node \"" + from_node_id->getText() + "\" has not been defined in this " ! "scope.", this->uri, from_node_id->getLine(), --- 1105,1111 ---- scope.find_node(from_node_id->getText()); if (!from_node) { ! throw SemanticException("node \"" + from_node_id->getText() + "\" has not been defined in this " ! "scope", this->uri, from_node_id->getLine(), *************** *** 1116,1122 **** scope.find_node(to_node_id->getText()); if (!to_node) { ! throw SemanticException("Node \"" + to_node_id->getText() + "\" has not been defined in this " ! "scope.", this->uri, to_node_id->getLine(), --- 1116,1122 ---- scope.find_node(to_node_id->getText()); if (!to_node) { ! throw SemanticException("node \"" + to_node_id->getText() + "\" has not been defined in this " ! "scope", this->uri, to_node_id->getLine(), *************** *** 1141,1145 **** throw SemanticException(from_node->type().id() + " node has " "no eventOut \"" ! + eventout_id->getText() + "\".", this->uri, eventout_id->getLine(), --- 1141,1145 ---- throw SemanticException(from_node->type().id() + " node has " "no eventOut \"" ! + eventout_id->getText() + "\"", this->uri, eventout_id->getLine(), *************** *** 1156,1160 **** throw SemanticException(to_node->type().id() + " node has no " "eventIn \"" + eventin_id->getText() ! + "\".", this->uri, eventin_id->getLine(), --- 1156,1160 ---- throw SemanticException(to_node->type().id() + " node has no " "eventIn \"" + eventin_id->getText() ! + "\"", this->uri, eventin_id->getLine(), *************** *** 1163,1168 **** if (to_interface->field_type != from_interface->field_type) { ! throw SemanticException("Mismatch between eventOut and " ! "eventIn types.", this->uri, eventin_id->getLine(), --- 1163,1168 ---- if (to_interface->field_type != from_interface->field_type) { ! throw SemanticException("mismatch between eventOut and " ! "eventIn types", this->uri, eventin_id->getLine(), *************** *** 1210,1215 **** nodeType = scope->find_type(nodeTypeId->getText()); if (!nodeType) { ! throw SemanticException("Unknown node type \"" ! + nodeTypeId->getText() + "\".", this->uri, nodeTypeId->getLine(), --- 1210,1215 ---- nodeType = scope->find_type(nodeTypeId->getText()); if (!nodeType) { ! throw SemanticException("unknown node type \"" ! + nodeTypeId->getText() + "\"", this->uri, nodeTypeId->getLine(), *************** *** 1241,1246 **** } catch [std::bad_cast & ex] { ! throw SemanticException("Incorrect value type for field or " ! "exposedField.", this->uri, LT(1)->getLine(), --- 1241,1246 ---- } catch [std::bad_cast & ex] { ! throw SemanticException("incorrect value type for field or " ! "exposedField", this->uri, LT(1)->getLine(), *************** *** 1284,1289 **** initial_values.insert(make_pair(id->getText(), fv)).second; if (!succeeded) { ! throw SemanticException("Value for " + id->getText() ! + " already declared.", this->uri, id->getLine(), --- 1284,1289 ---- initial_values.insert(make_pair(id->getText(), fv)).second; if (!succeeded) { ! throw SemanticException("value for " + id->getText() ! + " already declared", this->uri, id->getLine(), *************** *** 1353,1359 **** .second; if (!succeeded) { ! throw SemanticException("Interface \"" + id->getText() + "\" already declared for Script " ! "node.", this->uri, id->getLine(), --- 1353,1359 ---- .second; if (!succeeded) { ! throw SemanticException("interface \"" + id->getText() + "\" already declared for Script " ! "node", this->uri, id->getLine(), *************** *** 1413,1418 **** nodeType = scope->find_type(nodeTypeId->getText()); if (!nodeType) { ! throw SemanticException("Unknown node type \"" ! + nodeTypeId->getText() + "\".", this->uri, nodeTypeId->getLine(), --- 1413,1418 ---- nodeType = scope->find_type(nodeTypeId->getText()); if (!nodeType) { ! throw SemanticException("unknown node type \"" ! + nodeTypeId->getText() + "\"", this->uri, nodeTypeId->getLine(), *************** *** 1461,1466 **** find_interface(node_interfaces, interface_id->getText()); if (impl_node_interface == node_interfaces.end()) { ! throw SemanticException("Node has no interface \"" ! + interface_id->getText() + "\".", this->uri, interface_id->getLine(), --- 1461,1466 ---- find_interface(node_interfaces, interface_id->getText()); if (impl_node_interface == node_interfaces.end()) { ! throw SemanticException("node has no interface \"" ! + interface_id->getText() + "\"", this->uri, interface_id->getLine(), *************** *** 1565,1571 **** if (!succeeded) { using antlr::SemanticException; ! throw SemanticException("Interface \"" + id->getText() + "\" already declared for Script " ! "node.", this->uri, id->getLine(), --- 1565,1571 ---- if (!succeeded) { using antlr::SemanticException; ! throw SemanticException("interface \"" + id->getText() + "\" already declared for Script " ! "node", this->uri, id->getLine(), *************** *** 1783,1788 **** : val=floatValue { if (val < 0.0 || val > 1.0) { ! this->reportWarning("Color component values must be from 0 to " ! "1."); if (val < 0.0) { val = 0.0; --- 1783,1788 ---- : val=floatValue { if (val < 0.0 || val > 1.0) { ! this->reportWarning( ! "color component values must be from 0 to 1"); if (val < 0.0) { val = 0.0; *************** *** 1839,1844 **** pixel=intValue { if (!(pixel_index < x * y)) { ! throw SemanticException("Too many pixel values for " ! "SFImage.", this->uri, LT(1)->getLine(), --- 1839,1844 ---- pixel=intValue { if (!(pixel_index < x * y)) { ! throw SemanticException("too many pixel values for " ! "SFImage", this->uri, LT(1)->getLine(), *************** *** 1849,1854 **** )* { if (pixel_index != x * y) { ! throw antlr::SemanticException("Insufficient pixel values for " ! "SFImage.", this->uri, LT(1)->getLine(), --- 1849,1854 ---- )* { if (pixel_index != x * y) { ! throw antlr::SemanticException("insufficient pixel values for " ! "SFImage", this->uri, LT(1)->getLine(), *************** *** 2036,2041 **** const float axisLength = axis.length(); if (!fequal<float>()(axisLength, 1.0f)) { ! this->reportWarning("The axis component of a rotation must be " ! "a normalized vector."); if (fequal<float>()(axisLength, 0.0f)) { axis.z(1.0); --- 2036,2041 ---- const float axisLength = axis.length(); if (!fequal<float>()(axisLength, 1.0f)) { ! this->reportWarning("axis component of a rotation must be " ! "a normalized vector"); if (fequal<float>()(axisLength, 0.0f)) { axis.z(1.0); |
From: Braden M. <br...@us...> - 2005-11-27 05:30:29
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19538/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Moved implementations of member functions for externproto_node_class, externproto_node_type, and externproto_node after Vrml97Parser and X3DVrmlParser have been included. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** browser.cpp 27 Nov 2005 04:39:30 -0000 1.102 --- browser.cpp 27 Nov 2005 05:30:21 -0000 1.103 *************** *** 2855,3204 **** - externproto_node_class:: - externproto_node_class(openvrml::browser & b, - const std::vector<std::string> & /* uris */) - throw (): - node_class(b) - {} - - externproto_node_class::~externproto_node_class() throw () - {} - - const boost::shared_ptr<openvrml::node_type> - externproto_node_class:: - do_create_type(const std::string & id, - const openvrml::node_interface_set & interfaces) const - throw (openvrml::unsupported_interface, std::bad_alloc) - { - using openvrml::node_type; - return boost::shared_ptr<node_type>( - static_cast<node_type *>( - new externproto_node_type(*this, id, interfaces))); - } - - - externproto_node_type::externproto_node_type( - const openvrml::node_class & c, - const std::string & id, - const openvrml::node_interface_set & interfaces) - throw (std::bad_alloc): - node_type(c, id), - interfaces_(interfaces) - {} - - externproto_node_type::~externproto_node_type() throw () - {} - - /** - * @brief Set the owning pointer to the <code>openvrml::node_class</code>. - * - * The base <code>openvrml::node_type</code> simply holds a reference to - * the <code>openvrml::node_class</code>. If we get an EXTERNPROTO with no - * implementation, we need to store an owning pointer to the - * <code>node_class</code> here. See the comment in - * <code>Vrml97Parser::externproto</code> for details. - */ - void externproto_node_type::set_owning_ptr_to_class( - const boost::shared_ptr<openvrml::node_class> & node_class) throw () - { - this->owning_ptr_to_class_ = node_class; - } - - const openvrml::node_interface_set & - externproto_node_type::do_interfaces() const throw() - { - return this->interfaces_; - } - - const boost::intrusive_ptr<openvrml::node> - externproto_node_type::do_create_node( - const boost::shared_ptr<openvrml::scope> & scope, - const openvrml::initial_value_map & initial_values) const - throw (openvrml::unsupported_interface, std::bad_cast, std::bad_alloc) - { - using openvrml::node; - return boost::intrusive_ptr<node>( - static_cast<node *>( - new externproto_node(*this, scope, initial_values))); - } - - - template <typename FieldValue> - externproto_node::externproto_exposedfield<FieldValue>:: - externproto_exposedfield(externproto_node & node) throw (): - openvrml::node_event_listener(node), - openvrml::event_emitter(static_cast<openvrml::field_value &>(*this)), - proto_eventin<FieldValue>(node), - openvrml::field_value_emitter<FieldValue>( - static_cast<FieldValue &>(*this)) - {} - - template <typename FieldValue> - externproto_node::externproto_exposedfield<FieldValue>:: - ~externproto_exposedfield() throw () - {} - - template <typename FieldValue> - void externproto_node::externproto_exposedfield<FieldValue>:: - do_process_event(const FieldValue & value, const double timestamp) - throw (std::bad_alloc) - { - static_cast<FieldValue &>(*this) = value; - this->proto_eventin<FieldValue>::do_process_event(value, timestamp); - this->node().modified(true); - node::emit_event(*this, timestamp); - } - - template <typename FieldValue> - const std::string - externproto_node::externproto_exposedfield<FieldValue>:: - do_eventout_id() const throw () - { - using boost::polymorphic_downcast; - externproto_node & node = - *polymorphic_downcast<externproto_node *>(&this->node()); - field_map::const_iterator pos = - std::find_if(node.field_map_.begin(), - node.field_map_.end(), - externproto_field_equal_to(*this)); - assert(pos != node.field_map_.end()); - return pos->first; - } - - const boost::shared_ptr<openvrml::field_value> - externproto_node::create_exposedfield(externproto_node & node, - openvrml::field_value::type_id type) - throw (std::bad_alloc) - { - using namespace openvrml; - - boost::shared_ptr<field_value> result; - switch (type) { - case field_value::sfbool_id: - result.reset(new externproto_exposedfield<sfbool>(node)); - break; - case field_value::sfcolor_id: - result.reset(new externproto_exposedfield<sfcolor>(node)); - break; - case field_value::sfdouble_id: - result.reset(new externproto_exposedfield<sfdouble>(node)); - break; - case field_value::sffloat_id: - result.reset(new externproto_exposedfield<sffloat>(node)); - break; - case field_value::sfimage_id: - result.reset(new externproto_exposedfield<sfimage>(node)); - break; - case field_value::sfint32_id: - result.reset(new externproto_exposedfield<sfint32>(node)); - break; - case field_value::sfnode_id: - result.reset(new externproto_exposedfield<sfnode>(node)); - break; - case field_value::sfrotation_id: - result.reset(new externproto_exposedfield<sfrotation>(node)); - break; - case field_value::sfstring_id: - result.reset(new externproto_exposedfield<sfstring>(node)); - break; - case field_value::sftime_id: - result.reset(new externproto_exposedfield<sftime>(node)); - break; - case field_value::sfvec2f_id: - result.reset(new externproto_exposedfield<sfvec2f>(node)); - break; - case field_value::sfvec2d_id: - result.reset(new externproto_exposedfield<sfvec2d>(node)); - break; - case field_value::sfvec3f_id: - result.reset(new externproto_exposedfield<sfvec3f>(node)); - break; - case field_value::sfvec3d_id: - result.reset(new externproto_exposedfield<sfvec3d>(node)); - break; - case field_value::mfcolor_id: - result.reset(new externproto_exposedfield<mfcolor>(node)); - break; - case field_value::mffloat_id: - result.reset(new externproto_exposedfield<mffloat>(node)); - break; - case field_value::mfdouble_id: - result.reset(new externproto_exposedfield<mfdouble>(node)); - break; - case field_value::mfint32_id: - result.reset(new externproto_exposedfield<mfint32>(node)); - break; - case field_value::mfnode_id: - result.reset(new externproto_exposedfield<mfnode>(node)); - break; - case field_value::mfrotation_id: - result.reset(new externproto_exposedfield<mfrotation>(node)); - break; - case field_value::mfstring_id: - result.reset(new externproto_exposedfield<mfstring>(node)); - break; - case field_value::mftime_id: - result.reset(new externproto_exposedfield<mftime>(node)); - break; - case field_value::mfvec2f_id: - result.reset(new externproto_exposedfield<mfvec2f>(node)); - break; - case field_value::mfvec2d_id: - result.reset(new externproto_exposedfield<mfvec2d>(node)); - break; - case field_value::mfvec3f_id: - result.reset(new externproto_exposedfield<mfvec3f>(node)); - break; - case field_value::mfvec3d_id: - result.reset(new externproto_exposedfield<mfvec3d>(node)); - break; - default: - assert(false); - } - assert(result); - return result; - } - - externproto_node::externproto_node( - const externproto_node_type & type, - const boost::shared_ptr<openvrml::scope> & scope, - const openvrml::initial_value_map & initial_values) - throw (std::bad_alloc): - abstract_proto_node(type, scope) - { - using openvrml::node_interface; - using openvrml::node_interface_set; - - for (node_interface_set::const_iterator interface = - type.interfaces().begin(); - interface != type.interfaces().end(); - ++interface) - { - using boost::shared_ptr; - using boost::dynamic_pointer_cast; - - bool succeeded = false; - std::auto_ptr<openvrml::field_value> field_auto_ptr; - shared_ptr<openvrml::event_listener> interface_eventin; - shared_ptr<openvrml::event_emitter> interface_eventout; - shared_ptr<openvrml::field_value> interface_field; - switch (interface->type) { - case node_interface::eventin_id: - succeeded = this->eventin_map - .insert(make_pair(interface->id, - create_eventin(interface->field_type, - *this))) - .second; - break; - case node_interface::eventout_id: - succeeded = this->eventout_map - .insert(make_pair(interface->id, - create_eventout(interface->field_type, - *this))) - .second; - break; - case node_interface::exposedfield_id: - interface_field = create_exposedfield(*this, - interface->field_type); - succeeded = this->field_map_ - .insert(make_pair(interface->id, interface_field)).second; - assert(succeeded); - - interface_eventin = - dynamic_pointer_cast<openvrml::event_listener>( - interface_field); - succeeded = this->eventin_map - .insert(make_pair("set_" + interface->id, - interface_eventin)) - .second; - assert(succeeded); - - interface_eventout = - dynamic_pointer_cast<openvrml::event_emitter>( - interface_eventin); - succeeded = this->eventout_map - .insert(make_pair(interface->id + "_changed", - interface_eventout)) - .second; - break; - case node_interface::field_id: - field_auto_ptr = - openvrml::field_value::create(interface->field_type); - succeeded = this->field_map_ - .insert( - make_pair( - interface->id, - shared_ptr<openvrml::field_value>(field_auto_ptr))) - .second; - break; - case node_interface::invalid_type_id: - assert(false - && "got node_interface::invalid_type_id for " - "interface->type"); - } - assert(succeeded); - } - - // - // Set the initial values. - // - using openvrml::initial_value_map; - for (initial_value_map::const_iterator map_entry = - initial_values.begin(); - map_entry != initial_values.end(); - ++map_entry) { - const field_map::const_iterator pos = - this->field_map_.find(map_entry->first); - if (pos == this->field_map_.end()) { - throw openvrml::unsupported_interface(this->type(), - map_entry->first); - } - pos->second->assign(*map_entry->second); - } - } - - externproto_node::~externproto_node() throw () - {} - - const openvrml::field_value & - externproto_node::do_field(const std::string & id) const - throw (openvrml::unsupported_interface) - { - field_map::const_iterator pos = this->field_map_.find(id); - if (pos == this->field_map_.end()) { - throw openvrml::unsupported_interface( - this->type(), openvrml::node_interface::field_id, id); - } - assert(pos->second); - return *pos->second; - } - - openvrml::event_listener & - externproto_node::do_event_listener(const std::string & id) - throw (openvrml::unsupported_interface) - { - eventin_map_t::const_iterator pos = this->eventin_map.find(id); - if (pos == this->eventin_map.end()) { - throw openvrml::unsupported_interface( - this->type(), openvrml::node_interface::eventin_id, id); - } - assert(pos->second); - return *pos->second; - } - - openvrml::event_emitter & - externproto_node::do_event_emitter(const std::string & id) - throw (openvrml::unsupported_interface) - { - eventout_map_t::const_iterator pos = this->eventout_map.find(id); - if (pos == this->eventout_map.end()) { - throw openvrml::unsupported_interface( - this->type(), openvrml::node_interface::eventout_id, id); - } - assert(pos->second); - return *pos->second; - } - - class OPENVRML_LOCAL default_navigation_info : public openvrml::navigation_info_node { --- 2855,2858 ---- *************** *** 5847,5855 **** // This usage lets us put the ANTLR parser in an unnamed namespace. // ! #include "Vrml97Parser.cpp" } // Close "namespace openvrml", opened in Vrml97Parser.cpp. ! #include "X3DVrmlParser.cpp" } // Close "namespace openvrml", opened in X3DVrmlParser.cpp. // Max time in seconds between updates. Make this user // setable to balance performance with cpu usage. --- 5501,5858 ---- // This usage lets us put the ANTLR parser in an unnamed namespace. // ! # include "Vrml97Parser.cpp" } // Close "namespace openvrml", opened in Vrml97Parser.cpp. ! # include "X3DVrmlParser.cpp" } // Close "namespace openvrml", opened in X3DVrmlParser.cpp. + namespace { + + externproto_node_class:: + externproto_node_class(openvrml::browser & b, + const std::vector<std::string> & /* uris */) + throw (): + node_class(b) + {} + + externproto_node_class::~externproto_node_class() throw () + {} + + const boost::shared_ptr<openvrml::node_type> + externproto_node_class:: + do_create_type(const std::string & id, + const openvrml::node_interface_set & interfaces) const + throw (openvrml::unsupported_interface, std::bad_alloc) + { + using openvrml::node_type; + return boost::shared_ptr<node_type>( + static_cast<node_type *>( + new externproto_node_type(*this, id, interfaces))); + } + + + externproto_node_type::externproto_node_type( + const openvrml::node_class & c, + const std::string & id, + const openvrml::node_interface_set & interfaces) + throw (std::bad_alloc): + node_type(c, id), + interfaces_(interfaces) + {} + + externproto_node_type::~externproto_node_type() throw () + {} + + /** + * @brief Set the owning pointer to the <code>openvrml::node_class</code>. + * + * The base <code>openvrml::node_type</code> simply holds a reference to + * the <code>openvrml::node_class</code>. If we get an EXTERNPROTO with no + * implementation, we need to store an owning pointer to the + * <code>node_class</code> here. See the comment in + * <code>Vrml97Parser::externproto</code> for details. + */ + void externproto_node_type::set_owning_ptr_to_class( + const boost::shared_ptr<openvrml::node_class> & node_class) throw () + { + this->owning_ptr_to_class_ = node_class; + } + + const openvrml::node_interface_set & + externproto_node_type::do_interfaces() const throw() + { + return this->interfaces_; + } + + const boost::intrusive_ptr<openvrml::node> + externproto_node_type::do_create_node( + const boost::shared_ptr<openvrml::scope> & scope, + const openvrml::initial_value_map & initial_values) const + throw (openvrml::unsupported_interface, std::bad_cast, std::bad_alloc) + { + using openvrml::node; + return boost::intrusive_ptr<node>( + static_cast<node *>( + new externproto_node(*this, scope, initial_values))); + } + + + template <typename FieldValue> + externproto_node::externproto_exposedfield<FieldValue>:: + externproto_exposedfield(externproto_node & node) throw (): + openvrml::node_event_listener(node), + openvrml::event_emitter(static_cast<openvrml::field_value &>(*this)), + proto_eventin<FieldValue>(node), + openvrml::field_value_emitter<FieldValue>( + static_cast<FieldValue &>(*this)) + {} + + template <typename FieldValue> + externproto_node::externproto_exposedfield<FieldValue>:: + ~externproto_exposedfield() throw () + {} + + template <typename FieldValue> + void externproto_node::externproto_exposedfield<FieldValue>:: + do_process_event(const FieldValue & value, const double timestamp) + throw (std::bad_alloc) + { + static_cast<FieldValue &>(*this) = value; + this->proto_eventin<FieldValue>::do_process_event(value, timestamp); + this->node().modified(true); + node::emit_event(*this, timestamp); + } + + template <typename FieldValue> + const std::string + externproto_node::externproto_exposedfield<FieldValue>:: + do_eventout_id() const throw () + { + using boost::polymorphic_downcast; + externproto_node & node = + *polymorphic_downcast<externproto_node *>(&this->node()); + field_map::const_iterator pos = + std::find_if(node.field_map_.begin(), + node.field_map_.end(), + externproto_field_equal_to(*this)); + assert(pos != node.field_map_.end()); + return pos->first; + } + + const boost::shared_ptr<openvrml::field_value> + externproto_node::create_exposedfield(externproto_node & node, + openvrml::field_value::type_id type) + throw (std::bad_alloc) + { + using namespace openvrml; + + boost::shared_ptr<field_value> result; + switch (type) { + case field_value::sfbool_id: + result.reset(new externproto_exposedfield<sfbool>(node)); + break; + case field_value::sfcolor_id: + result.reset(new externproto_exposedfield<sfcolor>(node)); + break; + case field_value::sfdouble_id: + result.reset(new externproto_exposedfield<sfdouble>(node)); + break; + case field_value::sffloat_id: + result.reset(new externproto_exposedfield<sffloat>(node)); + break; + case field_value::sfimage_id: + result.reset(new externproto_exposedfield<sfimage>(node)); + break; + case field_value::sfint32_id: + result.reset(new externproto_exposedfield<sfint32>(node)); + break; + case field_value::sfnode_id: + result.reset(new externproto_exposedfield<sfnode>(node)); + break; + case field_value::sfrotation_id: + result.reset(new externproto_exposedfield<sfrotation>(node)); + break; + case field_value::sfstring_id: + result.reset(new externproto_exposedfield<sfstring>(node)); + break; + case field_value::sftime_id: + result.reset(new externproto_exposedfield<sftime>(node)); + break; + case field_value::sfvec2f_id: + result.reset(new externproto_exposedfield<sfvec2f>(node)); + break; + case field_value::sfvec2d_id: + result.reset(new externproto_exposedfield<sfvec2d>(node)); + break; + case field_value::sfvec3f_id: + result.reset(new externproto_exposedfield<sfvec3f>(node)); + break; + case field_value::sfvec3d_id: + result.reset(new externproto_exposedfield<sfvec3d>(node)); + break; + case field_value::mfcolor_id: + result.reset(new externproto_exposedfield<mfcolor>(node)); + break; + case field_value::mffloat_id: + result.reset(new externproto_exposedfield<mffloat>(node)); + break; + case field_value::mfdouble_id: + result.reset(new externproto_exposedfield<mfdouble>(node)); + break; + case field_value::mfint32_id: + result.reset(new externproto_exposedfield<mfint32>(node)); + break; + case field_value::mfnode_id: + result.reset(new externproto_exposedfield<mfnode>(node)); + break; + case field_value::mfrotation_id: + result.reset(new externproto_exposedfield<mfrotation>(node)); + break; + case field_value::mfstring_id: + result.reset(new externproto_exposedfield<mfstring>(node)); + break; + case field_value::mftime_id: + result.reset(new externproto_exposedfield<mftime>(node)); + break; + case field_value::mfvec2f_id: + result.reset(new externproto_exposedfield<mfvec2f>(node)); + break; + case field_value::mfvec2d_id: + result.reset(new externproto_exposedfield<mfvec2d>(node)); + break; + case field_value::mfvec3f_id: + result.reset(new externproto_exposedfield<mfvec3f>(node)); + break; + case field_value::mfvec3d_id: + result.reset(new externproto_exposedfield<mfvec3d>(node)); + break; + default: + assert(false); + } + assert(result); + return result; + } + + externproto_node::externproto_node( + const externproto_node_type & type, + const boost::shared_ptr<openvrml::scope> & scope, + const openvrml::initial_value_map & initial_values) + throw (std::bad_alloc): + abstract_proto_node(type, scope) + { + using openvrml::node_interface; + using openvrml::node_interface_set; + + for (node_interface_set::const_iterator interface = + type.interfaces().begin(); + interface != type.interfaces().end(); + ++interface) + { + using boost::shared_ptr; + using boost::dynamic_pointer_cast; + + bool succeeded = false; + std::auto_ptr<openvrml::field_value> field_auto_ptr; + shared_ptr<openvrml::event_listener> interface_eventin; + shared_ptr<openvrml::event_emitter> interface_eventout; + shared_ptr<openvrml::field_value> interface_field; + switch (interface->type) { + case node_interface::eventin_id: + succeeded = this->eventin_map + .insert(make_pair(interface->id, + create_eventin(interface->field_type, + *this))) + .second; + break; + case node_interface::eventout_id: + succeeded = this->eventout_map + .insert(make_pair(interface->id, + create_eventout(interface->field_type, + *this))) + .second; + break; + case node_interface::exposedfield_id: + interface_field = create_exposedfield(*this, + interface->field_type); + succeeded = this->field_map_ + .insert(make_pair(interface->id, interface_field)).second; + assert(succeeded); + + interface_eventin = + dynamic_pointer_cast<openvrml::event_listener>( + interface_field); + succeeded = this->eventin_map + .insert(make_pair("set_" + interface->id, + interface_eventin)) + .second; + assert(succeeded); + + interface_eventout = + dynamic_pointer_cast<openvrml::event_emitter>( + interface_eventin); + succeeded = this->eventout_map + .insert(make_pair(interface->id + "_changed", + interface_eventout)) + .second; + break; + case node_interface::field_id: + field_auto_ptr = + openvrml::field_value::create(interface->field_type); + succeeded = this->field_map_ + .insert( + make_pair( + interface->id, + shared_ptr<openvrml::field_value>(field_auto_ptr))) + .second; + break; + case node_interface::invalid_type_id: + assert(false + && "got node_interface::invalid_type_id for " + "interface->type"); + } + assert(succeeded); + } + + // + // Set the initial values. + // + using openvrml::initial_value_map; + for (initial_value_map::const_iterator map_entry = + initial_values.begin(); + map_entry != initial_values.end(); + ++map_entry) { + const field_map::const_iterator pos = + this->field_map_.find(map_entry->first); + if (pos == this->field_map_.end()) { + throw openvrml::unsupported_interface(this->type(), + map_entry->first); + } + pos->second->assign(*map_entry->second); + } + } + + externproto_node::~externproto_node() throw () + {} + + const openvrml::field_value & + externproto_node::do_field(const std::string & id) const + throw (openvrml::unsupported_interface) + { + field_map::const_iterator pos = this->field_map_.find(id); + if (pos == this->field_map_.end()) { + throw openvrml::unsupported_interface( + this->type(), openvrml::node_interface::field_id, id); + } + assert(pos->second); + return *pos->second; + } + + openvrml::event_listener & + externproto_node::do_event_listener(const std::string & id) + throw (openvrml::unsupported_interface) + { + eventin_map_t::const_iterator pos = this->eventin_map.find(id); + if (pos == this->eventin_map.end()) { + throw openvrml::unsupported_interface( + this->type(), openvrml::node_interface::eventin_id, id); + } + assert(pos->second); + return *pos->second; + } + + openvrml::event_emitter & + externproto_node::do_event_emitter(const std::string & id) + throw (openvrml::unsupported_interface) + { + eventout_map_t::const_iterator pos = this->eventout_map.find(id); + if (pos == this->eventout_map.end()) { + throw openvrml::unsupported_interface( + this->type(), openvrml::node_interface::eventout_id, id); + } + assert(pos->second); + return *pos->second; + } + } // namespace + + // Max time in seconds between updates. Make this user // setable to balance performance with cpu usage. |
From: Braden M. <br...@us...> - 2005-11-27 05:30:28
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19538 Modified Files: ChangeLog Log Message: Moved implementations of member functions for externproto_node_class, externproto_node_type, and externproto_node after Vrml97Parser and X3DVrmlParser have been included. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1048 retrieving revision 1.1049 diff -C2 -d -r1.1048 -r1.1049 *** ChangeLog 27 Nov 2005 04:39:30 -0000 1.1048 --- ChangeLog 27 Nov 2005 05:30:21 -0000 1.1049 *************** *** 1,4 **** --- 1,11 ---- 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp: Moved implementations of + member functions for externproto_node_class, + externproto_node_type, and externproto_node after Vrml97Parser and + X3DVrmlParser have been included. + + 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp (openvrml::proto_node::create_exposedfield): Take a proto_node as |
From: Braden M. <br...@us...> - 2005-11-27 04:42:59
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10303 Modified Files: ChangeLog Log Message: Moved openvrml::abstract_proto_node::proto_exposedfield to openvrml::proto_node::proto_exposedfield. externproto_node doesn't need this. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1046 retrieving revision 1.1047 diff -C2 -d -r1.1046 -r1.1047 *** ChangeLog 27 Nov 2005 04:06:41 -0000 1.1046 --- ChangeLog 27 Nov 2005 04:26:05 -0000 1.1047 *************** *** 1,4 **** --- 1,11 ---- 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp: Moved + openvrml::abstract_proto_node::proto_exposedfield to + openvrml::proto_node::proto_exposedfield. externproto_node + doesn't need this. + + 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp: Doc-comment fixes. |
From: Braden M. <br...@us...> - 2005-11-27 04:42:59
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10303/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Moved openvrml::abstract_proto_node::proto_exposedfield to openvrml::proto_node::proto_exposedfield. externproto_node doesn't need this. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** browser.cpp 27 Nov 2005 04:06:41 -0000 1.100 --- browser.cpp 27 Nov 2005 04:26:06 -0000 1.101 *************** *** 256,278 **** throw (std::bad_alloc); - template <typename FieldValue> - class proto_exposedfield : public proto_eventin<FieldValue>, - public proto_eventout<FieldValue> { - public: - proto_exposedfield(abstract_proto_node & node, - const FieldValue & initial_value); - virtual ~proto_exposedfield() throw (); - - private: - virtual void do_process_event(const FieldValue & value, - double timestamp) - throw (std::bad_alloc); - }; - - static boost::shared_ptr<openvrml::event_listener> - create_exposedfield(const field_value & initial_value, - abstract_proto_node & node) - throw (std::bad_alloc); - typedef boost::shared_ptr<openvrml::event_listener> eventin_ptr; typedef std::map<std::string, eventin_ptr> eventin_map_t; --- 256,259 ---- *************** *** 369,372 **** --- 350,372 ---- */ class OPENVRML_LOCAL proto_node : public abstract_proto_node { + template <typename FieldValue> + class proto_exposedfield : public proto_eventin<FieldValue>, + public proto_eventout<FieldValue> { + public: + proto_exposedfield(abstract_proto_node & node, + const FieldValue & initial_value); + virtual ~proto_exposedfield() throw (); + + private: + virtual void do_process_event(const FieldValue & value, + double timestamp) + throw (std::bad_alloc); + }; + + static boost::shared_ptr<openvrml::event_listener> + create_exposedfield(const field_value & initial_value, + abstract_proto_node & node) + throw (std::bad_alloc); + boost::shared_ptr<openvrml::scope> proto_scope; std::vector<boost::intrusive_ptr<node> > impl_nodes; *************** *** 1834,1838 **** */ template <typename FieldValue> ! abstract_proto_node::proto_exposedfield<FieldValue>:: proto_exposedfield(abstract_proto_node & node, const FieldValue & initial_value): --- 1834,1838 ---- */ template <typename FieldValue> ! proto_node::proto_exposedfield<FieldValue>:: proto_exposedfield(abstract_proto_node & node, const FieldValue & initial_value): *************** *** 1847,1851 **** */ template <typename FieldValue> ! abstract_proto_node::proto_exposedfield<FieldValue>::~proto_exposedfield() throw () {} --- 1847,1851 ---- */ template <typename FieldValue> ! proto_node::proto_exposedfield<FieldValue>::~proto_exposedfield() throw () {} *************** *** 1861,1865 **** template <typename FieldValue> void ! abstract_proto_node::proto_exposedfield<FieldValue>:: do_process_event(const FieldValue & value, const double timestamp) throw (std::bad_alloc) --- 1861,1865 ---- template <typename FieldValue> void ! proto_node::proto_exposedfield<FieldValue>:: do_process_event(const FieldValue & value, const double timestamp) throw (std::bad_alloc) *************** *** 1882,1886 **** */ boost::shared_ptr<event_listener> ! abstract_proto_node::create_exposedfield(const field_value & initial_value, abstract_proto_node & node) throw (std::bad_alloc) --- 1882,1886 ---- */ boost::shared_ptr<event_listener> ! proto_node::create_exposedfield(const field_value & initial_value, abstract_proto_node & node) throw (std::bad_alloc) |
From: Braden M. <br...@us...> - 2005-11-27 04:39:38
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051 Modified Files: ChangeLog Log Message: Take a proto_node as an argument rather than an abstract_proto_node. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1047 retrieving revision 1.1048 diff -C2 -d -r1.1047 -r1.1048 *** ChangeLog 27 Nov 2005 04:26:05 -0000 1.1047 --- ChangeLog 27 Nov 2005 04:39:30 -0000 1.1048 *************** *** 1,4 **** --- 1,10 ---- 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp + (openvrml::proto_node::create_exposedfield): Take a proto_node as + an argument rather than an abstract_proto_node. + + 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp: Moved openvrml::abstract_proto_node::proto_exposedfield to |
From: Braden M. <br...@us...> - 2005-11-27 04:39:38
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Take a proto_node as an argument rather than an abstract_proto_node. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** browser.cpp 27 Nov 2005 04:26:06 -0000 1.101 --- browser.cpp 27 Nov 2005 04:39:30 -0000 1.102 *************** *** 366,370 **** static boost::shared_ptr<openvrml::event_listener> create_exposedfield(const field_value & initial_value, ! abstract_proto_node & node) throw (std::bad_alloc); --- 366,370 ---- static boost::shared_ptr<openvrml::event_listener> create_exposedfield(const field_value & initial_value, ! proto_node & node) throw (std::bad_alloc); *************** *** 1883,1887 **** boost::shared_ptr<event_listener> proto_node::create_exposedfield(const field_value & initial_value, ! abstract_proto_node & node) throw (std::bad_alloc) { --- 1883,1887 ---- boost::shared_ptr<event_listener> proto_node::create_exposedfield(const field_value & initial_value, ! proto_node & node) throw (std::bad_alloc) { |
From: Braden M. <br...@us...> - 2005-11-27 04:06:54
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2293/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Doc-comment fixes. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** browser.cpp 27 Nov 2005 03:29:37 -0000 1.99 --- browser.cpp 27 Nov 2005 04:06:41 -0000 1.100 *************** *** 341,349 **** * * Like a typical node implementation, <code>proto_node</code>s have a ! * many-to-one relationship with the ! * <code>proto_node::proto_node_type</code> instance that creates them. And ! * <code>proto_node::proto_node_type</code> has, in turn, a many-to-one ! * relationship with the <code>proto_node_class</code> instance that ! * creates them. Unlike a typical node implementation, there will very * likely be more than one <code>proto_node_class</code> instance known to * the <code>browser</code> instance; there will be one for each --- 341,348 ---- * * Like a typical node implementation, <code>proto_node</code>s have a ! * many-to-one relationship with the <code>proto_node_type</code> instance ! * that creates them. And <code>proto_node_type</code> has, in turn, a ! * many-to-one relationship with the <code>proto_node_class</code> instance ! * that creates them. Unlike a typical node implementation, there will very * likely be more than one <code>proto_node_class</code> instance known to * the <code>browser</code> instance; there will be one for each *************** *** 351,365 **** * * As the <code>proto_node_class</code> encodes the data in a ! * <code>PROTO</code>, the <code>proto_node::proto_node_type</code> can ! * be seen as modeling <code>EXTERNPROTO</code>. Each ! * <code>EXTERNPROTO</code> will spawn a new ! * <code>proto_node::proto_node_type</code> from the * <code>proto_node_class</code> that corresponds to the <code>PROTO</code> * to which the <code>EXTERNPROTO</code> refers. Recall that an ! * <code>EXTERNPROTO</code> provides a subset of the interfaces defined ! * for a <code>PROTO</code>; thus, for a <code>PROTO</code> with ! * <var>n</var> interfaces, there are <var>n</var>! possible unique ! * <code>EXTERNPROTO</code>s (and thus unique ! * <code>proto_node::proto_node_type</code> instances). * * Structurally, the implementation of <code>proto_node</code> is very --- 350,363 ---- * * As the <code>proto_node_class</code> encodes the data in a ! * <code>PROTO</code>, the <code>proto_node_type</code> can be seen as ! * modeling <code>EXTERNPROTO</code>. Each <code>EXTERNPROTO</code> will ! * spawn a new <code>proto_node_type</code> from the * <code>proto_node_class</code> that corresponds to the <code>PROTO</code> * to which the <code>EXTERNPROTO</code> refers. Recall that an ! * <code>EXTERNPROTO</code> provides a subset of the interfaces defined for ! * a <code>PROTO</code>; thus, for a <code>PROTO</code> with <var>n</var> ! * interfaces, there are <var>n</var>! possible unique ! * <code>EXTERNPROTO</code>s (and thus unique <code>proto_node_type</code> ! * instances). * * Structurally, the implementation of <code>proto_node</code> is very *************** *** 997,1001 **** * @internal * ! * @class proto_node::proto_eventin * * @brief PROTO eventIn handler class template. --- 995,999 ---- * @internal * ! * @class abstract_proto_node::proto_eventin * * @brief PROTO eventIn handler class template. *************** *** 1003,1007 **** /** ! * @typedef proto_node::proto_eventin::listeners * * @brief Set of event listeners. --- 1001,1005 ---- /** ! * @typedef abstract_proto_node::proto_eventin::listeners * * @brief Set of event listeners. *************** *** 1009,1013 **** /** ! * @var proto_node::proto_eventin::listeners proto_node::proto_eventin::listeners_ * * @brief Set of event listeners to which events are delegated for --- 1007,1011 ---- /** ! * @var abstract_proto_node::proto_eventin::listeners proto_node::proto_eventin::listeners_ * * @brief Set of event listeners to which events are delegated for *************** *** 1016,1020 **** /** ! * @typedef proto_node::proto_eventin::field_value_type * * @brief Field value type. --- 1014,1018 ---- /** ! * @typedef abstract_proto_node::proto_eventin::field_value_type * * @brief Field value type. *************** *** 1022,1026 **** /** ! * @typedef proto_node::proto_eventin::event_listener_type * * @brief Type of event listeners to which the instance delegates. --- 1020,1024 ---- /** ! * @typedef abstract_proto_node::proto_eventin::event_listener_type * * @brief Type of event listeners to which the instance delegates. *************** *** 1030,1034 **** * @brief Construct. * ! * @param node proto_node. */ template <typename FieldValue> --- 1028,1032 ---- * @brief Construct. * ! * @param node abstract_proto_node. */ template <typename FieldValue> *************** *** 1069,1072 **** --- 1067,1075 ---- } + /** + * @brief The name of the associated eventIn. + * + * @return the name of the associated eventIn. + */ template <typename FieldValue> const std::string *************** *** 1108,1112 **** * @param node proto_node. * ! * @return a boost::shared_ptr to a proto_eventout<FieldValue> instance. * * @exception std::bad_alloc if memory allocation fails. --- 1111,1115 ---- * @param node proto_node. * ! * @return a boost::shared_ptr to a proto_eventin<FieldValue> instance. * * @exception std::bad_alloc if memory allocation fails. *************** *** 1203,1216 **** /** ! * @brief Create an IS mapping between an event_listener in the PROTO ! * implementation and an event_listener in the PROTO interface. * * @param field_type field value type of the concrete listeners. ! * @param impl_eventin event_listener of a node in the PROTO * implementation. ! * @param interface_eventin event_listener from the PROTO interface. * ! * @return @c true if the IS mapping is established successfully; @c false ! * otherwise (i.e., if the mapping already exists). * * @exception std::bad_alloc if memory allocation fails. --- 1206,1220 ---- /** ! * @brief Create an @c IS mapping between an @c event_listener in the ! * @c PROTO implementation and an @c event_listener in the @c PROTO ! * interface. * * @param field_type field value type of the concrete listeners. ! * @param impl_eventin @c event_listener of a node in the @c PROTO * implementation. ! * @param interface_eventin @c event_listener from the @c PROTO interface. * ! * @return @c true if the @c IS mapping is established successfully; ! * @c false otherwise (i.e., if the mapping already exists). * * @exception std::bad_alloc if memory allocation fails. *************** *** 1374,1378 **** * @internal * ! * @class proto_node::proto_eventout::listener_t * * @brief Listens for events emitted from nodes in the PROTO implementation --- 1378,1382 ---- * @internal * ! * @class abstract_proto_node::proto_eventout::listener_t * * @brief Listens for events emitted from nodes in the PROTO implementation *************** *** 1381,1385 **** /** ! * @var proto_node::proto_eventout & proto_node::proto_eventout::listener_t::emitter * * @brief Reference to the outer proto_eventout class. --- 1385,1389 ---- /** ! * @var abstract_proto_node::proto_eventout & abstract_proto_node::proto_eventout::listener_t::emitter * * @brief Reference to the outer proto_eventout class. *************** *** 1392,1402 **** /** ! * @var proto_node & proto_node::proto_eventout::listener_t::node * ! * @brief Reference to the proto_node instance. */ /** ! * @var FieldValue proto_node::proto_eventout::listener_t::value * * @brief The value of the most recently emitted event. --- 1396,1406 ---- /** ! * @var abstract_proto_node & abstract_proto_node::proto_eventout::listener_t::node * ! * @brief Reference to the @c abstract_proto_node instance. */ /** ! * @var FieldValue abstract_proto_node::proto_eventout::listener_t::value * * @brief The value of the most recently emitted event. *************** *** 1406,1411 **** * @brief Construct. * ! * @param emitter proto_eventout. ! * @param node proto_node. * @param initial_value initial value (used for exposedFields). */ --- 1410,1415 ---- * @brief Construct. * ! * @param emitter @c proto_eventout. ! * @param node @c abstract_proto_node. * @param initial_value initial value (used for exposedFields). */ *************** *** 1463,1474 **** /** ! * @var proto_node::proto_eventout::listener_t proto_node::proto_eventout::listener * ! * @brief Listens for events emitted from nodes in the PROTO implementation ! * in order to propagate them out of the PROTO instance. */ /** ! * @typedef proto_node::proto_eventout<FieldValue>::field_value_type * * @brief Field value type. --- 1467,1479 ---- /** ! * @var abstract_proto_node::proto_eventout::listener_t proto_node::proto_eventout::listener * ! * @brief Listens for events emitted from nodes in the @c PROTO ! * implementation in order to propagate them out of the @c PROTO ! * instance. */ /** ! * @typedef abstract_proto_node::proto_eventout<FieldValue>::field_value_type * * @brief Field value type. *************** *** 1476,1480 **** /** ! * @typedef proto_node::proto_eventout<FieldValue>::event_emitter_type * * @brief Event emitter type. --- 1481,1485 ---- /** ! * @typedef abstract_proto_node::proto_eventout<FieldValue>::event_emitter_type * * @brief Event emitter type. *************** *** 1482,1486 **** /** ! * @typedef proto_node::proto_eventout<FieldValue>::event_listener_type * * @brief Event listener type. --- 1487,1491 ---- /** ! * @typedef abstract_proto_node::proto_eventout<FieldValue>::event_listener_type * * @brief Event listener type. *************** *** 1490,1496 **** * @brief Construct. * ! * @param node proto_node. * @param initial_value initial value. This is used by ! * proto_exposedfield<FieldValue> */ template <typename FieldValue> --- 1495,1501 ---- * @brief Construct. * ! * @param node @c abstract_proto_node. * @param initial_value initial value. This is used by ! * @c proto_exposedfield<FieldValue> */ template <typename FieldValue> *************** *** 1511,1520 **** /** ! * @brief Create an IS mapping. * ! * @param emitter the event_emitter from a node in the PROTO * implementation. * ! * @return @c true if the IS mapping is created successfully; @c false * otherwise (i.e., if it already exists). * --- 1516,1525 ---- /** ! * @brief Create an @c IS mapping. * ! * @param emitter the @c event_emitter from a node in the @c PROTO * implementation. * ! * @return @c true if the @c IS mapping is created successfully; @c false * otherwise (i.e., if it already exists). * *************** *** 1529,1532 **** --- 1534,1542 ---- } + /** + * @brief The name of the associated eventOut. + * + * @return the name of the associated eventOut. + */ template <typename FieldValue> const std::string *************** *** 1543,1552 **** /** ! * @brief Factory function for proto_eventout<FieldValue> instances. * ! * @param type field_value::type_id. ! * @param node proto_node. * ! * @return a boost::shared_ptr to a proto_eventout<FieldValue> instance. * * @exception std::bad_alloc if memory allocation fails. --- 1553,1563 ---- /** ! * @brief Factory function for @c proto_eventout<FieldValue> instances. * ! * @param type @c field_value::type_id. ! * @param node @c abstract_proto_node. * ! * @return a @c boost::shared_ptr to a @c proto_eventout<FieldValue> ! * instance. * * @exception std::bad_alloc if memory allocation fails. *************** *** 1646,1659 **** /** ! * @brief Create an IS mapping between an event_emitter in the PROTO ! * implementation and an event_emitter in the PROTO interface. * * @param field_type field value type of the concrete emitters. ! * @param impl_eventout event_emitter of a node in the PROTO * implementation. ! * @param interface_eventout event_emitter from the PROTO interface. * ! * @return @c true if the IS mapping is established successfully; @c false ! * otherwise (i.e., if the mapping already exists). * * @exception std::bad_alloc if memory allocation fails. --- 1657,1672 ---- /** ! * @brief Create an @c IS mapping between an @c event_emitter in the ! * @c PROTO implementation and an @c event_emitter in the @c PROTO ! * interface. * * @param field_type field value type of the concrete emitters. ! * @param impl_eventout @c event_emitter of a node in the @c PROTO * implementation. ! * @param interface_eventout @c event_emitter from the @c PROTO ! * interface. * ! * @return @c true if the @c IS mapping is established successfully; ! * @c false otherwise (i.e., if the mapping already exists). * * @exception std::bad_alloc if memory allocation fails. |
From: Braden M. <br...@us...> - 2005-11-27 04:06:54
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2293 Modified Files: ChangeLog Log Message: Doc-comment fixes. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1045 retrieving revision 1.1046 diff -C2 -d -r1.1045 -r1.1046 *** ChangeLog 27 Nov 2005 03:29:37 -0000 1.1045 --- ChangeLog 27 Nov 2005 04:06:41 -0000 1.1046 *************** *** 1,4 **** --- 1,8 ---- 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp: Doc-comment fixes. + + 2005-11-26 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp: Moved ::proto_node_class::proto_node_type to ::proto_node_type. |