scene.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
  2. // Secretary of Defense (Personnel & Readiness).
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  5. // in compliance with the License. You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software distributed under the License
  10. // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  11. // or implied. See the License for the specific language governing permissions and limitations under
  12. // the License.
  13. /// vwf/model/example/scene.js is a demonstration of a scene manager.
  14. ///
  15. /// @module vwf/model/example/scene
  16. /// @requires vwf/model
  17. define( [ "module", "vwf/model" ], function( module, model ) {
  18. return model.load( module, {
  19. // == Module Definition ====================================================================
  20. // -- pipeline -----------------------------------------------------------------------------
  21. // pipeline: [ log ], // vwf <=> log <=> scene
  22. // -- initialize ---------------------------------------------------------------------------
  23. initialize: function() {
  24. this.objects = {}; // maps id => { property: value, ... }
  25. },
  26. // == Model API ============================================================================
  27. // -- creatingNode -------------------------------------------------------------------------
  28. creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
  29. childSource, childType, childIndex, childName, callback /* ( ready ) */ ) {
  30. },
  31. // -- deletingNode -------------------------------------------------------------------------
  32. deletingNode: function( nodeID ) {
  33. },
  34. // -- addingChild --------------------------------------------------------------------------
  35. addingChild: function( nodeID, childID, childName ) {
  36. },
  37. // -- removingChild ------------------------------------------------------------------------
  38. removingChild: function( nodeID, childID ) {
  39. },
  40. // -- creatingProperty ---------------------------------------------------------------------
  41. creatingProperty: function( nodeID, propertyName, propertyValue ) {
  42. var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  43. return object[propertyName] = propertyValue;
  44. },
  45. // -- initializingProperty -----------------------------------------------------------------
  46. initializingProperty: function( nodeID, propertyName, propertyValue ) {
  47. var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  48. return object[propertyName] = propertyValue;
  49. },
  50. // TODO: deletingProperty
  51. // -- settingProperty ----------------------------------------------------------------------
  52. settingProperty: function( nodeID, propertyName, propertyValue ) {
  53. var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  54. return object[propertyName] = propertyValue;
  55. },
  56. // -- gettingProperty ----------------------------------------------------------------------
  57. gettingProperty: function( nodeID, propertyName, propertyValue ) {
  58. var object = this.objects[nodeID];
  59. return object && object[propertyName];
  60. },
  61. // -- creatingMethod -----------------------------------------------------------------------
  62. creatingMethod: function( nodeID, methodName, methodParameters, methodBody ) {
  63. },
  64. // TODO: deletingMethod
  65. // -- callingMethod ------------------------------------------------------------------------
  66. callingMethod: function( nodeID, methodName, methodParameters ) {
  67. },
  68. // -- creatingEvent ------------------------------------------------------------------------
  69. creatingEvent: function( nodeID, eventName, eventParameters ) {
  70. },
  71. // TODO: deletingEvent
  72. // -- firingEvent --------------------------------------------------------------------------
  73. firingEvent: function( nodeID, eventName, eventParameters ) {
  74. },
  75. // -- executing ----------------------------------------------------------------------------
  76. executing: function( nodeID, scriptText, scriptType ) {
  77. },
  78. } );
  79. } );