From: <br...@us...> - 2008-04-10 03:56:13
|
Revision: 3455 http://openvrml.svn.sourceforge.net/openvrml/?rev=3455&view=rev Author: braden Date: 2008-04-09 20:56:18 -0700 (Wed, 09 Apr 2008) Log Message: ----------- Moved EventUtilities component definition to XML. Modified Paths: -------------- branches/node-modules/data/Makefile.am branches/node-modules/src/libopenvrml/openvrml/browser.cpp Added Paths: ----------- branches/node-modules/data/component/event-utilities.xml Modified: branches/node-modules/data/Makefile.am =================================================================== --- branches/node-modules/data/Makefile.am 2008-04-09 23:13:08 UTC (rev 3454) +++ branches/node-modules/data/Makefile.am 2008-04-10 03:56:18 UTC (rev 3455) @@ -22,4 +22,5 @@ component/geospatial.xml \ component/h-anim.xml \ component/nurbs.xml \ - component/dis.xml + component/dis.xml \ + component/event-utilities.xml Added: branches/node-modules/data/component/event-utilities.xml =================================================================== --- branches/node-modules/data/component/event-utilities.xml (rev 0) +++ branches/node-modules/data/component/event-utilities.xml 2008-04-10 03:56:18 UTC (rev 3455) @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component id="EventUtilities"> + <level> + <node id="BooleanFilter" + metatype-id="urn:X-openvrml:node:BooleanFilter"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="set_boolean" type="SFBool" access-type="inputOnly" /> + <field id="inputFalse" type="SFBool" access-type="outputOnly" /> + <field id="inputNegate" type="SFBool" access-type="outputOnly" /> + <field id="inputTrue" type="SFBool" access-type="outputOnly" /> + </node> + <node id="BooleanSequencer" + metatype-id="urn:X-openvrml:node:BooleanSequencer"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="next" type="SFBool" access-type="inputOnly" /> + <field id="previous" type="SFBool" access-type="inputOnly" /> + <field id="set_fraction" type="SFFloat" access-type="inputOnly" /> + <field id="key" type="MFFloat" access-type="inputOutput" /> + <field id="keyValue" type="MFBool" access-type="inputOutput" /> + <field id="value_changed" type="SFBool" access-type="outputOnly" /> + </node> + <node id="BooleanToggle" + metatype-id="urn:X-openvrml:node:BooleanToggle"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="set_boolean" type="SFBool" access-type="inputOnly" /> + <field id="toggle" type="SFBool" access-type="inputOutput" /> + </node> + <node id="BooleanTrigger" + metatype-id="urn:X-openvrml:node:BooleanTrigger"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="set_triggerTime" type="SFTime" access-type="inputOnly" /> + <field id="triggerTrue" type="SFBool" access-type="outputOnly" /> + </node> + <node id="IntegerSequencer" + metatype-id="urn:X-openvrml:node:IntegerSequencer"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="next" type="SFBool" access-type="inputOnly" /> + <field id="previous" type="SFBool" access-type="inputOnly" /> + <field id="set_fraction" type="SFFloat" access-type="inputOnly" /> + <field id="key" type="MFFloat" access-type="inputOutput" /> + <field id="keyValue" type="MFInt32" access-type="inputOutput" /> + <field id="value_changed" type="SFInt32" access-type="outputOnly" /> + </node> + <node id="IntegerTrigger" + metatype-id="urn:X-openvrml:node:IntegerTrigger"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="set_boolean" type="SFBool" access-type="inputOnly" /> + <field id="integerKey" type="MFInt32" access-type="inputOutput" /> + <field id="triggerValue" type="SFInt32" access-type="outputOnly" /> + </node> + <node id="TimeTrigger" + metatype-id="urn:X-openvrml:node:TimeTrigger"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="set_boolean" type="SFBool" access-type="inputOnly" /> + <field id="triggerTime" type="SFTime" access-type="outputOnly" /> + </node> + </level> +</component> Modified: branches/node-modules/src/libopenvrml/openvrml/browser.cpp =================================================================== --- branches/node-modules/src/libopenvrml/openvrml/browser.cpp 2008-04-09 23:13:08 UTC (rev 3454) +++ branches/node-modules/src/libopenvrml/openvrml/browser.cpp 2008-04-10 03:56:18 UTC (rev 3455) @@ -12533,340 +12533,6 @@ } - class OPENVRML_LOCAL x3d_event_utilities_component : public component { - static const boost::array<openvrml::node_interface, 5> - boolean_filter_interfaces_; - static const boost::array<openvrml::node_interface, 7> - boolean_sequencer_interfaces_; - static const boost::array<openvrml::node_interface, 3> - boolean_toggle_interfaces_; - static const boost::array<openvrml::node_interface, 3> - boolean_trigger_interfaces_; - static const boost::array<openvrml::node_interface, 7> - integer_sequencer_interfaces_; - static const boost::array<openvrml::node_interface, 4> - integer_trigger_interfaces_; - static const boost::array<openvrml::node_interface, 3> - time_trigger_interfaces_; - - 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); - - virtual void - do_add_to_node_type_desc_map( - openvrml::node_type_decls & type_descs, size_t level) const - OPENVRML_THROW1(std::bad_alloc); - }; - - const boost::array<openvrml::node_interface, 5> - x3d_event_utilities_component::boolean_filter_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "set_boolean"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "inputFalse"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "inputNegate"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "inputTrue") - }; - - const boost::array<openvrml::node_interface, 7> - x3d_event_utilities_component::boolean_sequencer_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "next"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "previous"), - node_interface(node_interface::eventin_id, - field_value::sffloat_id, - "set_fraction"), - node_interface(node_interface::exposedfield_id, - field_value::mffloat_id, - "key"), - node_interface(node_interface::exposedfield_id, - field_value::mfbool_id, - "keyValue"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "value_changed") - }; - - const boost::array<openvrml::node_interface, 3> - x3d_event_utilities_component::boolean_toggle_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "set_boolean"), - node_interface(node_interface::exposedfield_id, - field_value::sfbool_id, - "toggle") - }; - - const boost::array<openvrml::node_interface, 3> - x3d_event_utilities_component::boolean_trigger_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sftime_id, - "set_triggerTime"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "triggerTrue") - }; - - const boost::array<openvrml::node_interface, 7> - x3d_event_utilities_component::integer_sequencer_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "next"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "previous"), - node_interface(node_interface::eventin_id, - field_value::sffloat_id, - "set_fraction"), - node_interface(node_interface::exposedfield_id, - field_value::mffloat_id, - "key"), - node_interface(node_interface::exposedfield_id, - field_value::mfint32_id, - "keyValue"), - node_interface(node_interface::eventout_id, - field_value::sfint32_id, - "value_changed") - }; - - const boost::array<openvrml::node_interface, 4> - x3d_event_utilities_component::integer_trigger_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "set_boolean"), - node_interface(node_interface::exposedfield_id, - field_value::mfint32_id, - "integerKey"), - node_interface(node_interface::eventout_id, - field_value::sfint32_id, - "triggerValue") - }; - - const boost::array<openvrml::node_interface, 3> - x3d_event_utilities_component::time_trigger_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::sfbool_id, - "set_boolean"), - node_interface(node_interface::eventout_id, - field_value::sftime_id, - "triggerTime") - }; - - const char * const x3d_event_utilities_component::id = "EventUtilities"; - - size_t x3d_event_utilities_component::support_level() const - OPENVRML_NOTHROW - { - return 1; - } - - void - x3d_event_utilities_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; - - if (level >= 1) { - // - // BooleanFilter node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::boolean_filter_interfaces_.begin(), - x3d_event_utilities_component::boolean_filter_interfaces_.end()); - add_scope_entry(b, - "BooleanFilter", - interface_set, - "urn:X-openvrml:node:BooleanFilter", - scope); - } - - // - // BooleanSequencer node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::boolean_sequencer_interfaces_.begin(), - x3d_event_utilities_component::boolean_sequencer_interfaces_.end()); - add_scope_entry(b, - "BooleanSequencer", - interface_set, - "urn:X-openvrml:node:BooleanSequencer", - scope); - } - - // - // BooleanToggle node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::boolean_toggle_interfaces_.begin(), - x3d_event_utilities_component::boolean_toggle_interfaces_.end()); - add_scope_entry(b, - "BooleanToggle", - interface_set, - "urn:X-openvrml:node:BooleanToggle", - scope); - } - - // - // BooleanTrigger node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::boolean_trigger_interfaces_.begin(), - x3d_event_utilities_component::boolean_trigger_interfaces_.end()); - add_scope_entry(b, - "BooleanTrigger", - interface_set, - "urn:X-openvrml:node:BooleanTrigger", - scope); - } - - // - // IntegerSequencer node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::integer_sequencer_interfaces_.begin(), - x3d_event_utilities_component::integer_sequencer_interfaces_.end()); - add_scope_entry(b, - "IntegerSequencer", - interface_set, - "urn:X-openvrml:node:IntegerSequencer", - scope); - } - - // - // IntegerTrigger node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::integer_trigger_interfaces_.begin(), - x3d_event_utilities_component::integer_trigger_interfaces_.end()); - add_scope_entry(b, - "IntegerTrigger", - interface_set, - "urn:X-openvrml:node:IntegerTrigger", - scope); - } - - // - // TimeTrigger node - // - { - static const node_interface_set - interface_set( - x3d_event_utilities_component::time_trigger_interfaces_.begin(), - x3d_event_utilities_component::time_trigger_interfaces_.end()); - add_scope_entry(b, - "TimeTrigger", - interface_set, - "urn:X-openvrml:node:TimeTrigger", - scope); - } - } - } - - void - x3d_event_utilities_component:: - do_add_to_node_type_desc_map(openvrml::node_type_decls & type_descs, - size_t /* level */) const - OPENVRML_THROW1(std::bad_alloc) - { - using openvrml::node_interface_set; - component::add_type_desc( - type_descs, - "BooleanFilter", - node_interface_set( - x3d_event_utilities_component::boolean_filter_interfaces_.begin(), - x3d_event_utilities_component::boolean_filter_interfaces_.end())); - component::add_type_desc( - type_descs, - "BooleanSequencer", - node_interface_set( - x3d_event_utilities_component::boolean_sequencer_interfaces_.begin(), - x3d_event_utilities_component::boolean_sequencer_interfaces_.end())); - component::add_type_desc( - type_descs, - "BooleanToggle", - node_interface_set( - x3d_event_utilities_component::boolean_toggle_interfaces_.begin(), - x3d_event_utilities_component::boolean_toggle_interfaces_.end())); - component::add_type_desc( - type_descs, - "BooleanTrigger", - node_interface_set( - x3d_event_utilities_component::boolean_trigger_interfaces_.begin(), - x3d_event_utilities_component::boolean_trigger_interfaces_.end())); - component::add_type_desc( - type_descs, - "IntegerSequencer", - node_interface_set( - x3d_event_utilities_component::integer_sequencer_interfaces_.begin(), - x3d_event_utilities_component::integer_sequencer_interfaces_.end())); - component::add_type_desc( - type_descs, - "IntegerTrigger", - node_interface_set( - x3d_event_utilities_component::integer_trigger_interfaces_.begin(), - x3d_event_utilities_component::integer_trigger_interfaces_.end())); - component::add_type_desc( - type_descs, - "TimeTrigger", - node_interface_set( - x3d_event_utilities_component::time_trigger_interfaces_.begin(), - x3d_event_utilities_component::time_trigger_interfaces_.end())); - } - - component_registry::component_registry() OPENVRML_THROW2(boost::filesystem::filesystem_error, std::bad_alloc) @@ -12896,11 +12562,6 @@ } } - key = x3d_event_utilities_component::id; - succeeded = - 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); @@ -13015,7 +12676,7 @@ this->add_component("EnvironmentalSensor", 1); this->add_component("Navigation", 1); this->add_component("EnvironmentalEffects", 1); - this->add_component(x3d_event_utilities_component::id, 1); + this->add_component("EventUtilities", 1); } @@ -13062,7 +12723,7 @@ this->add_component("EnvironmentalSensor", 2); this->add_component("Navigation", 2); this->add_component("EnvironmentalEffects", 2); - this->add_component(x3d_event_utilities_component::id, 1); + this->add_component("EventUtilities", 1); } @@ -13092,6 +12753,6 @@ this->add_component("H-Anim", 1); this->add_component("NURBS", 4); this->add_component("DIS", 1); - this->add_component(x3d_event_utilities_component::id, 1); + this->add_component("EventUtilities", 1); } } // namespace This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |