From: <br...@us...> - 2008-04-02 04:18:18
|
Revision: 3443 http://openvrml.svn.sourceforge.net/openvrml/?rev=3443&view=rev Author: braden Date: 2008-04-01 21:18:25 -0700 (Tue, 01 Apr 2008) Log Message: ----------- Moved KeyDeviceSensor 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/key-device-sensor.xml Modified: branches/node-modules/data/Makefile.am =================================================================== --- branches/node-modules/data/Makefile.am 2008-04-02 04:09:33 UTC (rev 3442) +++ branches/node-modules/data/Makefile.am 2008-04-02 04:18:25 UTC (rev 3443) @@ -14,4 +14,5 @@ component/lighting.xml \ component/texturing.xml \ component/interpolation.xml \ - component/pointing-device-sensor.xml + component/pointing-device-sensor.xml \ + component/key-device-sensor.xml Added: branches/node-modules/data/component/key-device-sensor.xml =================================================================== --- branches/node-modules/data/component/key-device-sensor.xml (rev 0) +++ branches/node-modules/data/component/key-device-sensor.xml 2008-04-02 04:18:25 UTC (rev 3443) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component id="KeyDeviceSensor"> + <level> + <requires id="Core" level="1" /> + <node id="KeySensor" + metatype-id="urn:X-openvrml:node:KeySensor"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="enabled" type="SFBool" access-type="inputOutput" /> + <field id="actionKeyPress" type="SFInt32" access-type="outputOnly" /> + <field id="actionKeyRelease" type="SFInt32" access-type="outputOnly" /> + <field id="altKey" type="SFBool" access-type="outputOnly" /> + <field id="controlKey" type="SFBool" access-type="outputOnly" /> + <field id="isActive" type="SFBool" access-type="outputOnly" /> + <field id="keyPress" type="SFString" access-type="outputOnly" /> + <field id="keyRelease" type="SFString" access-type="outputOnly" /> + <field id="shiftKey" type="SFBool" access-type="outputOnly" /> + </node> + </level> + <level> + <node id="StringSensor" + metatype-id="urn:X-openvrml:node:StringSensor"> + <field id="metadata" type="SFNode" access-type="inputOutput" /> + <field id="deletionAllowed" type="SFBool" access-type="inputOutput" /> + <field id="enabled" type="SFBool" access-type="inputOutput" /> + <field id="enteredText" type="SFString" access-type="outputOnly" /> + <field id="finalText" type="SFString" access-type="outputOnly" /> + <field id="isActive" type="SFBool" 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-02 04:09:33 UTC (rev 3442) +++ branches/node-modules/src/libopenvrml/openvrml/browser.cpp 2008-04-02 04:18:25 UTC (rev 3443) @@ -12188,163 +12188,6 @@ using openvrml::node_interface; using openvrml::field_value; - - class OPENVRML_LOCAL x3d_key_device_sensor_component : public component { - static const boost::array<openvrml::node_interface, 10> - key_sensor_interfaces_; - static const boost::array<openvrml::node_interface, 6> - string_sensor_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, 10> - x3d_key_device_sensor_component::key_sensor_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::exposedfield_id, - field_value::sfbool_id, - "enabled"), - node_interface(node_interface::eventout_id, - field_value::sfint32_id, - "actionKeyPress"), - node_interface(node_interface::eventout_id, - field_value::sfint32_id, - "actionKeyRelease"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "altKey"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "controlKey"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "isActive"), - node_interface(node_interface::eventout_id, - field_value::sfstring_id, - "keyPress"), - node_interface(node_interface::eventout_id, - field_value::sfstring_id, - "keyRelease"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "shiftKey") - }; - - const boost::array<openvrml::node_interface, 6> - x3d_key_device_sensor_component::string_sensor_interfaces_ = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::exposedfield_id, - field_value::sfbool_id, - "deletionAllowed"), - node_interface(node_interface::exposedfield_id, - field_value::sfbool_id, - "enabled"), - node_interface(node_interface::eventout_id, - field_value::sfstring_id, - "enteredText"), - node_interface(node_interface::eventout_id, - field_value::sfstring_id, - "finalText"), - node_interface(node_interface::eventout_id, - field_value::sfbool_id, - "isActive") - }; - - const char * const x3d_key_device_sensor_component::id = "KeyDeviceSensor"; - - size_t x3d_key_device_sensor_component::support_level() const - OPENVRML_NOTHROW - { - return 2; - } - - void - x3d_key_device_sensor_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) { - // - // KeySensor node - // - { - static const node_interface_set - interface_set( - x3d_key_device_sensor_component::key_sensor_interfaces_.begin(), - x3d_key_device_sensor_component::key_sensor_interfaces_.end()); - add_scope_entry(b, - "KeySensor", - interface_set, - "urn:X-openvrml:node:KeySensor", - scope); - } - } - - if (level >= 2) { - // - // StringSensor node - // - { - static const node_interface_set - interface_set( - x3d_key_device_sensor_component::string_sensor_interfaces_.begin(), - x3d_key_device_sensor_component::string_sensor_interfaces_.end()); - add_scope_entry(b, - "StringSensor", - interface_set, - "urn:X-openvrml:node:StringSensor", - scope); - } - } - } - - void - x3d_key_device_sensor_component:: - do_add_to_node_type_desc_map(openvrml::node_type_decls & type_descs, - const size_t level) const - OPENVRML_THROW1(std::bad_alloc) - { - using openvrml::node_interface_set; - component::add_type_desc( - type_descs, - "KeySensor", - node_interface_set( - x3d_key_device_sensor_component::key_sensor_interfaces_.begin(), - x3d_key_device_sensor_component::key_sensor_interfaces_.end())); - - if (level >= 2) { - component::add_type_desc( - type_descs, - "StringSensor", - node_interface_set( - x3d_key_device_sensor_component::string_sensor_interfaces_.begin(), - x3d_key_device_sensor_component::string_sensor_interfaces_.end())); - } - } - - class OPENVRML_LOCAL x3d_environmental_sensor_component : public component { static const boost::array<openvrml::node_interface, 10> @@ -16233,11 +16076,6 @@ } } - key = x3d_key_device_sensor_component::id; - succeeded = - this->insert(key, new x3d_key_device_sensor_component).second; - assert(succeeded); - key = x3d_environmental_sensor_component::id; succeeded = this->insert(key, new x3d_environmental_sensor_component).second; @@ -16383,7 +16221,7 @@ this->add_component("Texturing", 2); this->add_component("Interpolation", 2); this->add_component("PointingDeviceSensor", 1); - this->add_component(x3d_key_device_sensor_component::id, 1); + this->add_component("KeyDeviceSensor", 1); this->add_component(x3d_environmental_sensor_component::id, 1); this->add_component(x3d_navigation_component::id, 1); this->add_component(x3d_environmental_effects_component::id, 1); @@ -16430,7 +16268,7 @@ this->add_component("Texturing", 3); this->add_component("Interpolation", 2); this->add_component("PointingDeviceSensor", 1); - this->add_component(x3d_key_device_sensor_component::id, 2); + this->add_component("KeyDeviceSensor", 2); this->add_component(x3d_environmental_sensor_component::id, 2); this->add_component(x3d_navigation_component::id, 2); this->add_component(x3d_environmental_effects_component::id, 2); @@ -16456,7 +16294,7 @@ this->add_component("Texturing", 3); this->add_component("Interpolation", 3); this->add_component("PointingDeviceSensor", 1); - this->add_component(x3d_key_device_sensor_component::id, 2); + this->add_component("KeyDeviceSensor", 2); this->add_component(x3d_environmental_sensor_component::id, 2); this->add_component(x3d_navigation_component::id, 2); this->add_component(x3d_environmental_effects_component::id, 3); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |