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...> - 2006-05-18 07:10:01
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25809/src/libopenvrml/openvrml Modified Files: script.cpp Log Message: Implemented Browser.createVrmlFromURL() in the Script node JavaScript binding. Index: script.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/script.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** script.cpp 18 May 2006 04:11:31 -0000 1.73 --- script.cpp 18 May 2006 07:09:57 -0000 1.74 *************** *** 2013,2027 **** namespace Browser { ! OPENVRML_LOCAL JSBool addRoute(JSContext * cx, ! JSObject * obj, ! uintN argc, ! jsval * argv, ! jsval * rval) OPENVRML_NOTHROW; ! OPENVRML_LOCAL JSBool deleteRoute(JSContext * cx, ! JSObject * obj, ! uintN argc, ! jsval * argv, ! jsval * rval) OPENVRML_NOTHROW; } --- 2013,2025 ---- namespace Browser { ! OPENVRML_LOCAL JSBool createVrmlFromURL(JSContext * cx, JSObject * obj, ! uintN argc, jsval * argv, ! jsval * rval) OPENVRML_NOTHROW; ! OPENVRML_LOCAL JSBool addRoute(JSContext * cx, JSObject * obj, ! uintN argc, jsval * argv, jsval * rval) ! OPENVRML_NOTHROW; ! OPENVRML_LOCAL JSBool deleteRoute(JSContext * cx, JSObject * obj, ! uintN argc, jsval * argv, jsval * rval) OPENVRML_NOTHROW; } *************** *** 2031,2034 **** --- 2029,2036 ---- friend class SFNode; friend class MFNode; + friend JSBool Browser::createVrmlFromURL(JSContext * cx, JSObject * obj, + uintN argc, jsval * argv, + jsval * rval) + OPENVRML_NOTHROW; friend JSBool Browser::addRoute(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval) *************** *** 4379,4447 **** // createVrmlFromURL( MFString url, SFNode node, SFString event ) ! JSBool createVrmlFromURL(JSContext *, ! JSObject *, ! uintN, ! jsval *, ! jsval *) OPENVRML_NOTHROW { - # if 0 using std::auto_ptr; ! assert(JS_GetContextPrivate(cx)); ! js_::script & script = ! *static_cast<js_::script *>(JS_GetContextPrivate(cx)); ! ! Doc2 * relative = script.script_node().type.node_class.browser.urlDoc(); ! ! // ! // Make sure our first argument (the URL) is an MFString. ! // ! JSObject * arg0_obj; ! if (!JS_ValueToObject(cx, argv[0], &arg0_obj)) { return JS_FALSE; } ! if (!JS_InstanceOf(cx, arg0_obj, &MFString::jsclass, argv)) { return JS_FALSE; } ! auto_ptr<openvrml::mfstring> ! url(MFString::createFromJSObject(cx, arg0_obj)); assert(url.get()); - // - // Make sure our second arument is an SFNode. - // js_::script & script = *static_cast<js_::script *>(JS_GetContextPrivate(cx)); JSClass & sfnode_jsclass = script.sfnode_class; ! ! JSObject * arg1_obj; ! if (!JS_ValueToObject(cx, argv[1], &arg1_obj)) { return JS_FALSE; } ! if (!JS_InstanceOf(cx, arg1_obj, &sfnode_jsclass, argv)) { return JS_FALSE; } ! auto_ptr<openvrml::sfnode> ! sfnode(SFNode::createFromJSObject(cx, arg1_obj)); ! assert(sfnode.get()); ! node_ptr node(sfnode->get()); ! if (!node) { return JS_FALSE; } ! ! // ! // Make sure our third argument is a string. ! // ! JSString * arg2_str = JS_ValueToString(cx, argv[2]); ! if (!arg2_str) { return JS_FALSE; } ! ! const char * const eventInId = JS_GetStringBytes(arg2_str); ! openvrml::browser & browser = ! script.script_node().type.node_class.browser; ! auto_ptr<openvrml::mfnode> kids(browser.readWrl(*url, relative)); ! ! if (!kids.get()) { return JS_FALSE; } ! node->processEvent(eventInId, *kids, s_timeStamp); // fix me... *rval = JSVAL_VOID; - # endif return JS_TRUE; } --- 4381,4436 ---- // createVrmlFromURL( MFString url, SFNode node, SFString event ) ! JSBool createVrmlFromURL(JSContext * const cx, ! JSObject * const obj, ! const uintN argc, ! jsval * const argv, ! jsval * const rval) OPENVRML_NOTHROW { using std::auto_ptr; ! JSObject * url_obj = 0, * node_obj = 0; ! JSString * event_str = 0; ! if (!JS_ConvertArguments(cx, argc, argv, "ooS", ! &url_obj, &node_obj, &event_str)) { return JS_FALSE; } ! if (!JS_InstanceOf(cx, url_obj, &MFString::jsclass, argv)) { ! return JS_FALSE; ! } ! auto_ptr<openvrml::mfstring> url(MFString::createFromJSObject(cx, ! url_obj)); assert(url.get()); js_::script & script = *static_cast<js_::script *>(JS_GetContextPrivate(cx)); JSClass & sfnode_jsclass = script.sfnode_class; ! if (!JS_InstanceOf(cx, node_obj, &sfnode_jsclass, argv)) { ! return JS_FALSE; ! } ! auto_ptr<openvrml::sfnode> node(SFNode::createFromJSObject(cx, node_obj)); ! assert(node.get()); ! if (!node->value()) { ! JS_ReportError(cx, "node argument is NULL"); return JS_FALSE; } ! const char * const event = JS_GetStringBytes(event_str); ! try { ! script.script_node().openvrml::node::type().metatype().browser() ! .create_vrml_from_url(url->value(), ! node->value(), ! event ? event : ""); ! } catch (const std::bad_cast & ex) { ! JS_ReportError(cx, "%s is not of type MFNode", event); ! return JS_FALSE; ! } catch (std::exception & ex) { ! JS_ReportError(cx, ex.what()); ! return JS_FALSE; ! } *rval = JSVAL_VOID; return JS_TRUE; } |
From: Braden M. <br...@us...> - 2006-05-18 07:10:00
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25809 Modified Files: ChangeLog Log Message: Implemented Browser.createVrmlFromURL() in the Script node JavaScript binding. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1249 retrieving revision 1.1250 diff -C2 -d -r1.1249 -r1.1250 *** ChangeLog 18 May 2006 04:11:30 -0000 1.1249 --- ChangeLog 18 May 2006 07:09:57 -0000 1.1250 *************** *** 1,4 **** --- 1,16 ---- 2006-05-18 Braden McDaniel <br...@en...> + Implemented Browser.createVrmlFromURL() in the Script node + JavaScript binding. + + * src/libopenvrml/openvrml/script.cpp + (js_::script): Granted friendship to + js_::Browser::createVrmlFromUrl. + (js_::Browser::createVrmlFromURL(JSContext *, JSObject *, uintN, + jsval *, jsval *)): Delegate to + openvrml::browser::create_vrml_from_url. + + 2006-05-18 Braden McDaniel <br...@en...> + Renamed "node_class" to "node_metatype". |
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27658/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g browser.cpp browser.h node.cpp node.h node_impl_util.cpp node_impl_util.h script.cpp script.h vrml97node.cpp vrml97node.h x3d_cad_geometry.cpp x3d_cad_geometry.h x3d_core.cpp x3d_core.h x3d_dis.cpp x3d_dis.h x3d_environmental_effects.cpp x3d_environmental_effects.h x3d_event_utilities.cpp x3d_event_utilities.h x3d_geometry2d.cpp x3d_geometry2d.h x3d_geospatial.cpp x3d_geospatial.h x3d_grouping.cpp x3d_grouping.h x3d_hanim.cpp x3d_hanim.h x3d_interpolation.cpp x3d_interpolation.h x3d_key_device_sensor.cpp x3d_key_device_sensor.h x3d_networking.cpp x3d_networking.h x3d_nurbs.cpp x3d_nurbs.h x3d_rendering.cpp x3d_rendering.h x3d_shape.cpp x3d_shape.h x3d_texturing.cpp x3d_texturing.h Log Message: Renamed "node_class" to "node_metatype". Index: x3d_grouping.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_grouping.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_grouping.cpp 20 Apr 2006 05:24:11 -0000 1.1 --- x3d_grouping.cpp 18 May 2006 04:11:31 -0000 1.2 *************** *** 39,48 **** * @brief Class object for StaticGroup nodes. */ ! class OPENVRML_LOCAL static_group_class : public node_class { public: static const char * const id; ! explicit static_group_class(openvrml::browser & browser); ! virtual ~static_group_class() OPENVRML_NOTHROW; private: --- 39,48 ---- * @brief Class object for StaticGroup nodes. */ ! class OPENVRML_LOCAL static_group_metatype : public node_metatype { public: static const char * const id; ! explicit static_group_metatype(openvrml::browser & browser); ! virtual ~static_group_metatype() OPENVRML_NOTHROW; private: *************** *** 54,63 **** } ! void register_grouping_node_classes(openvrml::browser & b) { using boost::shared_ptr; ! using openvrml::node_class; ! b.add_node_class(static_group_class::id, ! shared_ptr<node_class>(new static_group_class(b))); } --- 54,64 ---- } ! void register_grouping_node_metatypes(openvrml::browser & b) { using boost::shared_ptr; ! using openvrml::node_metatype; ! b.add_node_metatype(static_group_metatype::id, ! shared_ptr<node_metatype>( ! new static_group_metatype(b))); } *************** *** 69,73 **** public grouping_node { ! friend class static_group_class; mfnode children_; --- 70,74 ---- public grouping_node { ! friend class static_group_metatype; mfnode children_; *************** *** 102,108 **** /** ! * @brief @c node_class identifier. */ ! const char * const static_group_class::id = "urn:X-openvrml:node:StaticGroup"; --- 103,109 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const static_group_metatype::id = "urn:X-openvrml:node:StaticGroup"; *************** *** 110,117 **** * @brief Construct. * ! * @param browser the browser associated with this static_group_class. */ ! static_group_class::static_group_class(openvrml::browser & browser): ! node_class(static_group_class::id, browser) {} --- 111,118 ---- * @brief Construct. * ! * @param browser the browser associated with this static_group_metatype. */ ! static_group_metatype::static_group_metatype(openvrml::browser & browser): ! node_metatype(static_group_metatype::id, browser) {} *************** *** 119,123 **** * @brief Destroy. */ ! static_group_class::~static_group_class() OPENVRML_NOTHROW {} --- 120,124 ---- * @brief Destroy. */ ! static_group_metatype::~static_group_metatype() OPENVRML_NOTHROW {} *************** *** 131,139 **** * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by static_group_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! static_group_class::do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) --- 132,140 ---- * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by static_group_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! static_group_metatype::do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) *************** *** 215,219 **** /** ! * @var static_group_node::StaticGroup_class * * @brief Class object for StaticGroup nodes. --- 216,220 ---- /** ! * @var static_group_node::static_group_metatype * * @brief Class object for StaticGroup nodes. Index: x3d_hanim.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_hanim.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** x3d_hanim.cpp 16 Apr 2006 08:22:19 -0000 1.2 --- x3d_hanim.cpp 18 May 2006 04:11:31 -0000 1.3 *************** *** 39,48 **** * @brief Class object for HAnimDisplacer nodes. */ ! class OPENVRML_LOCAL hanim_displacer_class : public node_class { public: static const char * const id; ! explicit hanim_displacer_class(openvrml::browser & browser); ! virtual ~hanim_displacer_class() OPENVRML_NOTHROW; private: --- 39,48 ---- * @brief Class object for HAnimDisplacer nodes. */ ! class OPENVRML_LOCAL hanim_displacer_metatype : public node_metatype { public: static const char * const id; ! explicit hanim_displacer_metatype(openvrml::browser & browser); ! virtual ~hanim_displacer_metatype() OPENVRML_NOTHROW; private: *************** *** 57,66 **** * @brief Class object for HAnimHumanoid nodes. */ ! class OPENVRML_LOCAL hanim_humanoid_class : public node_class { public: static const char * const id; ! explicit hanim_humanoid_class(openvrml::browser & browser); ! virtual ~hanim_humanoid_class() OPENVRML_NOTHROW; private: --- 57,66 ---- * @brief Class object for HAnimHumanoid nodes. */ ! class OPENVRML_LOCAL hanim_humanoid_metatype : public node_metatype { public: static const char * const id; ! explicit hanim_humanoid_metatype(openvrml::browser & browser); ! virtual ~hanim_humanoid_metatype() OPENVRML_NOTHROW; private: *************** *** 75,84 **** * @brief Class object for HAnimJoint nodes. */ ! class OPENVRML_LOCAL hanim_joint_class : public node_class { public: static const char * const id; ! explicit hanim_joint_class(openvrml::browser & browser); ! virtual ~hanim_joint_class() OPENVRML_NOTHROW; private: --- 75,84 ---- * @brief Class object for HAnimJoint nodes. */ ! class OPENVRML_LOCAL hanim_joint_metatype : public node_metatype { public: static const char * const id; ! explicit hanim_joint_metatype(openvrml::browser & browser); ! virtual ~hanim_joint_metatype() OPENVRML_NOTHROW; private: *************** *** 93,102 **** * @brief Class object for HAnimSegment nodes. */ ! class OPENVRML_LOCAL hanim_segment_class : public node_class { public: static const char * const id; ! explicit hanim_segment_class(openvrml::browser & browser); ! virtual ~hanim_segment_class() OPENVRML_NOTHROW; private: --- 93,102 ---- * @brief Class object for HAnimSegment nodes. */ ! class OPENVRML_LOCAL hanim_segment_metatype : public node_metatype { public: static const char * const id; ! explicit hanim_segment_metatype(openvrml::browser & browser); ! virtual ~hanim_segment_metatype() OPENVRML_NOTHROW; private: *************** *** 111,120 **** * @brief Class object for HAnimSite nodes. */ ! class OPENVRML_LOCAL hanim_site_class : public node_class { public: static const char * const id; ! explicit hanim_site_class(openvrml::browser & browser); ! virtual ~hanim_site_class() OPENVRML_NOTHROW; private: --- 111,120 ---- * @brief Class object for HAnimSite nodes. */ ! class OPENVRML_LOCAL hanim_site_metatype : public node_metatype { public: static const char * const id; ! explicit hanim_site_metatype(openvrml::browser & browser); ! virtual ~hanim_site_metatype() OPENVRML_NOTHROW; private: *************** *** 126,143 **** } ! void register_hanim_node_classes(openvrml::browser & b) { using boost::shared_ptr; ! using openvrml::node_class; ! b.add_node_class(hanim_displacer_class::id, ! shared_ptr<node_class>(new hanim_displacer_class(b))); ! b.add_node_class(hanim_humanoid_class::id, ! shared_ptr<node_class>(new hanim_humanoid_class(b))); ! b.add_node_class(hanim_joint_class::id, ! shared_ptr<node_class>(new hanim_joint_class(b))); ! b.add_node_class(hanim_segment_class::id, ! shared_ptr<node_class>(new hanim_segment_class(b))); ! b.add_node_class(hanim_site_class::id, ! shared_ptr<node_class>(new hanim_site_class(b))); } --- 126,147 ---- } ! void register_hanim_node_metatypes(openvrml::browser & b) { using boost::shared_ptr; ! using openvrml::node_metatype; ! b.add_node_metatype(hanim_displacer_metatype::id, ! shared_ptr<node_metatype>( ! new hanim_displacer_metatype(b))); ! b.add_node_metatype(hanim_humanoid_metatype::id, ! shared_ptr<node_metatype>( ! new hanim_humanoid_metatype(b))); ! b.add_node_metatype(hanim_joint_metatype::id, ! shared_ptr<node_metatype>( ! new hanim_joint_metatype(b))); ! b.add_node_metatype(hanim_segment_metatype::id, ! shared_ptr<node_metatype>( ! new hanim_segment_metatype(b))); ! b.add_node_metatype(hanim_site_metatype::id, ! shared_ptr<node_metatype>(new hanim_site_metatype(b))); } *************** *** 148,152 **** public abstract_node<hanim_displacer_node> { ! friend class hanim_displacer_class; exposedfield<mfint32> coord_index_; --- 152,156 ---- public abstract_node<hanim_displacer_node> { ! friend class hanim_displacer_metatype; exposedfield<mfint32> coord_index_; *************** *** 165,169 **** public child_node { ! friend class hanim_humanoid_class; exposedfield<sfvec3f> center_; --- 169,173 ---- public child_node { ! friend class hanim_humanoid_metatype; exposedfield<sfvec3f> center_; *************** *** 196,200 **** public child_node { ! friend class hanim_joint_class; class add_children_listener : public event_listener_base<self_t>, --- 200,204 ---- public child_node { ! friend class hanim_joint_metatype; class add_children_listener : public event_listener_base<self_t>, *************** *** 251,255 **** public child_node { ! friend class hanim_segment_class; class add_children_listener : public event_listener_base<self_t>, --- 255,259 ---- public child_node { ! friend class hanim_segment_metatype; class add_children_listener : public event_listener_base<self_t>, *************** *** 299,308 **** public child_node { ! friend class hanim_site_class; ! class add_children_listener : ! public event_listener_base<self_t>, ! public mfnode_listener ! { public: explicit add_children_listener(self_t & node); --- 303,310 ---- public child_node { ! friend class hanim_site_metatype; ! class add_children_listener : public event_listener_base<self_t>, ! public mfnode_listener { public: explicit add_children_listener(self_t & node); *************** *** 347,353 **** /** ! * @brief @c node_class identifier. */ ! const char * const hanim_displacer_class::id = "urn:X-openvrml:node:HAnimDisplacer"; --- 349,355 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const hanim_displacer_metatype::id = "urn:X-openvrml:node:HAnimDisplacer"; *************** *** 356,363 **** * * @param browser the @c browser associated with this ! * @c hanim_displacer_class. */ ! hanim_displacer_class::hanim_displacer_class(openvrml::browser & browser): ! node_class(hanim_displacer_class::id, browser) {} --- 358,365 ---- * * @param browser the @c browser associated with this ! * @c hanim_displacer_metatype. */ ! hanim_displacer_metatype::hanim_displacer_metatype(openvrml::browser & browser): ! node_metatype(hanim_displacer_metatype::id, browser) {} *************** *** 365,369 **** * @brief Destroy. */ ! hanim_displacer_class::~hanim_displacer_class() OPENVRML_NOTHROW {} --- 367,371 ---- * @brief Destroy. */ ! hanim_displacer_metatype::~hanim_displacer_metatype() OPENVRML_NOTHROW {} *************** *** 374,386 **** * @param interfaces the interfaces for the new node_type. * ! * @return a node_type_ptr to a node_type capable of creating HAnimDisplacer nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_displacer_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_displacer_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 376,389 ---- * @param interfaces the interfaces for the new node_type. * ! * @return a @c node_type capable of creating HAnimDisplacer nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_displacer_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_displacer_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 502,508 **** /** ! * @brief @c node_class identifier. */ ! const char * const hanim_humanoid_class::id = "urn:X-openvrml:node:HAnimHumanoid"; --- 505,511 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const hanim_humanoid_metatype::id = "urn:X-openvrml:node:HAnimHumanoid"; *************** *** 511,518 **** * * @param browser the @c browser associated with this ! * @c hanim_humanoid_class. */ ! hanim_humanoid_class::hanim_humanoid_class(openvrml::browser & browser): ! node_class(hanim_humanoid_class::id, browser) {} --- 514,521 ---- * * @param browser the @c browser associated with this ! * @c hanim_humanoid_metatype. */ ! hanim_humanoid_metatype::hanim_humanoid_metatype(openvrml::browser & browser): ! node_metatype(hanim_humanoid_metatype::id, browser) {} *************** *** 520,524 **** * @brief Destroy. */ ! hanim_humanoid_class::~hanim_humanoid_class() OPENVRML_NOTHROW {} --- 523,527 ---- * @brief Destroy. */ ! hanim_humanoid_metatype::~hanim_humanoid_metatype() OPENVRML_NOTHROW {} *************** *** 532,541 **** * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_humanoid_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_humanoid_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 535,545 ---- * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_humanoid_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_humanoid_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 905,911 **** /** ! * @brief @c node_class identifier. */ ! const char * const hanim_joint_class::id = "urn:X-openvrml:node:HAnimJoint"; --- 909,915 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const hanim_joint_metatype::id = "urn:X-openvrml:node:HAnimJoint"; *************** *** 913,920 **** * @brief Construct. * ! * @param browser the @c browser associated with this @c hanim_joint_class. */ ! hanim_joint_class::hanim_joint_class(openvrml::browser & browser): ! node_class(hanim_joint_class::id, browser) {} --- 917,924 ---- * @brief Construct. * ! * @param browser the @c browser associated with this @c hanim_joint_metatype. */ ! hanim_joint_metatype::hanim_joint_metatype(openvrml::browser & browser): ! node_metatype(hanim_joint_metatype::id, browser) {} *************** *** 922,926 **** * @brief Destroy. */ ! hanim_joint_class::~hanim_joint_class() OPENVRML_NOTHROW {} --- 926,930 ---- * @brief Destroy. */ ! hanim_joint_metatype::~hanim_joint_metatype() OPENVRML_NOTHROW {} *************** *** 931,943 **** * @param interfaces the interfaces for the new node_type. * ! * @return a node_type_ptr to a node_type capable of creating HAnimJoint nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_joint_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_joint_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 935,948 ---- * @param interfaces the interfaces for the new node_type. * ! * @return a @c node_type capable of creating HAnimJoint nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_joint_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_joint_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 1291,1297 **** /** ! * @brief @c node_class identifier. */ ! const char * const hanim_segment_class::id = "urn:X-openvrml:node:HAnimSegment"; --- 1296,1302 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const hanim_segment_metatype::id = "urn:X-openvrml:node:HAnimSegment"; *************** *** 1300,1307 **** * * @param browser the @c browser associated with this ! * @c hanim_segment_class. */ ! hanim_segment_class::hanim_segment_class(openvrml::browser & browser): ! node_class(hanim_segment_class::id, browser) {} --- 1305,1312 ---- * * @param browser the @c browser associated with this ! * @c hanim_segment_metatype. */ ! hanim_segment_metatype::hanim_segment_metatype(openvrml::browser & browser): ! node_metatype(hanim_segment_metatype::id, browser) {} *************** *** 1309,1313 **** * @brief Destroy. */ ! hanim_segment_class::~hanim_segment_class() OPENVRML_NOTHROW {} --- 1314,1318 ---- * @brief Destroy. */ ! hanim_segment_metatype::~hanim_segment_metatype() OPENVRML_NOTHROW {} *************** *** 1318,1330 **** * @param interfaces the interfaces for the new node_type. * ! * @return a node_type_ptr to a node_type capable of creating HAnimSegment nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_segment_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_segment_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 1323,1336 ---- * @param interfaces the interfaces for the new node_type. * ! * @return a @c node_type capable of creating HAnimSegment nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_segment_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_segment_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 1544,1550 **** /** ! * @brief @c node_class identifier. */ ! const char * const hanim_site_class::id = "urn:X-openvrml:node:HAnimSite"; --- 1550,1556 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const hanim_site_metatype::id = "urn:X-openvrml:node:HAnimSite"; *************** *** 1552,1559 **** * @brief Construct. * ! * @param browser the @c browser associated with this @c hanim_site_class. */ ! hanim_site_class::hanim_site_class(openvrml::browser & browser): ! node_class(hanim_site_class::id, browser) {} --- 1558,1565 ---- * @brief Construct. * ! * @param browser the @c browser associated with this @c hanim_site_metatype. */ ! hanim_site_metatype::hanim_site_metatype(openvrml::browser & browser): ! node_metatype(hanim_site_metatype::id, browser) {} *************** *** 1561,1565 **** * @brief Destroy. */ ! hanim_site_class::~hanim_site_class() OPENVRML_NOTHROW {} --- 1567,1571 ---- * @brief Destroy. */ ! hanim_site_metatype::~hanim_site_metatype() OPENVRML_NOTHROW {} *************** *** 1570,1582 **** * @param interfaces the interfaces for the new node_type. * ! * @return a node_type_ptr to a node_type capable of creating HAnimSite nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_site_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_site_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 1576,1589 ---- * @param interfaces the interfaces for the new node_type. * ! * @return a @c node_type capable of creating HAnimSite nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by hanim_site_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! hanim_site_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 1803,1807 **** /** ! * @var hanim_displacer_node::HAnimDisplacer_class * * @brief Class object for HAnimDisplacer nodes. --- 1810,1814 ---- /** ! * @var hanim_displacer_node::hanim_displacer_metatype * * @brief Class object for HAnimDisplacer nodes. *************** *** 1864,1868 **** /** ! * @var hanim_humanoid_node::HAnimHumanoid_class * * @brief Class object for HAnimHumanoid nodes. --- 1871,1875 ---- /** ! * @var hanim_humanoid_node::hanim_humanoid_metatype * * @brief Class object for HAnimHumanoid nodes. *************** *** 1982,1986 **** * * @param type the node_type associated with this node. ! * @param scope the scope to which the node belongs. */ hanim_humanoid_node:: --- 1989,1993 ---- * * @param type the node_type associated with this node. ! * @param scope the scope to which the node belongs. */ hanim_humanoid_node:: *************** *** 2024,2028 **** /** ! * @var hanim_joint_node::HAnimJoint_class * * @brief Class object for HAnimJoint nodes. --- 2031,2035 ---- /** ! * @var hanim_joint_node::hanim_joint_metatype * * @brief Class object for HAnimJoint nodes. *************** *** 2220,2224 **** /** ! * @var hanim_segment_node::HAnimSegment_class * * @brief Class object for HAnimSegment nodes. --- 2227,2231 ---- /** ! * @var hanim_segment_node::hanim_segment_metatype * * @brief Class object for HAnimSegment nodes. *************** *** 2367,2371 **** /** ! * @var hanim_site_node::HAnimSite_class * * @brief Class object for HAnimSite nodes. --- 2374,2378 ---- /** ! * @var hanim_site_node::hanim_site_metatype * * @brief Class object for HAnimSite nodes. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** vrml97node.cpp 17 May 2006 07:59:50 -0000 1.104 --- vrml97node.cpp 18 May 2006 04:11:31 -0000 1.105 *************** *** 64,73 **** * @brief Class object for Anchor nodes. */ ! class OPENVRML_LOCAL anchor_class : public node_class { public: static const char * const id; ! explicit anchor_class(openvrml::browser & browser); ! virtual ~anchor_class() OPENVRML_NOTHROW; private: [...7682 lines suppressed...] ! * not supported by cad_assembly_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! cad_assembly_metatype:: do_create_type(const std::string & id, const node_interface_set & interfaces) const *************** *** 27814,27818 **** /** ! * @var cad_assembly_node::cad_assembly_class * * @brief Class object for Group nodes. --- 27842,27846 ---- /** ! * @var cad_assembly_node::cad_assembly_metatype * * @brief Class object for Group nodes. Index: x3d_key_device_sensor.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_key_device_sensor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_key_device_sensor.h 26 Mar 2006 07:42:14 -0000 1.1 --- x3d_key_device_sensor.h 18 May 2006 04:11:31 -0000 1.2 *************** *** 6,10 **** } ! extern "C" void register_key_device_sensor_node_classes(openvrml::browser & b); # endif --- 6,10 ---- } ! extern "C" void register_key_device_sensor_node_metatypes(openvrml::browser & b); # endif Index: x3d_cad_geometry.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_cad_geometry.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_cad_geometry.cpp 17 May 2006 07:59:50 -0000 1.1 --- x3d_cad_geometry.cpp 18 May 2006 04:11:31 -0000 1.2 *************** *** 39,53 **** * @brief Class object for CADFace nodes. */ ! class OPENVRML_LOCAL cad_face_class : public node_class { public: static const char * const id; ! explicit cad_face_class(openvrml::browser & browser); ! virtual ~cad_face_class() OPENVRML_NOTHROW; private: virtual const boost::shared_ptr<node_type> ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; --- 39,53 ---- * @brief Class object for CADFace nodes. */ ! class OPENVRML_LOCAL cad_face_metatype : public node_metatype { public: static const char * const id; ! explicit cad_face_metatype(openvrml::browser & browser); ! virtual ~cad_face_metatype() OPENVRML_NOTHROW; private: virtual const boost::shared_ptr<node_type> ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; *************** *** 57,86 **** * @brief Class object for IndexedQuadSet and QuadSet nodes. */ ! class OPENVRML_LOCAL quad_set_class : public node_class { public: static const char * const id; ! explicit quad_set_class(openvrml::browser & browser); ! virtual ~quad_set_class() OPENVRML_NOTHROW; private: virtual const boost::shared_ptr<node_type> ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; } ! void register_cad_geometry_node_classes(openvrml::browser & b) { ! using openvrml::node_class; using boost::shared_ptr; ! b.add_node_class(cad_face_class::id, ! shared_ptr<node_class>(new cad_face_class(b))); ! //NOTE: This has been moved to vrml97node.cpp for the time being. ! //b.add_node_class("urn:X-openvrml:node:CADLayer", ! // shared_ptr<node_class>(new cad_layer_class(b))); ! b.add_node_class(quad_set_class::id, ! shared_ptr<node_class>(new quad_set_class(b))); } --- 57,83 ---- * @brief Class object for IndexedQuadSet and QuadSet nodes. */ ! class OPENVRML_LOCAL quad_set_metatype : public node_metatype { public: static const char * const id; ! explicit quad_set_metatype(openvrml::browser & browser); ! virtual ~quad_set_metatype() OPENVRML_NOTHROW; private: virtual const boost::shared_ptr<node_type> ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; } ! void register_cad_geometry_node_metatypes(openvrml::browser & b) { ! using openvrml::node_metatype; using boost::shared_ptr; ! b.add_node_metatype(cad_face_metatype::id, ! shared_ptr<node_metatype>(new cad_face_metatype(b))); ! b.add_node_metatype(quad_set_metatype::id, ! shared_ptr<node_metatype>(new quad_set_metatype(b))); } *************** *** 90,94 **** class OPENVRML_LOCAL cad_face_node : public abstract_node<cad_face_node>, public grouping_node { ! friend class cad_face_class; exposedfield<sfstring> name_; --- 87,91 ---- class OPENVRML_LOCAL cad_face_node : public abstract_node<cad_face_node>, public grouping_node { ! friend class cad_face_metatype; exposedfield<sfstring> name_; *************** *** 115,130 **** class OPENVRML_LOCAL quad_set_node : public abstract_node<quad_set_node>, public geometry_node { ! friend class quad_set_class; class set_index_listener : public event_listener_base<self_t>, public mfint32_listener { ! public: ! explicit set_index_listener(self_t & node); ! virtual ~set_index_listener() OPENVRML_NOTHROW; ! private: ! virtual void do_process_event(const mfint32 & fraction, ! double timestamp) ! OPENVRML_THROW1(std::bad_alloc); }; --- 112,127 ---- class OPENVRML_LOCAL quad_set_node : public abstract_node<quad_set_node>, public geometry_node { ! friend class quad_set_metatype; class set_index_listener : public event_listener_base<self_t>, public mfint32_listener { ! public: ! explicit set_index_listener(self_t & node); ! virtual ~set_index_listener() OPENVRML_NOTHROW; ! private: ! virtual void do_process_event(const mfint32 & fraction, ! double timestamp) ! OPENVRML_THROW1(std::bad_alloc); }; *************** *** 151,155 **** private: virtual const openvrml::bounding_volume & ! do_bounding_volume() const; virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, --- 148,152 ---- private: virtual const openvrml::bounding_volume & ! do_bounding_volume() const; virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, *************** *** 161,175 **** /** ! * @brief @c node_class identifier. */ ! const char * const cad_face_class::id = "urn:X-openvrml:node:CADFace"; /** * @brief Construct. * ! * @param browser the browser associated with this cad_face_class. */ ! cad_face_class::cad_face_class(openvrml::browser & browser): ! node_class(cad_face_class::id, browser) {} --- 158,172 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const cad_face_metatype::id = "urn:X-openvrml:node:CADFace"; /** * @brief Construct. * ! * @param browser the browser associated with this cad_face_metatype. */ ! cad_face_metatype::cad_face_metatype(openvrml::browser & browser): ! node_metatype(cad_face_metatype::id, browser) {} *************** *** 177,181 **** * @brief Destroy. */ ! cad_face_class::~cad_face_class() OPENVRML_NOTHROW {} --- 174,178 ---- * @brief Destroy. */ ! cad_face_metatype::~cad_face_metatype() OPENVRML_NOTHROW {} *************** *** 186,198 **** * @param interfaces the interfaces for the new node_type. * ! * @return a node_type_ptr to a node_type capable of creating CADFace nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by cad_face_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! cad_face_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 183,196 ---- * @param interfaces the interfaces for the new node_type. * ! * @return a @c node_type capable of creating CADFace nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by cad_face_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! cad_face_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 276,290 **** /** ! * @brief @c node_class identifier. */ ! const char * const quad_set_class::id = "urn:X-openvrml:node:QuadSet"; /** * @brief Construct. * ! * @param browser the browser associated with this quad_set_class. */ ! quad_set_class::quad_set_class(openvrml::browser & browser): ! node_class(cad_face_class::id, browser) {} --- 274,288 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const quad_set_metatype::id = "urn:X-openvrml:node:QuadSet"; /** * @brief Construct. * ! * @param browser the browser associated with this quad_set_metatype. */ ! quad_set_metatype::quad_set_metatype(openvrml::browser & browser): ! node_metatype(cad_face_metatype::id, browser) {} *************** *** 292,296 **** * @brief Destroy. */ ! quad_set_class::~quad_set_class() OPENVRML_NOTHROW {} --- 290,294 ---- * @brief Destroy. */ ! quad_set_metatype::~quad_set_metatype() OPENVRML_NOTHROW {} *************** *** 301,313 **** * @param interfaces the interfaces for the new node_type. * ! * @return a node_type_ptr to a node_type capable of creating IndexedQuadSet nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by quad_set_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! quad_set_class::do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { --- 299,312 ---- * @param interfaces the interfaces for the new node_type. * ! * @return a @c node_type capable of creating IndexedQuadSet nodes. * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by quad_set_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! quad_set_metatype:: ! do_create_type(const std::string & id, ! const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { *************** *** 495,499 **** /** ! * @var cad_face_node::CADFace_class * * @brief Class object for CADFace nodes. --- 494,498 ---- /** ! * @var cad_face_node::cad_face_metatype * * @brief Class object for CADFace nodes. *************** *** 501,505 **** /** ! * @var abstract_node<self_t>::exposedfield<sfstring> >( cad_face_node::name_ * * @brief name exposedField --- 500,504 ---- /** ! * @var abstract_node<self_t>::exposedfield<sfstring> cad_face_node::name_ * * @brief name exposedField *************** *** 507,511 **** /** ! * @var abstract_node<self_t>::exposedfield<sfnode> > cad_face_node::shape_ * * @brief shape exposedField --- 506,510 ---- /** ! * @var abstract_node<self_t>::exposedfield<sfnode> cad_face_node::shape_ * * @brief shape exposedField *************** *** 570,585 **** * * @param type the node_type associated with this node. ! * @param scope the scope to which the node belongs. */ cad_face_node:: cad_face_node(const node_type & type, ! const boost::shared_ptr<openvrml::scope> & scope): ! node(type, scope), ! bounded_volume_node(type, scope), ! child_node(type, scope), ! abstract_node<self_t>(type, scope), ! grouping_node(type, scope), ! name_(*this), ! shape_(*this) {} --- 569,584 ---- * * @param type the node_type associated with this node. ! * @param scope the scope to which the node belongs. */ cad_face_node:: cad_face_node(const node_type & type, ! const boost::shared_ptr<openvrml::scope> & scope): ! node(type, scope), ! bounded_volume_node(type, scope), ! child_node(type, scope), ! abstract_node<self_t>(type, scope), ! grouping_node(type, scope), ! name_(*this), ! shape_(*this) {} *************** *** 597,601 **** /** ! * @var quad_set_node::IndexedQuadSet_class * * @brief Class object for IndexedQuadSet nodes. --- 596,600 ---- /** ! * @var quad_set_node::indexed_quad_set_metatype * * @brief Class object for IndexedQuadSet nodes. *************** *** 683,705 **** * @brief Construct. * ! * @param type the node_type associated with this node. ! * @param scope the scope to which the node belongs. */ quad_set_node:: quad_set_node(const node_type & type, ! const boost::shared_ptr<openvrml::scope> & scope): ! node(type, scope), ! bounded_volume_node(type, scope), ! abstract_node<self_t>(type, scope), ! geometry_node(type, scope), ! set_index_listener_(*this), ! color_(*this), ! coord_(*this), ! normal_(*this), ! tex_coord_(*this), ! ccw_(true), ! color_per_vertex_(true), ! normal_per_vertex_(true), ! solid_(true) {} --- 682,704 ---- * @brief Construct. * ! * @param type the @c node_type associated with this node. ! * @param scope the @c scope to which the node belongs. */ quad_set_node:: quad_set_node(const node_type & type, ! const boost::shared_ptr<openvrml::scope> & scope): ! node(type, scope), ! bounded_volume_node(type, scope), ! abstract_node<self_t>(type, scope), ! geometry_node(type, scope), ! set_index_listener_(*this), ! color_(*this), ! coord_(*this), ! normal_(*this), ! tex_coord_(*this), ! ccw_(true), ! color_per_vertex_(true), ! normal_per_vertex_(true), ! solid_(true) {} *************** *** 786,789 **** && this->tex_coord_.sfnode::value()->modified()); } - } --- 785,787 ---- Index: x3d_networking.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_networking.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_networking.h 28 Mar 2006 06:56:17 -0000 1.1 --- x3d_networking.h 18 May 2006 04:11:31 -0000 1.2 *************** *** 27,31 **** } ! extern "C" void register_networking_node_classes(openvrml::browser & b); # endif --- 27,31 ---- } ! extern "C" void register_networking_node_metatypes(openvrml::browser & b); # endif Index: x3d_event_utilities.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_event_utilities.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_event_utilities.h 26 Mar 2006 07:42:14 -0000 1.1 --- x3d_event_utilities.h 18 May 2006 04:11:31 -0000 1.2 *************** *** 27,31 **** } ! extern "C" void register_event_utilities_node_classes(openvrml::browser & b); # endif --- 27,31 ---- } ! extern "C" void register_event_utilities_node_metatypes(openvrml::browser & b); # endif Index: x3d_key_device_sensor.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_key_device_sensor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** x3d_key_device_sensor.cpp 16 Apr 2006 08:22:19 -0000 1.4 --- x3d_key_device_sensor.cpp 18 May 2006 04:11:31 -0000 1.5 *************** *** 39,48 **** * @brief Class object for KeySensor nodes. */ ! class OPENVRML_LOCAL key_sensor_class : public node_class { public: static const char * const id; ! explicit key_sensor_class(openvrml::browser & browser); ! virtual ~key_sensor_class() OPENVRML_NOTHROW; private: --- 39,48 ---- * @brief Class object for KeySensor nodes. */ ! class OPENVRML_LOCAL key_sensor_metatype : public node_metatype { public: static const char * const id; ! explicit key_sensor_metatype(openvrml::browser & browser); ! virtual ~key_sensor_metatype() OPENVRML_NOTHROW; private: *************** *** 57,66 **** * @brief Class object for StringSensor nodes. */ ! class OPENVRML_LOCAL string_sensor_class : public node_class { public: static const char * const id; ! explicit string_sensor_class(openvrml::browser & browser); ! virtual ~string_sensor_class() OPENVRML_NOTHROW; private: --- 57,66 ---- * @brief Class object for StringSensor nodes. */ ! class OPENVRML_LOCAL string_sensor_metatype : public node_metatype { public: static const char * const id; ! explicit string_sensor_metatype(openvrml::browser & browser); ! virtual ~string_sensor_metatype() OPENVRML_NOTHROW; private: *************** *** 72,83 **** } ! void register_key_device_sensor_node_classes(openvrml::browser & b) { using boost::shared_ptr; ! using openvrml::node_class; ! b.add_node_class(key_sensor_class::id, ! shared_ptr<node_class>(new key_sensor_class(b))); ! b.add_node_class(string_sensor_class::id, ! shared_ptr<node_class>(new string_sensor_class(b))); } --- 72,83 ---- } ! void register_key_device_sensor_node_metatypes(openvrml::browser & b) { using boost::shared_ptr; ! using openvrml::node_metatype; ! b.add_node_metatype(key_sensor_metatype::id, ! shared_ptr<node_metatype>(new key_sensor_metatype(b))); ! b.add_node_metatype(string_sensor_metatype::id, ! shared_ptr<node_metatype>(new string_sensor_metatype(b))); } *************** *** 88,92 **** class OPENVRML_LOCAL key_sensor_node : public abstract_node<key_sensor_node>, public child_node { ! friend class key_sensor_class; exposedfield<sfbool> enabled_; --- 88,92 ---- class OPENVRML_LOCAL key_sensor_node : public abstract_node<key_sensor_node>, public child_node { ! friend class key_sensor_metatype; exposedfield<sfbool> enabled_; *************** *** 119,123 **** public child_node { ! friend class string_sensor_class; exposedfield<sfbool> deletion_allowed_; --- 119,123 ---- public child_node { ! friend class string_sensor_metatype; exposedfield<sfbool> deletion_allowed_; *************** *** 138,144 **** /** ! * @brief @c node_class identifier. */ ! const char * const key_sensor_class::id = "urn:X-openvrml:node:KeySensor"; --- 138,144 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const key_sensor_metatype::id = "urn:X-openvrml:node:KeySensor"; *************** *** 146,153 **** * @brief Construct. * ! * @param browser the @c browser associated with this @c key_sensor_class. */ ! key_sensor_class::key_sensor_class(openvrml::browser & browser): ! node_class(key_sensor_class::id, browser) {} --- 146,153 ---- * @brief Construct. * ! * @param browser the @c browser associated with this @c key_sensor_metatype. */ ! key_sensor_metatype::key_sensor_metatype(openvrml::browser & browser): ! node_metatype(key_sensor_metatype::id, browser) {} *************** *** 155,159 **** * @brief Destroy. */ ! key_sensor_class::~key_sensor_class() OPENVRML_NOTHROW {} --- 155,159 ---- * @brief Destroy. */ ! key_sensor_metatype::~key_sensor_metatype() OPENVRML_NOTHROW {} *************** *** 167,175 **** * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by key_sensor_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! key_sensor_class::do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) --- 167,175 ---- * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by key_sensor_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! key_sensor_metatype::do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) *************** *** 328,332 **** /** ! * @var key_sensor_node::key_sensor_class * * @brief Class object for KeySensor nodes. --- 328,332 ---- /** ! * @var key_sensor_node::key_sensor_metatype * * @brief Class object for KeySensor nodes. *************** *** 420,426 **** /** ! * @brief @c node_class identifier. */ ! const char * const string_sensor_class::id = "urn:X-openvrml:node:StringSensor"; --- 420,426 ---- /** ! * @brief @c node_metatype identifier. */ ! const char * const string_sensor_metatype::id = "urn:X-openvrml:node:StringSensor"; *************** *** 429,436 **** * * @param browser the @c browser associated with this ! * @c string_sensor_class. */ ! string_sensor_class::string_sensor_class(openvrml::browser & browser): ! node_class(string_sensor_class::id, browser) {} --- 429,436 ---- * * @param browser the @c browser associated with this ! * @c string_sensor_metatype. */ ! string_sensor_metatype::string_sensor_metatype(openvrml::browser & browser): ! node_metatype(string_sensor_metatype::id, browser) {} *************** *** 438,442 **** * @brief Destroy. */ ! string_sensor_class::~string_sensor_class() OPENVRML_NOTHROW {} --- 438,442 ---- * @brief Destroy. */ ! string_sensor_metatype::~string_sensor_metatype() OPENVRML_NOTHROW {} *************** *** 450,458 **** * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by string_sensor_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! string_sensor_class:: do_create_type(const std::string & id, const node_interface_set & interfaces) const --- 450,458 ---- * * @exception unsupported_interface if @p interfaces includes an interface ! * not supported by string_sensor_metatype. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> ! string_sensor_metatype:: do_create_type(const std::string & id, const node_interface_set & interfaces) const *************** *** 576,580 **** /** ! * @var string_sensor_node::StringSensor_class * * @brief Class object for StringSensor nodes. --- 576,580 ---- /** ! * @var string_sensor_node::string_sensor_metatype * * @brief Class object for StringSensor nodes. Index: x3d_nurbs.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_nurbs.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** x3d_nurbs.cpp 18 Apr 2006 06:47:53 -0000 1.3 --- x3d_nurbs.cpp 18 May 2006 04:11:31 -0000 1.4 *************** *** 39,48 **** * @brief Class object for Contour2D nodes. */ ! class OPENVRML_LOCAL contour2d_class : public node_class { public: static const char * const id; ! explicit contour2d_class(openvrml::browser & browser); ! virtual ~contour2d_class() OPENVRML_NOTHROW; private: [...2123 lines suppressed...] --- 4393,4398 ---- * @brief Destroy. */ ! nurbs_texture_coordinate_node::~nurbs_texture_coordinate_node() ! OPENVRML_NOTHROW {} *************** *** 4374,4378 **** /** ! * @var nurbs_trimmed_surface_node::NurbsTrimmedSurface_class * * @brief Class object for NurbsTrimmedSurface nodes. --- 4405,4409 ---- /** ! * @var nurbs_trimmed_surface_node::nurbs_trimmed_surface_metatype * * @brief Class object for NurbsTrimmedSurface nodes. Index: x3d_shape.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_shape.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_shape.h 28 Mar 2006 06:56:17 -0000 1.1 --- x3d_shape.h 18 May 2006 04:11:31 -0000 1.2 *************** *** 27,31 **** } ! extern "C" void register_shape_node_classes(openvrml::browser & b); # endif --- 27,31 ---- } ! extern "C" void register_shape_node_metatypes(openvrml::browser & b); # endif Index: x3d_grouping.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_grouping.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** x3d_grouping.h 20 Apr 2006 05:24:11 -0000 1.1 --- x3d_grouping.h 18 May 2006 04:11:31 -0000 1.2 *************** *** 27,31 **** } ! extern "C" void register_grouping_node_classes(openvrml::browser & b); # endif --- 27,31 ---- } ! extern "C" void register_grouping_node_metatypes(openvrml::browser & b); # endif Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Vrml97Parser.g 17 Apr 2006 07:29:16 -0000 1.63 --- Vrml97Parser.g 18 May 2006 04:11:30 -0000 1.64 *************** *** 702,709 **** node_interface_set interfaces; ! proto_node_class::default_value_map_t default_value_map; vector<boost::intrusive_ptr<openvrml::node> > impl_nodes; ! proto_node_class::is_map_t is_map; ! proto_node_class::routes_t routes; } : KEYWORD_PROTO id:ID { --- 702,709 ---- node_interface_set interfaces; ! proto_node_metatype::default_value_map_t default_value_map; vector<boost::intrusive_ptr<openvrml::node> > impl_nodes; ! proto_node_metatype::is_map_t is_map; ! proto_node_metatype::routes_t routes; } : KEYWORD_PROTO id:ID { *************** *** 722,728 **** is_map, routes] RBRACE { ! const shared_ptr<openvrml::node_class> ! node_class( ! new proto_node_class(path(*proto_scope), scene.browser(), interfaces, --- 722,728 ---- is_map, routes] RBRACE { ! const shared_ptr<openvrml::node_metatype> ! node_metatype( ! new proto_node_metatype(path(*proto_scope), scene.browser(), interfaces, *************** *** 732,744 **** routes)); // ! // Add the new node_class (prototype definition) to the browser's ! // node_class_map. // ! scene.browser().add_node_class(node_class->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); } --- 732,744 ---- routes)); // ! // Add the new node_metatype (prototype definition) to the browser's ! // node_metatype_map. // ! scene.browser().add_node_metatype(node_metatype->id(), node_metatype); ! if (!dynamic_pointer_cast<proto_node_metatype>( ! scene.browser().node_metatype(node_metatype_id(this->uri)))) { ! scene.browser().add_node_metatype(node_metatype_id(this->uri), ! node_metaty... [truncated message content] |
From: Braden M. <br...@us...> - 2006-05-18 04:11:33
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27658 Modified Files: ChangeLog Log Message: Renamed "node_class" to "node_metatype". Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1248 retrieving revision 1.1249 diff -C2 -d -r1.1248 -r1.1249 *** ChangeLog 17 May 2006 07:59:49 -0000 1.1248 --- ChangeLog 18 May 2006 04:11:30 -0000 1.1249 *************** *** 1,2 **** --- 1,50 ---- + 2006-05-18 Braden McDaniel <br...@en...> + + Renamed "node_class" to "node_metatype". + + * src/libopenvrml/openvrml/Vrml97Parser.g + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/browser.h + * src/libopenvrml/openvrml/node.cpp + * src/libopenvrml/openvrml/node.h + * src/libopenvrml/openvrml/node_impl_util.cpp + * src/libopenvrml/openvrml/node_impl_util.h + * src/libopenvrml/openvrml/script.cpp + * src/libopenvrml/openvrml/script.h + * src/libopenvrml/openvrml/vrml97node.cpp + * src/libopenvrml/openvrml/vrml97node.h + * src/libopenvrml/openvrml/x3d_cad_geometry.cpp + * src/libopenvrml/openvrml/x3d_cad_geometry.h + * src/libopenvrml/openvrml/x3d_core.cpp + * src/libopenvrml/openvrml/x3d_core.h + * src/libopenvrml/openvrml/x3d_dis.cpp + * src/libopenvrml/openvrml/x3d_dis.h + * src/libopenvrml/openvrml/x3d_environmental_effects.cpp + * src/libopenvrml/openvrml/x3d_environmental_effects.h + * src/libopenvrml/openvrml/x3d_event_utilities.cpp + * src/libopenvrml/openvrml/x3d_event_utilities.h + * src/libopenvrml/openvrml/x3d_geometry2d.cpp + * src/libopenvrml/openvrml/x3d_geometry2d.h + * src/libopenvrml/openvrml/x3d_geospatial.cpp + * src/libopenvrml/openvrml/x3d_geospatial.h + * src/libopenvrml/openvrml/x3d_grouping.cpp + * src/libopenvrml/openvrml/x3d_grouping.h + * src/libopenvrml/openvrml/x3d_hanim.cpp + * src/libopenvrml/openvrml/x3d_hanim.h + * src/libopenvrml/openvrml/x3d_interpolation.cpp + * src/libopenvrml/openvrml/x3d_interpolation.h + * src/libopenvrml/openvrml/x3d_key_device_sensor.cpp + * src/libopenvrml/openvrml/x3d_key_device_sensor.h + * src/libopenvrml/openvrml/x3d_networking.cpp + * src/libopenvrml/openvrml/x3d_networking.h + * src/libopenvrml/openvrml/x3d_nurbs.cpp + * src/libopenvrml/openvrml/x3d_nurbs.h + * src/libopenvrml/openvrml/x3d_rendering.cpp + * src/libopenvrml/openvrml/x3d_rendering.h + * src/libopenvrml/openvrml/x3d_shape.cpp + * src/libopenvrml/openvrml/x3d_shape.h + * src/libopenvrml/openvrml/x3d_texturing.cpp + * src/libopenvrml/openvrml/x3d_texturing.h + 2006-05-17 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-05-17 07:59:53
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24525/src/libopenvrml Modified Files: Makefile.am Log Message: Added support for creating scene graphs with CADGeomentry component nodes. From Andrew Grieve <sg...@us...> Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/Makefile.am,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Makefile.am 7 May 2006 03:39:19 -0000 1.34 --- Makefile.am 17 May 2006 07:59:50 -0000 1.35 *************** *** 34,38 **** openvrml/x3d_geospatial.h \ openvrml/x3d_hanim.h \ ! openvrml/x3d_nurbs.h VRML97PARSER_BUILT_SOURCEFILES = \ --- 34,39 ---- openvrml/x3d_geospatial.h \ openvrml/x3d_hanim.h \ ! openvrml/x3d_nurbs.h \ ! openvrml/x3d_cad_geometry.h VRML97PARSER_BUILT_SOURCEFILES = \ *************** *** 120,124 **** openvrml/x3d_geospatial.cpp \ openvrml/x3d_hanim.cpp \ ! openvrml/x3d_nurbs.cpp libopenvrml_la_LDFLAGS = \ --- 121,126 ---- openvrml/x3d_geospatial.cpp \ openvrml/x3d_hanim.cpp \ ! openvrml/x3d_nurbs.cpp \ ! openvrml/x3d_cad_geometry.cpp libopenvrml_la_LDFLAGS = \ |
From: Braden M. <br...@us...> - 2006-05-17 07:59:53
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24525/src/libopenvrml/openvrml Modified Files: browser.cpp vrml97node.cpp Added Files: x3d_cad_geometry.cpp x3d_cad_geometry.h Log Message: Added support for creating scene graphs with CADGeomentry component nodes. From Andrew Grieve <sg...@us...> Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** browser.cpp 17 May 2006 03:57:08 -0000 1.175 --- browser.cpp 17 May 2006 07:59:50 -0000 1.176 *************** *** 62,65 **** --- 62,66 ---- # include "x3d_hanim.h" # include "x3d_nurbs.h" + # include "x3d_cad_geometry.h" namespace openvrml { *************** *** 3826,3829 **** --- 3827,3831 ---- } + class OPENVRML_LOCAL profile { typedef std::map<std::string, int> map_t; *************** *** 6017,6020 **** --- 6019,6023 ---- register_hanim_node_classes(b); register_nurbs_node_classes(b); + register_cad_geometry_node_classes(b); } } *************** *** 6805,6809 **** * @param[in] url an alternative URI list. * @param[in] node the node to which the nodes loaded from @p url should be ! * sent as an event. * @param[in] event the event of @p node to which the new nodes will be sent. * --- 6808,6812 ---- * @param[in] url an alternative URI list. * @param[in] node the node to which the nodes loaded from @p url should be ! * sent as an event. * @param[in] event the event of @p node to which the new nodes will be sent. * *************** *** 13521,13524 **** --- 13524,13770 ---- + class OPENVRML_LOCAL x3d_cad_geometry_component : public component { + public: + static const char * const id; + + virtual size_t support_level() const OPENVRML_NOTHROW; + + private: + virtual void do_add_to_scope(const openvrml::browser & b, + openvrml::scope & scope, + size_t level) const + OPENVRML_THROW1(std::bad_alloc); + }; + + const char * const x3d_cad_geometry_component::id = "CADGeometry"; + + size_t x3d_cad_geometry_component::support_level() const OPENVRML_NOTHROW + { + return 2; + } + + void x3d_cad_geometry_component::do_add_to_scope(const openvrml::browser & b, + openvrml::scope & scope, + const size_t level) const + OPENVRML_THROW1(std::bad_alloc) + { + using namespace openvrml; + + // CADAssembly node + if (level >= 2) + { + static const node_interface interfaces[] = { + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "addChildren"), + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "removeChildren"), + node_interface(node_interface::exposedfield_id, + field_value::mfnode_id, + "children"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfstring_id, + "name"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxCenter"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxSize") + }; + + static const node_interface_set interface_set(interfaces, interfaces + 7); + add_scope_entry(b, "CADAssembly", interface_set, + "urn:X-openvrml:node:CADAssembly", scope); + } + // CADFace node + if (level >= 2) + { + static const node_interface interfaces[] = { + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfstring_id, + "name"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "shape") + }; + + static const node_interface_set interface_set(interfaces, interfaces + 3); + add_scope_entry(b, "CADFace", interface_set, + "urn:X-openvrml:node:CADFace", scope); + } + // CADLayer node + if (level >= 2) + { + static const node_interface interfaces[] = { + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "addChildren"), + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "removeChildren"), + node_interface(node_interface::exposedfield_id, + field_value::mfnode_id, + "children"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfstring_id, + "name"), + node_interface(node_interface::exposedfield_id, + field_value::mfbool_id, + "visible"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxCenter"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxSize") + }; + + static const node_interface_set interface_set(interfaces, interfaces + 8); + add_scope_entry(b, "CADLayer", interface_set, + "urn:X-openvrml:node:CADLayer", scope); + } + // CADPart node + if (level >= 2) + { + static const node_interface interfaces[] = { + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "addChildren"), + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "removeChildren"), + node_interface(node_interface::exposedfield_id, + field_value::mfnode_id, + "children"), + node_interface(node_interface::exposedfield_id, + field_value::sfvec3f_id, + "center"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfstring_id, + "name"), + node_interface(node_interface::exposedfield_id, + field_value::sfrotation_id, + "rotation"), + node_interface(node_interface::exposedfield_id, + field_value::sfvec3f_id, + "scale"), + node_interface(node_interface::exposedfield_id, + field_value::sfrotation_id, + "scaleOrientation"), + node_interface(node_interface::exposedfield_id, + field_value::sfvec3f_id, + "translation"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxCenter"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxSize") + }; + + static const node_interface_set interface_set(interfaces, interfaces + 12); + add_scope_entry(b, "CADPart", interface_set, + "urn:X-openvrml:node:CADPart", scope); + } + // IndexedQuadSet node + if (level >= 1) + { + static const node_interface interfaces[] = { + node_interface(node_interface::eventin_id, + field_value::mfint32_id, + "set_index"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "color"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "coord"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "normal"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "texCoord"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "ccw"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "colorPerVertex"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "normalPerVertex"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "solid"), + node_interface(node_interface::field_id, + field_value::mfint32_id, + "index") + }; + + static const node_interface_set interface_set(interfaces, interfaces + 11); + add_scope_entry(b, "IndexedQuadSet", interface_set, + "urn:X-openvrml:node:IndexedQuadSet", scope); + } + // QuadSet node + if (level >= 1) { + static const node_interface interfaces[] = { + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "color"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "coord"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "normal"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "texCoord"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "ccw"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "colorPerVertex"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "normalPerVertex"), + node_interface(node_interface::field_id, + field_value::sfbool_id, + "solid") + }; + + static const node_interface_set interface_set(interfaces, + interfaces + 9); + add_scope_entry(b, + "QuadSet", + interface_set, + "urn:X-openvrml:node:QuadSet", + scope); + } + } + + class OPENVRML_LOCAL x3d_geospatial_component : public component { public: *************** *** 15873,15876 **** --- 16119,16126 ---- this->insert(key, new x3d_event_utilities_component).second; assert(succeeded); + + key = x3d_cad_geometry_component::id; + succeeded = this->insert(key, new x3d_cad_geometry_component).second; + assert(succeeded); } --- NEW FILE: x3d_cad_geometry.h --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // OpenVRML // // Copyright 2006 Braden McDaniel // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # ifndef OPENVRML_X3D_CAD_GEOMETRY_H # define OPENVRML_X3D_CAD_GEOMETRY_H namespace openvrml { class browser; } extern "C" void register_cad_geometry_node_classes(openvrml::browser & b); # endif Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** vrml97node.cpp 16 Apr 2006 08:22:18 -0000 1.103 --- vrml97node.cpp 17 May 2006 07:59:50 -0000 1.104 *************** *** 1111,1114 **** --- 1111,1148 ---- OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; + + /** + * @brief Class object for CADLayer nodes. + */ + class OPENVRML_LOCAL cad_layer_class : public node_class { + public: + static const char * const id; + + explicit cad_layer_class(openvrml::browser & browser); + virtual ~cad_layer_class() throw (); + + private: + virtual const boost::shared_ptr<node_type> + do_create_type(const std::string & id, + const node_interface_set & interfaces) const + throw (unsupported_interface, std::bad_alloc); + }; + + /** + * @brief Class object for CADAssembly nodes. + */ + class OPENVRML_LOCAL cad_assembly_class : public node_class { + public: + static const char * const id; + + explicit cad_assembly_class(openvrml::browser & browser); + virtual ~cad_assembly_class() throw (); + + private: + virtual const boost::shared_ptr<node_type> + do_create_type(const std::string & id, + const node_interface_set & interfaces) const + throw (unsupported_interface, std::bad_alloc); + }; } *************** *** 1223,1226 **** --- 1257,1264 ---- b.add_node_class(world_info_class::id, shared_ptr<node_class>(new world_info_class(b))); + b.add_node_class(cad_layer_class::id, + shared_ptr<node_class>(new cad_layer_class(b))); + b.add_node_class(cad_assembly_class::id, + shared_ptr<node_class>(new cad_assembly_class(b))); } *************** *** 27130,27132 **** --- 27168,27842 ---- world_info_node::~world_info_node() OPENVRML_NOTHROW {} + + + class OPENVRML_LOCAL cad_layer_node : + public grouping_node_base<cad_layer_node> { + + friend class cad_layer_class; + + class visible_exposedfield : public exposedfield<mfbool> { + public: + explicit visible_exposedfield(cad_layer_node & node); + visible_exposedfield(const visible_exposedfield & obj) + throw (); + virtual ~visible_exposedfield() throw (); + + private: + virtual std::auto_ptr<field_value> do_clone() const + throw (std::bad_alloc); + virtual void event_side_effect(const mfbool & visible, + double timestamp) + throw (std::bad_alloc); + }; + friend class visible_exposedfield; + + exposedfield<sfstring> name_; + visible_exposedfield visible_; + + //holds all currently visible nodes + mfnode current_children_; + + public: + cad_layer_node(const node_type & type, + const boost::shared_ptr<openvrml::scope> & scope); + virtual ~cad_layer_node() throw (); + + virtual bool modified() const; + + private: + virtual void do_children_event_side_effect(const mfnode & choice, + double timestamp) + throw (std::bad_alloc); + + virtual void do_render_child(openvrml::viewer & viewer, + rendering_context context); + virtual const std::vector<boost::intrusive_ptr<node> > & + do_children() const throw (); + virtual void recalc_bsphere(); + }; + + + /** + * @brief @c node_class identifier. + */ + const char * const cad_layer_class::id = "urn:X-openvrml:node:CADLayer"; + + /** + * @brief Construct. + * + * @param browser the @c browser associated with this @c cad_layer_class. + */ + cad_layer_class::cad_layer_class(openvrml::browser & browser): + node_class(cad_layer_class::id, browser) + {} + + /** + * @brief Destroy. + */ + cad_layer_class::~cad_layer_class() throw () + {} + + /** + * @brief Create a node_type. + * + * @param id the name for the new node_type. + * @param interfaces the interfaces for the new node_type. + * + * @return a node_type_ptr to a node_type capable of creating CADLayer nodes. + * + * @exception unsupported_interface if @p interfaces includes an interface + * not supported by cad_layer_class. + * @exception std::bad_alloc if memory allocation fails. + */ + const boost::shared_ptr<openvrml::node_type> + cad_layer_class::do_create_type(const std::string & id, + const node_interface_set & interfaces) const + throw (unsupported_interface, std::bad_alloc) + { + typedef boost::array<node_interface, 8> supported_interfaces_t; + static const supported_interfaces_t supported_interfaces = { + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "addChildren"), + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "removeChildren"), + node_interface(node_interface::exposedfield_id, + field_value::mfnode_id, + "children"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfstring_id, + "name"), + node_interface(node_interface::exposedfield_id, + field_value::mfbool_id, + "visible"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxCenter"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxSize") + }; + typedef node_type_impl<cad_layer_node> node_type_t; + + const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); + node_type_t & the_node_type = static_cast<node_type_t &>(*type); + + for (node_interface_set::const_iterator interface(interfaces.begin()); + interface != interfaces.end(); + ++interface) { + supported_interfaces_t::const_iterator supported_interface = + supported_interfaces.begin() - 1; + if (*interface == *++supported_interface) { + the_node_type.add_eventin( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_layer_node::add_children_listener>( + &cad_layer_node::add_children_listener_))); + } else if (*interface == *++supported_interface) { + the_node_type.add_eventin( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_layer_node::remove_children_listener>( + &cad_layer_node::remove_children_listener_))); + } else if (*interface == *++supported_interface) { + the_node_type.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_layer_node::children_exposedfield>( + &cad_layer_node::children_)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + cad_layer_node::children_exposedfield>( + &cad_layer_node::children_)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + cad_layer_node::children_exposedfield>( + &cad_layer_node::children_))); + } else if (*interface == *++supported_interface) { + the_node_type.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + abstract_node<cad_layer_node>::exposedfield<sfnode> >( + &cad_layer_node::metadata)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + abstract_node<cad_layer_node>::exposedfield<sfnode> >( + &cad_layer_node::metadata)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + abstract_node<cad_layer_node>::exposedfield<sfnode> >( + &cad_layer_node::metadata))); + } else if (*interface == *++supported_interface) { + the_node_type.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + abstract_node<cad_layer_node>::exposedfield<sfstring> >( + &cad_layer_node::name_)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + abstract_node<cad_layer_node>::exposedfield<sfstring> >( + &cad_layer_node::name_)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + abstract_node<cad_layer_node>::exposedfield<sfstring> >( + &cad_layer_node::name_))); + } else if (*interface == *++supported_interface) { + the_node_type.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_layer_node::visible_exposedfield>( + &cad_layer_node::visible_)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + cad_layer_node::visible_exposedfield>( + &cad_layer_node::visible_)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + cad_layer_node::visible_exposedfield>( + &cad_layer_node::visible_))); + } else if (*interface == *++supported_interface) { + the_node_type.add_field( + supported_interface->field_type, + supported_interface->id, + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr<sfvec3f>( + &cad_layer_node::bbox_center_))); + } else if (*interface == *++supported_interface) { + the_node_type.add_field( + supported_interface->field_type, + supported_interface->id, + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr<sfvec3f>( + &cad_layer_node::bbox_size_))); + } + } + return type; + } + + + /** + * @var cad_layer_node::visible_exposedfield cad_layer_node::visible_ + * + * @brief visible exposedField. + */ + + /** + * @class cad_layer_node + * + * @brief Represents CADLayer node instances. + */ + + /** + * @var cad_layer_node::CADLayer_class + * + * @brief Class object for CADLayer nodes. + */ + + /** + * @var cad_layer_node::name_t cad_layer_node::name_ + * + * @brief name exposedField + */ + + /** + * @var cad_layer_node::visible_exposedfield cad_layer_node::visible_ + * + * @brief visible exposedField + */ + + /** + * @brief Process event. + * + * @param choice choice nodes. + * @param timestamp the current time. + * + * @exception std::bad_alloc if memory allocation fails. + */ + void cad_layer_node:: + do_children_event_side_effect(const mfnode &, double) throw (std::bad_alloc) + { + try { + const std::vector<bool> & visible = this->visible_.mfbool::value(); + const mfnode::value_type & all_children = + this->children_.mfnode::value(); + + mfnode::value_type children(visible.size()); + + //add only the visible children + for (size_t i = 0; i < visible.size() && i < all_children.size(); ++i) + { + if (visible[i]) + children.push_back(all_children[i]); + } + + this->current_children_.value(children); + } catch (std::bad_cast & ex) { + OPENVRML_PRINT_EXCEPTION_(ex); + } + } + + /** + * @internal + * + * @class cad_layer_node::visible_exposedfield + * + * @brief choice exposedField implementation. + */ + + /** + * @brief Construct. + * + * @param node cad_layer_node. + */ + cad_layer_node::visible_exposedfield:: + visible_exposedfield(cad_layer_node & node): + node_event_listener(node), + openvrml::event_emitter(static_cast<const field_value &>(*this)), + node_field_value_listener<mfbool>(node), + exposedfield<mfbool>(node) + {} + + /** + * @brief Construct a copy. + * + * @param obj instance to copy. + */ + cad_layer_node::visible_exposedfield:: + visible_exposedfield(const visible_exposedfield & obj) throw (): + openvrml::event_listener(), + node_event_listener(obj.node_event_listener::node()), + openvrml::event_emitter(static_cast<const field_value &>(*this)), + node_field_value_listener<mfbool>(obj.node_event_listener::node()), + exposedfield<openvrml::mfbool>(obj) + {} + + /** + * @brief Destroy. + */ + cad_layer_node::visible_exposedfield:: + ~visible_exposedfield() throw () + {} + + /** + * @brief Polymorphically construct a copy. + * + * @return a copy of the instance. + * + * @exception std::bad_alloc if memory allocation fails. + */ + std::auto_ptr<openvrml::field_value> + cad_layer_node::visible_exposedfield::do_clone() const + throw (std::bad_alloc) + { + return std::auto_ptr<openvrml::field_value>( + new visible_exposedfield(*this)); + } + + /** + * @brief Process event. + * + * @param visible choice nodes. + * @param timestamp the current time. + * + * @exception std::bad_alloc if memory allocation fails. + */ + void + cad_layer_node::visible_exposedfield:: + event_side_effect(const mfbool &, double time) + throw (std::bad_alloc) + { + try { + cad_layer_node & n = + dynamic_cast<cad_layer_node &>( + this->node_event_listener::node()); + n.do_children_event_side_effect(n.children_, time); + } catch (std::bad_cast & ex) { + OPENVRML_PRINT_EXCEPTION_(ex); + } + } + + + /** + * @brief Determine whether the node has been modified. + * + * @return @c true if the node or one of its children has been modified, + * @c false otherwise. + */ + bool cad_layer_node::modified() const + { + if (this->node::modified()) { return true; } + + mfnode::value_type::const_iterator iter = + current_children_.value().begin(); + for (; iter != current_children_.value().end(); ++iter) + { + if ((*iter)->modified()) + return true; + } + return false; + } + + /** + * @brief Render the node. + * + * The child corresponding to @a whichChoice is rendered. Nothing is + * rendered if @a whichChoice is -1. + * + * @param viewer a Viewer. + * @param context a rendering context. + */ + void + cad_layer_node:: + do_render_child(openvrml::viewer & viewer, const rendering_context context) + { + mfnode::value_type::const_iterator iter = + current_children_.value().begin(); + for (; iter != current_children_.value().end(); ++iter) + { + child_node * const child = node_cast<child_node *>(iter->get()); + if (child) { child->render_child(viewer, context); } + } + + this->node::modified(false); + } + + /** + * @brief Get the children in the scene graph. + * + * @return the child nodes in the scene graph. + */ + const std::vector<boost::intrusive_ptr<openvrml::node> > & + cad_layer_node::do_children() const throw () + { + return this->current_children_.value(); + } + + /** + * @brief Recalculate the bounding volume. + */ + void cad_layer_node::recalc_bsphere() + { + this->bsphere = bounding_sphere(); + + mfnode::value_type::const_iterator iter = + current_children_.value().begin(); + for (; iter != current_children_.value().end(); ++iter) + { + bounded_volume_node * bounded_volume = + node_cast<bounded_volume_node *>(iter->get()); + + if (bounded_volume) { + const openvrml::bounding_volume & ci_bv = + bounded_volume->bounding_volume(); + this->bsphere.extend(ci_bv); + } + } + this->bounding_volume_dirty(false); + } + + /** + * @brief Construct. + * + * @param type the node_type associated with this node. + * @param scope the scope to which the node belongs. + */ + cad_layer_node:: + cad_layer_node(const node_type & type, + const boost::shared_ptr<openvrml::scope> & scope): + node(type, scope), + bounded_volume_node(type, scope), + child_node(type, scope), + grouping_node(type, scope), + grouping_node_base<self_t>(type, scope), + name_(*this), + visible_(*this) + {} + + /** + * @brief Destroy. + */ + cad_layer_node::~cad_layer_node() throw () + {} + + + class OPENVRML_LOCAL cad_assembly_node : + public grouping_node_base<cad_assembly_node> { + friend class cad_assembly_class; + + //for CADAssembly node + exposedfield<sfstring> name_; + + public: + cad_assembly_node(const node_type & type, + const boost::shared_ptr<openvrml::scope> & scope); + virtual ~cad_assembly_node() throw (); + }; + + /** + * @brief @c node_class identifier. + */ + const char * const cad_assembly_class::id = + "urn:X-openvrml:node:CADAssembly"; + + /** + * @brief Construct. + * + * @param browser the @c browser associated with this @c node_class object. + */ + cad_assembly_class::cad_assembly_class(openvrml::browser & browser): + node_class(cad_layer_class::id, browser) + {} + + /** + * @brief Destroy. + */ + cad_assembly_class::~cad_assembly_class() throw () {} + + /** + * @brief Create a node_type. + * + * @param id the name for the new node_type. + * @param interfaces the interfaces for the new node_type. + * + * @return a boost::shared_ptr<node_type> to a node_type capable of + * creating Group nodes. + * + * @exception unsupported_interface if @p interfaces includes an interface + * not supported by cad_assembly_class. + * @exception std::bad_alloc if memory allocation fails. + */ + const boost::shared_ptr<openvrml::node_type> + cad_assembly_class:: + do_create_type(const std::string & id, + const node_interface_set & interfaces) const + throw (unsupported_interface, std::bad_alloc) + { + typedef boost::array<node_interface, 7> supported_interfaces_t; + static const supported_interfaces_t supported_interfaces = { + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "addChildren"), + node_interface(node_interface::eventin_id, + field_value::mfnode_id, + "removeChildren"), + node_interface(node_interface::exposedfield_id, + field_value::mfnode_id, + "children"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxCenter"), + node_interface(node_interface::field_id, + field_value::sfvec3f_id, + "bboxSize"), + node_interface(node_interface::exposedfield_id, + field_value::sfnode_id, + "metadata"), + node_interface(node_interface::exposedfield_id, + field_value::sfstring_id, + "name") + }; + + typedef node_type_impl<cad_assembly_node> node_type_t; + + const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); + node_type_t & theNodeType = static_cast<node_type_t &>(*type); + for (node_interface_set::const_iterator interface(interfaces.begin()); + interface != interfaces.end(); + ++interface) { + supported_interfaces_t::const_iterator supported_interface = + supported_interfaces.begin() - 1; + if (*interface == *++supported_interface) { + theNodeType.add_eventin( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_assembly_node::add_children_listener>( + &cad_assembly_node::add_children_listener_))); + } else if (*interface == *++supported_interface) { + theNodeType.add_eventin( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_assembly_node::remove_children_listener>( + &cad_assembly_node::remove_children_listener_))); + } else if (*interface == *++supported_interface) { + theNodeType.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + cad_assembly_node::children_exposedfield>( + &cad_assembly_node::children_)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + cad_assembly_node::children_exposedfield>( + &cad_assembly_node::children_)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + cad_assembly_node::children_exposedfield>( + &cad_assembly_node::children_))); + } else if (*interface == *++supported_interface) { + theNodeType.add_field( + supported_interface->field_type, + supported_interface->id, + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr<sfvec3f>( + &cad_assembly_node::bbox_center_))); + } else if (*interface == *++supported_interface) { + theNodeType.add_field( + supported_interface->field_type, + supported_interface->id, + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr<sfvec3f>( + &cad_assembly_node::bbox_size_))); + } else if (*interface == *++supported_interface) { + theNodeType.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + abstract_node<cad_assembly_node>::exposedfield<sfnode> >( + &cad_assembly_node::metadata)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + abstract_node<cad_assembly_node>::exposedfield<sfnode> >( + &cad_assembly_node::metadata)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + abstract_node<cad_assembly_node>::exposedfield<sfnode> >( + &cad_assembly_node::metadata))); + } else if (*interface == *++supported_interface) { + theNodeType.add_exposedfield( + supported_interface->field_type, + supported_interface->id, + node_type_t::event_listener_ptr_ptr( + new node_type_t::event_listener_ptr< + abstract_node<cad_assembly_node>::exposedfield<sfstring> > + (&cad_assembly_node::name_)), + node_type_t::field_ptr_ptr( + new node_type_t::field_ptr< + abstract_node<cad_assembly_node>::exposedfield<sfstring> > + (&cad_assembly_node::name_)), + node_type_t::event_emitter_ptr_ptr( + new node_type_t::event_emitter_ptr< + abstract_node<cad_assembly_node>::exposedfield<sfstring> > + (&cad_assembly_node::name_))); + } else { + throw unsupported_interface(*interface); + } + } + return type; + } + + /** + * @class cad_assembly_node + * + * @brief Represents Group node instances. + */ + + /** + * @var cad_assembly_node::cad_assembly_class + * + * @brief Class object for Group nodes. + */ + + /** + * @brief Construct. + */ + cad_assembly_node:: + cad_assembly_node(const node_type & type, + const boost::shared_ptr<openvrml::scope> & scope): + node(type, scope), + bounded_volume_node(type, scope), + child_node(type, scope), + grouping_node(type, scope), + grouping_node_base<cad_assembly_node>(type, scope), + name_(*this) + {} + + /** + * @brief Destroy. + */ + cad_assembly_node::~cad_assembly_node() throw () + {} + + } --- NEW FILE: x3d_cad_geometry.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // OpenVRML // // Copyright 2006 Braden McDaniel // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # ifdef HAVE_CONFIG_H # include <config.h> # endif # include <boost/array.hpp> # include <private.h> # include "browser.h" # include "node_impl_util.h" # include "x3d_cad_geometry.h" using namespace openvrml; using namespace openvrml::node_impl_util; using namespace std; namespace { /** * @brief Class object for CADFace nodes. */ class OPENVRML_LOCAL cad_face_class : public node_class { public: static const char * const id; explicit cad_face_class(openvrml::browser & browser); virtual ~cad_face_class() OPENVRML_NOTHROW; private: virtual const boost::shared_ptr<node_type> do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; /** * @brief Class object for IndexedQuadSet and QuadSet nodes. */ class OPENVRML_LOCAL quad_set_class : public node_class { public: static const char * const id; explicit quad_set_class(openvrml::browser & browser); virtual ~quad_set_class() OPENVRML_NOTHROW; private: virtual const boost::shared_ptr<node_type> do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc); }; } void register_cad_geometry_node_classes(openvrml::browser & b) { using openvrml::node_class; using boost::shared_ptr; b.add_node_class(cad_face_class::id, shared_ptr<node_class>(new cad_face_class(b))); //NOTE: This has been moved to vrml97node.cpp for the time being. //b.add_node_class("urn:X-openvrml:node:CADLayer", // shared_ptr<node_class>(new cad_layer_class(b))); b.add_node_class(quad_set_class::id, shared_ptr<node_class>(new quad_set_class(b))); } namespace { using namespace openvrml_; class OPENVRML_LOCAL cad_face_node : public abstract_node<cad_face_node>, public grouping_node { friend class cad_face_class; exposedfield<sfstring> name_; exposedfield<sfnode> shape_; //used by do_children to return the shape std::vector<boost::intrusive_ptr<node> > children_; public: cad_face_node(const node_type & type, const boost::shared_ptr<openvrml::scope> & scope); virtual ~cad_face_node() OPENVRML_NOTHROW; virtual bool modified() const; protected: virtual const openvrml::bounding_volume & do_bounding_volume() const; virtual const std::vector<boost::intrusive_ptr<node> > & do_children() const OPENVRML_NOTHROW; }; class OPENVRML_LOCAL quad_set_node : public abstract_node<quad_set_node>, public geometry_node { friend class quad_set_class; class set_index_listener : public event_listener_base<self_t>, public mfint32_listener { public: explicit set_index_listener(self_t & node); virtual ~set_index_listener() OPENVRML_NOTHROW; private: virtual void do_process_event(const mfint32 & fraction, double timestamp) OPENVRML_THROW1(std::bad_alloc); }; set_index_listener set_index_listener_; exposedfield<sfnode> color_; exposedfield<sfnode> coord_; exposedfield<sfnode> normal_; exposedfield<sfnode> tex_coord_; sfbool ccw_; sfbool color_per_vertex_; sfbool normal_per_vertex_; sfbool solid_; mfint32 index_; bounding_sphere bsphere; public: quad_set_node(const node_type & type, const boost::shared_ptr<openvrml::scope> & scope); virtual ~quad_set_node() OPENVRML_NOTHROW; virtual const color_node * color() const OPENVRML_NOTHROW; virtual bool modified() const; private: virtual const openvrml::bounding_volume & do_bounding_volume() const; virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, rendering_context context); void recalc_bsphere(); }; /** * @brief @c node_class identifier. */ const char * const cad_face_class::id = "urn:X-openvrml:node:CADFace"; /** * @brief Construct. * * @param browser the browser associated with this cad_face_class. */ cad_face_class::cad_face_class(openvrml::browser & browser): node_class(cad_face_class::id, browser) {} /** * @brief Destroy. */ cad_face_class::~cad_face_class() OPENVRML_NOTHROW {} /** * @brief Create a node_type. * * @param id the name for the new node_type. * @param interfaces the interfaces for the new node_type. * * @return a node_type_ptr to a node_type capable of creating CADFace nodes. * * @exception unsupported_interface if @p interfaces includes an interface * not supported by cad_face_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> cad_face_class::do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { typedef boost::array<node_interface, 3> supported_interfaces_t; static const supported_interfaces_t supported_interfaces = { node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "metadata"), node_interface(node_interface::exposedfield_id, field_value::sfstring_id, "name"), node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "shape") }; typedef node_type_impl<cad_face_node> node_type_t; const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); node_type_t & the_node_type = static_cast<node_type_t &>(*type); for (node_interface_set::const_iterator interface(interfaces.begin()); interface != interfaces.end(); ++interface) { supported_interfaces_t::const_iterator supported_interface = supported_interfaces.begin() - 1; if (*interface == *++supported_interface) { the_node_type.add_exposedfield( supported_interface->field_type, supported_interface->id, node_type_t::event_listener_ptr_ptr( new node_type_t::event_listener_ptr< abstract_node<cad_face_node>::exposedfield<sfnode> >( &cad_face_node::metadata)), node_type_t::field_ptr_ptr( new node_type_t::field_ptr< abstract_node<cad_face_node>::exposedfield<sfnode> >( &cad_face_node::metadata)), node_type_t::event_emitter_ptr_ptr( new node_type_t::event_emitter_ptr< abstract_node<cad_face_node>::exposedfield<sfnode> >( &cad_face_node::metadata))); } else if (*interface == *++supported_interface) { the_node_type.add_exposedfield( supported_interface->field_type, supported_interface->id, node_type_t::event_listener_ptr_ptr( new node_type_t::event_listener_ptr< abstract_node<cad_face_node>::exposedfield<sfstring> >( &cad_face_node::name_)), node_type_t::field_ptr_ptr( new node_type_t::field_ptr< abstract_node<cad_face_node>::exposedfield<sfstring> >( &cad_face_node::name_)), node_type_t::event_emitter_ptr_ptr( new node_type_t::event_emitter_ptr< abstract_node<cad_face_node>::exposedfield<sfstring> >( &cad_face_node::name_))); } else if (*interface == *++supported_interface) { the_node_type.add_exposedfield( supported_interface->field_type, supported_interface->id, node_type_t::event_listener_ptr_ptr( new node_type_t::event_listener_ptr< abstract_node<cad_face_node>::exposedfield<sfnode> >( &cad_face_node::shape_)), node_type_t::field_ptr_ptr( new node_type_t::field_ptr< abstract_node<cad_face_node>::exposedfield<sfnode> >( &cad_face_node::shape_)), node_type_t::event_emitter_ptr_ptr( new node_type_t::event_emitter_ptr< abstract_node<cad_face_node>::exposedfield<sfnode> >( &cad_face_node::shape_))); } else { throw unsupported_interface(*interface); } } return type; } /** * @brief @c node_class identifier. */ const char * const quad_set_class::id = "urn:X-openvrml:node:QuadSet"; /** * @brief Construct. * * @param browser the browser associated with this quad_set_class. */ quad_set_class::quad_set_class(openvrml::browser & browser): node_class(cad_face_class::id, browser) {} /** * @brief Destroy. */ quad_set_class::~quad_set_class() OPENVRML_NOTHROW {} /** * @brief Create a node_type. * * @param id the name for the new node_type. * @param interfaces the interfaces for the new node_type. * * @return a node_type_ptr to a node_type capable of creating IndexedQuadSet nodes. * * @exception unsupported_interface if @p interfaces includes an interface * not supported by quad_set_class. * @exception std::bad_alloc if memory allocation fails. */ const boost::shared_ptr<openvrml::node_type> quad_set_class::do_create_type(const std::string & id, const node_interface_set & interfaces) const OPENVRML_THROW2(unsupported_interface, std::bad_alloc) { typedef boost::array<node_interface, 11> supported_interfaces_t; static const supported_interfaces_t supported_interfaces = { node_interface(node_interface::eventin_id, field_value::mfint32_id, "set_index"), node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "color"), node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "coord"), node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "metadata"), node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "normal"), node_interface(node_interface::exposedfield_id, field_value::sfnode_id, "texCoord"), node_interface(node_interface::field_id, field_value::sfbool_id, "ccw"), node_interface(node_interface::field_id, field_value::sfbool_id, "colorPerVertex"), node_interface(node_interface::field_id, field_value::sfbool_id, "normalPerVertex"), node_interface(node_interface::field_id, field_value::sfbool_id, "solid"), node_interface(node_interface::field_id, field_value::mfint32_id, "index") }; typedef node_type_impl<quad_set_node> node_type_t; const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); node_type_t & the_node_type = static_cast<node_type_t &>(*type); for (node_interface_set::const_iterator interface(interfaces.begin()); interface != interfaces.end(); ++interface) { supported_interfaces_t::const_iterator supported_interface = supported_interfaces.begin() - 1; if (*interface == *++supported_interface) { the_node_type.add_eventin( supported_interface->field_type, supported_interface->id, node_type_t::event_listener_ptr_ptr( new node_type_t::event_listener_ptr< quad_set_node::set_index_listener>( &quad_set_node::set_index_listener_))); } else if (*interface == *++supported_interface) { the_node_type.add_exposedfield( supported_interface->field_type, supported_interface->id, node_type_t::event_listener_ptr_ptr( new node_type_t::event_listener_ptr< abstract_node<quad_set_node>::exposedfield<sfnode> >( &quad_set_node::color_)), node_type_t::field_ptr_ptr( new node_type_t::field_ptr< abstract_node<quad_set_node>::exposedfield<sfnode> >( &quad_set_node::color_)), node_type_t::event_emitter_ptr_ptr( new node_type_t::event_emitter_ptr< abstract_node<quad_set_node>::exposedfield<sfnode> >( &quad_set_node::color_))); } else if (*interface == *++supported_interface) { the_node_type.add_exposedfield( supported_interface->field_type, supported_interface->id, node_type_t::event_listener_ptr_ptr( new node_type_t::event_listener_ptr< abstract_node<quad_set_node>::exposedfield<sfnode> >( &quad_set_node::coord_)), node_type_t::field_ptr_ptr( new node_type_t::field_ptr< abstract_node<quad_set_node>::exposedfield<sfnode> >( &quad_set_node::coord_)), node_type_t::event_emitter_ptr_ptr( new node_type_t::event_emitter_ptr< abstract_node<quad_set_node>::exposedfield<sfnode> >( &quad_set_node::coord_))); } else if (*interface == *++s... [truncated message content] |
From: Braden M. <br...@us...> - 2006-05-17 07:59:52
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24525 Modified Files: ChangeLog Log Message: Added support for creating scene graphs with CADGeomentry component nodes. From Andrew Grieve <sg...@us...> Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1247 retrieving revision 1.1248 diff -C2 -d -r1.1247 -r1.1248 *** ChangeLog 17 May 2006 03:57:08 -0000 1.1247 --- ChangeLog 17 May 2006 07:59:49 -0000 1.1248 *************** *** 1,2 **** --- 1,36 ---- + 2006-05-17 Braden McDaniel <br...@en...> + + Added support for creating scene graphs with CADGeomentry + component nodes. + From Andrew Grieve <sg...@us...> + + * src/libopenvrml/Makefile.am + (openvrml_include_HEADERS): Added openvrml/x3d_cad_geometry.h. + (openvrml_la_SOURCES): Added openvrml/x3d_cad_geometry.cpp. + * src/libopenvrml/openvrml/browser.cpp + (register_node_classes(openvrml::browser &)): Register the + CADGeometry profile node implementations. + (x3d_cad_geometry_component): Added class correponding to the X3D + CADGeometry component. + (x3d_cad_geometry_component::id): Component id. + (x3d_cad_geometry_component::support_level() const): The supported + component level. + (x3d_cad_geometry_component::do_add_to_scope(const + openvrml::browser &, openvrml::scope &, size_t) const): Add the + node_types defined for the CADGeometry component to the scope. + (component_registry::component_registry()): Register + x3d_cad_geometry_component. + * src/libopenvrml/openvrml/vrml97node.cpp + (cad_layer_class): Added node_class for CADLayer nodes. + (cad_assembly_class): Added node_class for CADAssembly nodes. + (register_vrml97_node_classes(openvrml::browser &)): Register + cad_layer_class and cad_assembly_class. + (cad_layer_node): Added CADLayer node instance class. + (cad_assembly_node): Added CADAssembly node instance class. + * src/libopenvrml/openvrml/x3d_cad_geometry.cpp: Added file; + implementations of X3D CADGeometry component nodes. + * src/libopenvrml/openvrml/x3d_cad_geometry.h: Added file; expose + node_class registration function. + 2006-05-16 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-05-17 03:57:11
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30530/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Clear the nodes_ and meta_ members before calling parse_vrml. From Andrew Grieve <sg...@us...> Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** browser.cpp 12 May 2006 22:16:16 -0000 1.174 --- browser.cpp 17 May 2006 03:57:08 -0000 1.175 *************** *** 7537,7540 **** --- 7537,7542 ---- meta_lock(this->meta_mutex_); + this->nodes_.clear(); + this->meta_.clear(); this->url_ = in.url(); parse_vrml(in, in.url(), in.type(), *this, this->nodes_, this->meta_); |
From: Braden M. <br...@us...> - 2006-05-17 03:57:11
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30530 Modified Files: ChangeLog Log Message: Clear the nodes_ and meta_ members before calling parse_vrml. From Andrew Grieve <sg...@us...> Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1246 retrieving revision 1.1247 diff -C2 -d -r1.1246 -r1.1247 *** ChangeLog 17 May 2006 01:01:42 -0000 1.1246 --- ChangeLog 17 May 2006 03:57:08 -0000 1.1247 *************** *** 1,4 **** --- 1,11 ---- 2006-05-16 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp + (openvrml::scene::load(resource_istream &)): Clear the nodes_ and + meta_ members before calling parse_vrml. + From Andrew Grieve <sg...@us...> + + 2006-05-16 Braden McDaniel <br...@en...> + Consolidated JavaScript SFVec2f/SFVec2d and SFVec3d/SFVec3d method implementations in templates. |
From: Braden M. <br...@us...> - 2006-05-17 01:01:47
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28142/src/libopenvrml/openvrml Modified Files: script.cpp Log Message: Consolidated JavaScript SFVec2f/SFVec2d and SFVec3d/SFVec3d method implementations in templates. Index: script.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/script.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** script.cpp 16 May 2006 07:29:13 -0000 1.71 --- script.cpp 17 May 2006 01:01:43 -0000 1.72 *************** *** 2483,2500 **** }; ! class OPENVRML_LOCAL SFVec2f : public sfield { public: - static JSClass jsclass; - static JSObject * initClass(JSContext * cx, JSObject * obj) OPENVRML_NOTHROW; - static JSBool toJsval(const openvrml::vec2f & vec2f, - JSContext * cx, JSObject * obj, jsval * rval) [...3049 lines suppressed...] - JSObject * const robj = - JS_ConstructObject(cx, &SFVec3d::jsclass, proto, parent); - if (!robj) { return JS_FALSE; } - - assert(JS_GetPrivate(cx, robj)); - sfield::sfdata & robj_sfdata = - *static_cast<sfield::sfdata *>(JS_GetPrivate(cx, robj)); - openvrml::sfvec3f & resultVec = - *boost::polymorphic_downcast<openvrml::sfvec3f *>( - &robj_sfdata.field_value()); - - resultVec.value(thisVec.value() - argVec.value()); - - *rval = OBJECT_TO_JSVAL(robj); - return JS_TRUE; - } - MField::MFData::MFData(JsvalArray::size_type size): array(size) --- 7283,7286 ---- |
From: Braden M. <br...@us...> - 2006-05-17 01:01:47
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28142 Modified Files: ChangeLog Log Message: Consolidated JavaScript SFVec2f/SFVec2d and SFVec3d/SFVec3d method implementations in templates. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1245 retrieving revision 1.1246 diff -C2 -d -r1.1245 -r1.1246 *** ChangeLog 16 May 2006 07:29:13 -0000 1.1245 --- ChangeLog 17 May 2006 01:01:42 -0000 1.1246 *************** *** 1,4 **** --- 1,19 ---- 2006-05-16 Braden McDaniel <br...@en...> + Consolidated JavaScript SFVec2f/SFVec2d and SFVec3d/SFVec3d method + implementations in templates. + + * src/libopenvrml/openvrml/script.cpp + (js_::sfvec2_jsobject<SFVec2>): Added class template for + implementing SFVec2f/SFVec2d methods. + (js_::SFVec2f): Moved bulk of logic to sfvec2_jsobject template. + (js_::SFVec2d): Moved bulk of logic to sfvec2_jsobject template. + (js_::sfvec3_jsobject<SFVec3>): Added class template for + implementing SFVec3f/SFVec3d methods. + (js_::SFVec3f): Moved bulk of logic to sfvec3_jsobject template. + (js_::SFVec3d): Moved bulk of logic to sfvec3_jsobject template. + + 2006-05-16 Braden McDaniel <br...@en...> + Use JS_ConvertArguments to convert/check argument values. |
From: Braden M. <br...@us...> - 2006-05-16 07:29:18
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20755/src/libopenvrml/openvrml Modified Files: script.cpp Log Message: Use JS_ConvertArguments to convert/check argument values. Index: script.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/script.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** script.cpp 8 May 2006 08:49:01 -0000 1.70 --- script.cpp 16 May 2006 07:29:13 -0000 1.71 *************** *** 2371,2375 **** OPENVRML_NOTHROW; static JSBool initObject(JSContext * cx, JSObject * obj, ! uintN argc, jsval * argv) OPENVRML_NOTHROW; static JSBool getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp) OPENVRML_NOTHROW; --- 2371,2376 ---- OPENVRML_NOTHROW; static JSBool initObject(JSContext * cx, JSObject * obj, ! const jsdouble (&rgb)[3]) ! OPENVRML_NOTHROW; [...2406 lines suppressed...] ! const uintN argc, jsval * const argv, jsval * const rval) *************** *** 11054,11059 **** // Make sure argument is an SFVec3f. // ! JSObject * arg_obj; ! if (JS_ValueToObject(cx, argv[0], &arg_obj)) { return JS_FALSE; } if (!JS_InstanceOf(cx, arg_obj, &SFVec3f::jsclass, argv)) { return JS_FALSE; --- 11151,11158 ---- // Make sure argument is an SFVec3f. // ! JSObject * arg_obj = 0; ! if (JS_ConvertArguments(cx, argc, argv, "o", &arg_obj)) { ! return JS_FALSE; ! } if (!JS_InstanceOf(cx, arg_obj, &SFVec3f::jsclass, argv)) { return JS_FALSE; |
From: Braden M. <br...@us...> - 2006-05-16 07:29:17
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20755 Modified Files: ChangeLog Log Message: Use JS_ConvertArguments to convert/check argument values. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1244 retrieving revision 1.1245 diff -C2 -d -r1.1244 -r1.1245 *** ChangeLog 15 May 2006 05:51:59 -0000 1.1244 --- ChangeLog 16 May 2006 07:29:13 -0000 1.1245 *************** *** 1,2 **** --- 1,142 ---- + 2006-05-16 Braden McDaniel <br...@en...> + + Use JS_ConvertArguments to convert/check argument values. + + * src/libopenvrml/openvrml/script.cpp + (SFColor::initClass(JSContext *, JSObject *)): Call initObject + with the default color values. + (SFColor::construct(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert the arguments with JS_ConvertArguments; pass the + jsdouble array to initObject. + (SFColor::initObject(JSContext *, JSObject *, const + jsdouble(&)[3])): Just check that the jsdouble values are within + the acceptable range. + (SFColor::setProperty(JSContext *, JSObject *, jsval, jsval *)): + Report errors and bail if the index or value is out of range. + (SFColor::setHSV(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert the arguments with JS_ConvertArguments; report + an error and bail if the arguments are not within the acceptable + ranges. + (SFImage::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (SFImage::construct(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert the arguments with JS_ConvertArguments; confirm + that the fourth argument is an MFInt32; changed call to + initObject. + (SFImage::initObject(JSContext *, JSObject *, uint32, uint32, + uint32, JSObject *)): Removed argument conversion; changed call to + initObject. + (SFNode::construct(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments; changed call + to initObject. + (SFNode::initObject(JSContext *, JSObject *, JSString *)): Removed + argc assertion. + (SFRotation::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (SFRotation::construct(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Moved argument checking/conversion logic here from + initObject; changed call to initObject. + (SFRotation::initObject(JSContext *, JSObject *, const + jsdouble(&)[4])): Print an error message and bail if the axis + component is not normalized. + (SFRotation::setProperty(JSContext *, JSObject *, jsval, jsval*)): + Print an error message and bail if the resulting axis is not + normalized. + (SFRotation::multiply(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFRotation::multVec(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFRotation::setAxis(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFRotation::slerp(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Use JS_ConvertArguments to convert arguments. + (SFVec2f::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (SFVec2f::constructor(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFVec2f::initObject(JSContext *, JSObject *, const + jsdouble(&)[2])): Moved argument conversion to constructor. + (SFVec2f::add(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec2f::divide(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec2f::dot(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec2f::multiply(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec2f::subtract(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec2d::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (SFVec2d::constructor(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFVec2d::initObject(JSContext *, JSObject *, const + jsdouble(&)[2])): Moved argument conversion to constructor. + (SFVec2d::add(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec2d::divide(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec2d::dot(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec2d::multiply(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec2d::subtract(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec3f::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (SFVec3f::constructor(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFVec3f::initObject(JSContext *, JSObject *, const + jsdouble(&)[3])): Moved argument conversion to constructor. + (SFVec3f::add(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec3f::cross(JSContext *, JSObject *, uintN, jsval *, jsval*)): + Convert arguments with JS_ConvertArguments. + (SFVec3f::divide(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec3f::dot(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec3f::multiply(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec3f::subtract(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec3d::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (SFVec3d::constructor(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Use JS_ConvertArguments to convert arguments. + (SFVec3d::initObject(JSContext *, JSObject *, const + jsdouble(&)[3])): Moved argument conversion to constructor. + (SFVec3d::add(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec3d::cross(JSContext *, JSObject *, uintN, jsval *, jsval*)): + Convert arguments with JS_ConvertArguments. + (SFVec3d::divide(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec3d::dot(JSContext *, JSObject *, uintN, jsval *, jsval *)): + Convert arguments with JS_ConvertArguments. + (SFVec3d::multiply(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (SFVec3d::subtract(JSContext *, JSObject *, uintN, jsval *, + jsval*)): Convert arguments with JS_ConvertArguments. + (VrmlMatrix::initClass(JSContext *, JSObject *)): Changed call to + initObject. + (VrmlMatrix::construct(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Convert arguments with JS_ConvertArguments; changed + call to initObject. + (VrmlMatrix::initObject(JSContext *, JSObject *, const + jsdouble(&)[16])): Moved argument conversion to constructor. + (VrmlMatrix::setTransform(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Convert arguments with JS_ConvertArguments. + (VrmlMatrix::getTransform(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Convert arguments with JS_ConvertArguments. + (VrmlMatrix::multLeft(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Convert arguments with JS_ConvertArguments. + (VrmlMatrix::multRight(JSContext *, JSObject *, uintN, jsval *, + jsval *)): Convert arguments with JS_ConvertArguments. + (VrmlMatrix::multVecMatrix(JSContext *, JSObject *, uintN, jsval*, + jsval *)): Convert arguments with JS_ConvertArguments. + (VrmlMatrix::multMatrixVec(JSContext *, JSObject *, uintN, jsval*, + jsval *)): Convert arguments with JS_ConvertArguments. + 2006-05-15 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-05-15 05:52:32
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11704/mozilla-plugin/src/openvrml-player Modified Files: gtkvrmlbrowser.cpp player.cpp plugin_streambuf.cpp plugin_streambuf.h Log Message: Set the plugin_resource_istream initial state to invalid if the Web browser's get-url function fails. This means that the child process blocks until the Web browser has informed it of the validity of the get-url operation. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** player.cpp 5 Feb 2006 22:15:42 -0000 1.23 --- player.cpp 15 May 2006 05:51:59 -0000 1.24 *************** *** 74,78 **** string command; command_line_stream >> command; ! if (command == "new-stream") { using boost::shared_ptr; --- 74,89 ---- string command; command_line_stream >> command; ! if (command == "get-url-result") { ! using boost::shared_ptr; ! ! std::string url; ! int result; ! command_line_stream >> url >> result; ! ! shared_ptr<plugin_streambuf> streambuf = ! uninitialized_plugin_streambuf_map_.find(url); ! assert(streambuf); ! streambuf->set_get_url_result(result); ! } else if (command == "new-stream") { using boost::shared_ptr; Index: plugin_streambuf.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/plugin_streambuf.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** plugin_streambuf.cpp 5 Feb 2006 05:41:30 -0000 1.3 --- plugin_streambuf.cpp 15 May 2006 05:51:59 -0000 1.4 *************** *** 24,27 **** --- 24,28 ---- openvrml_player::plugin_streambuf:: plugin_streambuf(const std::string & requested_url): + get_url_result_(-1), initialized_(false), url_(requested_url), *************** *** 37,40 **** --- 38,58 ---- } + void openvrml_player::plugin_streambuf::set_get_url_result(const int result) + { + boost::mutex::scoped_lock lock(this->mutex_); + assert(this->get_url_result_ == -1); + this->get_url_result_ = result; + this->received_get_url_result_.notify_all(); + } + + int openvrml_player::plugin_streambuf::get_url_result() const + { + boost::mutex::scoped_lock lock(this->mutex_); + while (this->get_url_result_ == -1) { + this->received_get_url_result_.wait(lock); + } + return this->get_url_result_; + } + void openvrml_player::plugin_streambuf::init(const size_t stream_id, const std::string & received_url, Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/gtkvrmlbrowser.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gtkvrmlbrowser.cpp 5 Feb 2006 22:15:42 -0000 1.1 --- gtkvrmlbrowser.cpp 15 May 2006 05:51:59 -0000 1.2 *************** *** 183,187 **** } ! void gtk_vrml_browser_class_init(GtkVrmlBrowserClass * klass) {} --- 183,187 ---- } ! void gtk_vrml_browser_class_init(GtkVrmlBrowserClass *) {} *************** *** 512,515 **** --- 512,523 ---- 0); g_io_channel_flush(this->request_channel_, 0); + + // + // This blocks until we know the result of NPN_GetURL. + // + const int get_url_result = this->streambuf_->get_url_result(); + if (get_url_result != 0) { + this->setstate(std::ios_base::failbit); + } } Index: plugin_streambuf.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/plugin_streambuf.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** plugin_streambuf.h 14 Jan 2006 06:04:56 -0000 1.2 --- plugin_streambuf.h 15 May 2006 05:51:59 -0000 1.3 *************** *** 40,43 **** --- 40,45 ---- mutable boost::mutex mutex_; + int get_url_result_; + mutable boost::condition received_get_url_result_; bool initialized_; mutable boost::condition streambuf_initialized_; *************** *** 53,56 **** --- 55,60 ---- public: explicit plugin_streambuf(const std::string & requested_url); + void set_get_url_result(int result); + int get_url_result() const; void init(size_t stream_id, const std::string & received_url, |
From: Braden M. <br...@us...> - 2006-05-15 05:52:03
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11704 Modified Files: ChangeLog Log Message: Set the plugin_resource_istream initial state to invalid if the Web browser's get-url function fails. This means that the child process blocks until the Web browser has informed it of the validity of the get-url operation. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1243 retrieving revision 1.1244 diff -C2 -d -r1.1243 -r1.1244 *** ChangeLog 15 May 2006 05:31:45 -0000 1.1243 --- ChangeLog 15 May 2006 05:51:59 -0000 1.1244 *************** *** 1,4 **** --- 1,34 ---- 2006-05-15 Braden McDaniel <br...@en...> + Set the plugin_resource_istream initial state to invalid if the + Web browser's get-url function fails. This means that the child + process blocks until the Web browser has informed it of the + validity of the get-url operation. + + * mozilla-plugin/src/openvrml.cpp + (request_data_available): Write the result of NPN_GetURL to the + command channel. + * mozilla-plugin/src/openvrml-player/gtkvrmlbrowser.cpp + (browser::do_get_resource(const + std::string&)::plugin_resource_istream::plugin_resource_istream(const + std::string &, GIOChannel *)): Set the failbit if the Web + browser's get-url function failed. + * mozilla-plugin/src/openvrml-player/player.cpp + (openvrml_player::command_istream_reader::operator()()): Handle + get-url-result command. + * mozilla-plugin/src/openvrml-player/plugin_streambuf.cpp + (openvrml_player::plugin_streambuf::set_get_url_result(int)): Set + the result of the get-url operation (from the get-url-result + command). + (openvrml_player::plugin_streambuf::get_url_result() const): Get + the result code from the Web browser's get-url operation (via the + get-url-result command). + * mozilla-plugin/src/openvrml-player/plugin_streambuf.h + (openvrml_player::plugin_streambuf): Added get_url_result_ and + received_get_url_result_ members; added set_get_url_result(int) + and get_url_result() member functions. + + 2006-05-15 Braden McDaniel <br...@en...> + Fixes such that failure to launch the subprocess will not crash the Web browser. |
From: Braden M. <br...@us...> - 2006-05-15 05:52:03
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11704/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Set the plugin_resource_istream initial state to invalid if the Web browser's get-url function fails. This means that the child process blocks until the Web browser has informed it of the validity of the get-url operation. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** openvrml.cpp 15 May 2006 05:31:45 -0000 1.31 --- openvrml.cpp 15 May 2006 05:51:59 -0000 1.32 *************** *** 1081,1086 **** openvrml_player_cmd_argv[0] = g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-player"); - openvrml_player_cmd_argv[1] = 0; if (!openvrml_player_cmd_argv[0]) { throw std::bad_alloc(); } } else { GError * error = 0; --- 1081,1086 ---- openvrml_player_cmd_argv[0] = g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-player"); if (!openvrml_player_cmd_argv[0]) { throw std::bad_alloc(); } + openvrml_player_cmd_argv[1] = 0; } else { GError * error = 0; *************** *** 1201,1207 **** } ! gboolean request_data_available(GIOChannel * source, GIOCondition, ! gpointer data) { using std::string; --- 1201,1207 ---- } ! gboolean request_data_available(GIOChannel * const source, GIOCondition, ! const gpointer data) { using std::string; *************** *** 1238,1244 **** string url, target; pluginInstance.request_line >> url >> target; ! NPN_GetURL(pluginInstance.npp, ! url.c_str(), ! target.empty() ? 0 : target.c_str()); } } --- 1238,1255 ---- string url, target; pluginInstance.request_line >> url >> target; ! NPError result = ! NPN_GetURL(pluginInstance.npp, ! url.c_str(), ! target.empty() ? 0 : target.c_str()); ! std::ostringstream command; ! command << "get-url-result " << url << ' ' << result ! << '\n'; ! const ssize_t bytes_written = ! pluginInstance.WriteCommand(command.str()); ! if (bytes_written != command.str().length()) { ! // XXX ! // XXX Do what here? Console message? ! // XXX ! } } } |
From: Braden M. <br...@us...> - 2006-05-15 05:31:48
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5063 Modified Files: ChangeLog Log Message: Fixes such that failure to launch the subprocess will not crash the Web browser. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1242 retrieving revision 1.1243 diff -C2 -d -r1.1242 -r1.1243 *** ChangeLog 15 May 2006 04:44:07 -0000 1.1242 --- ChangeLog 15 May 2006 05:31:45 -0000 1.1243 *************** *** 1,3 **** ! 2006-05-14 Braden McDaniel <br...@en...> Remove the request channel (input) watch when destroying the --- 1,17 ---- ! 2006-05-15 Braden McDaniel <br...@en...> ! ! Fixes such that failure to launch the subprocess will not crash ! the Web browser. ! ! * mozilla-plugin/src/openvrml.cpp ! (PluginInstance::SetWindow(NPWindow &)): Ensure ! openvrml_player_cmd_argv is null-terminated. And ensure its ! contents are allocated in the free store, since this memory will ! be freed. Also, only create the IO channels if executing the ! child process succeeded. ! (PluginInstance::WriteCommand(const std::string &)): Bail if we do ! not have a valid command_channel. ! ! 2006-05-15 Braden McDaniel <br...@en...> Remove the request channel (input) watch when destroying the |
From: Braden M. <br...@us...> - 2006-05-15 05:31:48
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5063/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Fixes such that failure to launch the subprocess will not crash the Web browser. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** openvrml.cpp 15 May 2006 04:44:07 -0000 1.30 --- openvrml.cpp 15 May 2006 05:31:45 -0000 1.31 *************** *** 1077,1084 **** openvrml_player_cmd_argc = 1; openvrml_player_cmd_argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *))); if (!openvrml_player_cmd_argv) { throw std::bad_alloc(); } openvrml_player_cmd_argv[0] = ! OPENVRML_LIBEXECDIR_ "/openvrml-player"; } else { GError * error = 0; --- 1077,1086 ---- openvrml_player_cmd_argc = 1; openvrml_player_cmd_argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *) * 2)); if (!openvrml_player_cmd_argv) { throw std::bad_alloc(); } openvrml_player_cmd_argv[0] = ! g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-player"); ! openvrml_player_cmd_argv[1] = 0; ! if (!openvrml_player_cmd_argv[0]) { throw std::bad_alloc(); } } else { GError * error = 0; *************** *** 1139,1157 **** } g_free(working_directory); g_free(argv); g_strfreev(openvrml_player_cmd_argv); ! this->command_channel = g_io_channel_unix_new(standard_input); ! if (!this->command_channel) { throw std::bad_alloc(); } ! ! this->request_channel = g_io_channel_unix_new(standard_output); ! if (!this->command_channel) { throw std::bad_alloc(); } ! this->request_channel_watch_id = ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } } --- 1141,1164 ---- } + // XXX + // XXX Not the least bit exception-safe. This needs some + // XXX ScopeGuard love. + // XXX g_free(working_directory); g_free(argv); g_strfreev(openvrml_player_cmd_argv); ! if (succeeded) { ! this->command_channel = g_io_channel_unix_new(standard_input); ! if (!this->command_channel) { throw std::bad_alloc(); } + this->request_channel = g_io_channel_unix_new(standard_output); + if (!this->command_channel) { throw std::bad_alloc(); } + this->request_channel_watch_id = + g_io_add_watch(this->request_channel, + G_IO_IN, + request_data_available, + this); + } } } *************** *** 1162,1165 **** --- 1169,1174 ---- ssize_t PluginInstance::WriteCommand(const std::string & command) { + if (!this->command_channel) { return 0; } + gsize bytes_written; GError * error = 0; |
From: Braden M. <br...@us...> - 2006-05-15 04:44:10
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21286 Modified Files: ChangeLog Log Message: Remove the request channel (input) watch when destroying the plug-in instance; otherwise we get a stray call to the watch callback and an (apparently spurious) assertion in glib. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1241 retrieving revision 1.1242 diff -C2 -d -r1.1241 -r1.1242 *** ChangeLog 14 May 2006 20:42:57 -0000 1.1241 --- ChangeLog 15 May 2006 04:44:07 -0000 1.1242 *************** *** 1,4 **** --- 1,19 ---- 2006-05-14 Braden McDaniel <br...@en...> + Remove the request channel (input) watch when destroying the + plug-in instance; otherwise we get a stray call to the watch + callback and an (apparently spurious) assertion in glib. + + * mozilla-plugin/src/openvrml.cpp + (PluginInstance): Added request_channel_watch_id member. + (PluginInstance::PluginInstance()): Initialize + request_channel_watch_id to 0. + (PluginInstance::~PluginInstance()): Remove the request channel + watch callback. + (PluginInstance::SetWindow(NPWindow &)): Store the watch id in the + instance. + + 2006-05-14 Braden McDaniel <br...@en...> + Simplified assertions to guarantee that the rotation axis is a normalized vector. This also accommodates the notion that a |
From: Braden M. <br...@us...> - 2006-05-15 04:44:10
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21286/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Remove the request channel (input) watch when destroying the plug-in instance; otherwise we get a stray call to the watch callback and an (apparently spurious) assertion in glib. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** openvrml.cpp 29 Jan 2006 07:00:59 -0000 1.29 --- openvrml.cpp 15 May 2006 04:44:07 -0000 1.30 *************** *** 66,69 **** --- 66,70 ---- GIOChannel * command_channel; GIOChannel * request_channel; + guint request_channel_watch_id; std::stringstream request_line; nsCOMPtr<VrmlBrowser> scriptablePeer; *************** *** 996,999 **** --- 997,1001 ---- command_channel(0), request_channel(0), + request_channel_watch_id(0), scriptablePeer(new ScriptablePeer(*this)) {} *************** *** 1001,1004 **** --- 1003,1012 ---- PluginInstance::~PluginInstance() throw () { + if (this->request_channel_watch_id) { + const gboolean succeeded = + g_source_remove(this->request_channel_watch_id); + g_assert(succeeded); + } + if (this->request_channel) { GError * error = 0; *************** *** 1140,1147 **** this->request_channel = g_io_channel_unix_new(standard_output); if (!this->command_channel) { throw std::bad_alloc(); } ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } --- 1148,1156 ---- this->request_channel = g_io_channel_unix_new(standard_output); if (!this->command_channel) { throw std::bad_alloc(); } ! this->request_channel_watch_id = ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } |
From: Braden M. <br...@us...> - 2006-05-14 20:43:01
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21719/src/libopenvrml/openvrml Modified Files: basetypes.cpp Log Message: Simplified assertions to guarantee that the rotation axis is a normalized vector. This also accommodates the notion that a vector of length 0 is considered normalized as far as OpenVRML is concerned; that is, calling vec3f::normalize for such a vector returns an identical vector. The VRML97 specification does not make clear that attempting to normalize such a vector should be an error (in, e.g., the ECMAScript binding). Index: basetypes.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** basetypes.cpp 12 May 2006 20:59:44 -0000 1.33 --- basetypes.cpp 14 May 2006 20:42:57 -0000 1.34 *************** *** 2269,2277 **** openvrml::rotation::rotation(const float (&rot)[4]) OPENVRML_NOTHROW { ! # ifndef NDEBUG ! using openvrml_::fequal; ! fequal<float> feq; ! # endif ! assert(feq(vec3f(rot[0], rot[1], rot[2]).length(), 1.0f)); std::copy(rot, rot + 4, this->rot); } --- 2269,2274 ---- openvrml::rotation::rotation(const float (&rot)[4]) OPENVRML_NOTHROW { ! assert(vec3f(rot[0], rot[1], rot[2]) ! == vec3f(rot[0], rot[1], rot[2]).normalize()); std::copy(rot, rot + 4, this->rot); } *************** *** 2293,2301 **** OPENVRML_NOTHROW { ! # ifndef NDEBUG ! using openvrml_::fequal; ! fequal<float> feq; ! # endif ! assert(feq(vec3f(x, y, z).length(), 1.0f)); this->rot[0] = x; this->rot[1] = y; --- 2290,2294 ---- OPENVRML_NOTHROW { ! assert(vec3f(x, y, z) == vec3f(x, y, z).normalize()); this->rot[0] = x; this->rot[1] = y; *************** *** 2315,2323 **** OPENVRML_NOTHROW { ! # ifndef NDEBUG ! using openvrml_::fequal; ! fequal<float> feq; ! # endif ! assert(feq(axis.length(), 1.0f)); this->axis(axis); this->rot[3] = angle; --- 2308,2312 ---- OPENVRML_NOTHROW { ! assert(axis == axis.normalize()); this->axis(axis); this->rot[3] = angle; *************** *** 2516,2524 **** void openvrml::rotation::axis(const vec3f & axis) OPENVRML_NOTHROW { ! # ifndef NDEBUG ! using openvrml_::fequal; ! fequal<float> feq; ! # endif ! assert(feq(axis.length(), 1.0f)); this->rot[0] = axis.x(); this->rot[1] = axis.y(); --- 2505,2509 ---- void openvrml::rotation::axis(const vec3f & axis) OPENVRML_NOTHROW { ! assert(axis == axis.normalize()); this->rot[0] = axis.x(); this->rot[1] = axis.y(); |
From: Braden M. <br...@us...> - 2006-05-14 20:43:01
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21719 Modified Files: ChangeLog Log Message: Simplified assertions to guarantee that the rotation axis is a normalized vector. This also accommodates the notion that a vector of length 0 is considered normalized as far as OpenVRML is concerned; that is, calling vec3f::normalize for such a vector returns an identical vector. The VRML97 specification does not make clear that attempting to normalize such a vector should be an error (in, e.g., the ECMAScript binding). Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1240 retrieving revision 1.1241 diff -C2 -d -r1.1240 -r1.1241 *** ChangeLog 13 May 2006 19:40:34 -0000 1.1240 --- ChangeLog 14 May 2006 20:42:57 -0000 1.1241 *************** *** 1,2 **** --- 1,21 ---- + 2006-05-14 Braden McDaniel <br...@en...> + + Simplified assertions to guarantee that the rotation axis is a + normalized vector. This also accommodates the notion that a + vector of length 0 is considered normalized as far as OpenVRML is + concerned; that is, calling vec3f::normalize for such a vector + returns an identical vector. The VRML97 specification does not + make clear that attempting to normalize such a vector should be an + error (in, e.g., the ECMAScript binding). + + * src/libopenvrml/openvrml/basetypes.cpp + (openvrml::rotation::rotation(const float (&)[4]): Simplified + assertion. + (openvrml::rotation::rotation(float, float, float, float): + Simplified assertion. + (openvrml::rotation::rotation(const vec3f &, float): Simplified + assertion. + (openvrml::rotation::axis(const vec3f &): Simplified assertion. + 2006-05-13 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-05-13 19:40:37
|
Update of /cvsroot/openvrml/openvrml/models In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18582/models Modified Files: rotation_toy.wrl Log Message: Normalize the rotation axis. Index: rotation_toy.wrl =================================================================== RCS file: /cvsroot/openvrml/openvrml/models/rotation_toy.wrl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** rotation_toy.wrl 24 Mar 2000 05:37:10 -0000 1.1.1.1 --- rotation_toy.wrl 13 May 2006 19:40:34 -0000 1.2 *************** *** 457,467 **** url ["javascript: function setX(value) { ! r.x = value; } function setY(value) { ! r.y = value; } function setZ(value) { ! r.z = value; } function setR(value) { --- 457,473 ---- url ["javascript: function setX(value) { ! var axis = r.getAxis(); ! axis.x = value; ! r.setAxis(axis.normalize()); } function setY(value) { ! var axis = r.getAxis(); ! axis.y = value; ! r.setAxis(axis.normalize()); } function setZ(value) { ! var axis = r.getAxis(); ! axis.z = value; ! r.setAxis(axis.normalize()); } function setR(value) { |
From: Braden M. <br...@us...> - 2006-05-13 19:40:37
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18582 Modified Files: ChangeLog Log Message: Normalize the rotation axis. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1239 retrieving revision 1.1240 diff -C2 -d -r1.1239 -r1.1240 *** ChangeLog 12 May 2006 22:27:08 -0000 1.1239 --- ChangeLog 13 May 2006 19:40:34 -0000 1.1240 *************** *** 1,2 **** --- 1,6 ---- + 2006-05-13 Braden McDaniel <br...@en...> + + * models/rotation_toy.wrl: Normalize the rotation axis. + 2006-05-12 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-05-12 22:27:12
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16731/src/libopenvrml/openvrml Modified Files: node.cpp Log Message: If a thread other than the rendering thread destroys the scene, we will run into problems if we try to call OpenGL functions without first changing the GL context to the current thread. Rather than do that, we probably want just to refactor display list and texture object cleanup such that it is encapsulated in the renderer and always handled by the rendering thread. For now, though, we will just punt and leak the display list and texture objects. Index: node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** node.cpp 17 Apr 2006 07:29:17 -0000 1.80 --- node.cpp 12 May 2006 22:27:08 -0000 1.81 *************** *** 3567,3577 **** */ openvrml::geometry_node::~geometry_node() OPENVRML_NOTHROW ! { ! if (this->geometry_reference) { ! assert(this->type().node_class().browser().viewer()); ! this->type().node_class().browser().viewer() ! ->remove_object(this->geometry_reference); ! } ! } /** --- 3567,3571 ---- */ openvrml::geometry_node::~geometry_node() OPENVRML_NOTHROW ! {} /** *************** *** 4232,4242 **** */ openvrml::texture_node::~texture_node() OPENVRML_NOTHROW ! { ! if (this->texture_reference) { ! assert(this->type().node_class().browser().viewer()); ! this->type().node_class().browser().viewer() ! ->remove_texture_object(this->texture_reference); ! } ! } /** --- 4226,4230 ---- */ openvrml::texture_node::~texture_node() OPENVRML_NOTHROW ! {} /** |