diff options
Diffstat (limited to 'js/helper-classes/RDGE/runtime/CanvasDataManager.js')
-rw-r--r-- | js/helper-classes/RDGE/runtime/CanvasDataManager.js | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/js/helper-classes/RDGE/runtime/CanvasDataManager.js b/js/helper-classes/RDGE/runtime/CanvasDataManager.js deleted file mode 100644 index efbfe4db..00000000 --- a/js/helper-classes/RDGE/runtime/CanvasDataManager.js +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | |||
8 | |||
9 | /////////////////////////////////////////////////////////////////////// | ||
10 | // Class ShapeRuntime | ||
11 | // Manages runtime shape display | ||
12 | /////////////////////////////////////////////////////////////////////// | ||
13 | function CanvasDataManager() | ||
14 | { | ||
15 | this.loadGLData = function(root, valueArray, NinjaUtils) | ||
16 | { | ||
17 | var value = valueArray; | ||
18 | var nWorlds = value.length; | ||
19 | for (var i=0; i<nWorlds; i++) | ||
20 | { | ||
21 | var importStr = value[i]; | ||
22 | var startIndex = importStr.indexOf( "id: " ); | ||
23 | if (startIndex >= 0) | ||
24 | { | ||
25 | var endIndex = importStr.indexOf( "\n", startIndex ); | ||
26 | if (endIndex > 0) | ||
27 | { | ||
28 | var id = importStr.substring( startIndex+4, endIndex ); | ||
29 | var canvas = this.findCanvasWithID( id, root ); | ||
30 | if (canvas) | ||
31 | { | ||
32 | var rt = new GLRuntime( canvas, importStr ); | ||
33 | } | ||
34 | } | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | |||
39 | this.collectGLData = function( elt, dataArray ) | ||
40 | { | ||
41 | if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) | ||
42 | { | ||
43 | var data = elt.elementModel.shapeModel.GLWorld.export( true ); | ||
44 | dataArray.push( data ); | ||
45 | } | ||
46 | |||
47 | if (elt.children) | ||
48 | { | ||
49 | var nKids = elt.children.length; | ||
50 | for (var i=0; i<nKids; i++) | ||
51 | { | ||
52 | var child = elt.children[i]; | ||
53 | this.collectGLData( child, dataArray ); | ||
54 | } | ||
55 | } | ||
56 | } | ||
57 | |||
58 | this.findCanvasWithID = function( id, elt ) | ||
59 | { | ||
60 | var cid = elt.getAttribute( "data-RDGE-id" ); | ||
61 | if (cid == id) return elt; | ||
62 | |||
63 | if (elt.children) | ||
64 | { | ||
65 | var nKids = elt.children.length; | ||
66 | for (var i=0; i<nKids; i++) | ||
67 | { | ||
68 | var child = elt.children[i]; | ||
69 | var foundElt = this.findCanvasWithID( id, child ); | ||
70 | if (foundElt) return foundElt; | ||
71 | } | ||
72 | } | ||
73 | } | ||
74 | } | ||
75 | |||