awv3
Version:
AWV client CAD framework
1,745 lines (1,744 loc) • 1.73 MB
JSON
{
"type": "Program",
"start": 0,
"end": 15898,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 404,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 18,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
}
},
{
"type": "ImportDeclaration",
"start": 27,
"end": 66,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 39
}
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"start": 34,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 39,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 12
},
"end": {
"line": 2,
"column": 17
}
},
"name": "Error"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 50,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 38
}
},
"value": "../core/error",
"rawValue": "../core/error",
"raw": "'../core/error'"
}
},
{
"type": "ImportDeclaration",
"start": 67,
"end": 134,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 67
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 76,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 76,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 13
}
},
"name": "guid"
},
"local": {
"type": "Identifier",
"start": 76,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 13
}
},
"name": "guid"
}
},
{
"type": "ImportSpecifier",
"start": 82,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 23
}
},
"imported": {
"type": "Identifier",
"start": 82,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 23
}
},
"name": "queryDom"
},
"local": {
"type": "Identifier",
"start": 82,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 23
}
},
"name": "queryDom"
}
},
{
"type": "ImportSpecifier",
"start": 92,
"end": 108,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 41
}
},
"imported": {
"type": "Identifier",
"start": 92,
"end": 108,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 41
}
},
"name": "setPrefixedValue"
},
"local": {
"type": "Identifier",
"start": 92,
"end": 108,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 41
}
},
"name": "setPrefixedValue"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 116,
"end": 133,
"loc": {
"start": {
"line": 3,
"column": 49
},
"end": {
"line": 3,
"column": 66
}
},
"value": "../core/helpers",
"rawValue": "../core/helpers",
"raw": "'../core/helpers'"
}
},
{
"type": "ImportDeclaration",
"start": 135,
"end": 180,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 45
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 144,
"end": 155,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 20
}
},
"imported": {
"type": "Identifier",
"start": 144,
"end": 155,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 20
}
},
"name": "lastCreated"
},
"local": {
"type": "Identifier",
"start": 144,
"end": 155,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 20
}
},
"name": "lastCreated"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 163,
"end": 179,
"loc": {
"start": {
"line": 4,
"column": 28
},
"end": {
"line": 4,
"column": 44
}
},
"value": "../core/canvas",
"rawValue": "../core/canvas",
"raw": "'../core/canvas'"
}
},
{
"type": "ImportDeclaration",
"start": 181,
"end": 217,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 36
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 188,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 188,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 16
}
},
"name": "DomEvents"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 203,
"end": 216,
"loc": {
"start": {
"line": 5,
"column": 22
},
"end": {
"line": 5,
"column": 35
}
},
"value": "../core/dom",
"rawValue": "../core/dom",
"raw": "'../core/dom'"
}
},
{
"type": "ImportDeclaration",
"start": 218,
"end": 264,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 46
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 225,
"end": 236,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 225,
"end": 236,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 18
}
},
"name": "Interaction"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 242,
"end": 263,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 45
}
},
"value": "../core/interaction",
"rawValue": "../core/interaction",
"raw": "'../core/interaction'"
}
},
{
"type": "ImportDeclaration",
"start": 265,
"end": 299,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 34
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 272,
"end": 277,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 272,
"end": 277,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 12
}
},
"name": "Stats"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 283,
"end": 298,
"loc": {
"start": {
"line": 7,
"column": 18
},
"end": {
"line": 7,
"column": 33
}
},
"value": "../misc/stats",
"rawValue": "../misc/stats",
"raw": "'../misc/stats'"
}
},
{
"type": "ImportDeclaration",
"start": 300,
"end": 338,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 38
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 307,
"end": 312,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 307,
"end": 312,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 12
}
},
"name": "Orbit"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 318,
"end": 337,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 37
}
},
"value": "../controls/orbit",
"rawValue": "../controls/orbit",
"raw": "'../controls/orbit'"
}
},
{
"type": "ImportDeclaration",
"start": 339,
"end": 386,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 47
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 346,
"end": 357,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 346,
"end": 357,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 18
}
},
"name": "Perspective"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 363,
"end": 385,
"loc": {
"start": {
"line": 9,
"column": 24
},
"end": {
"line": 9,
"column": 46
}
},
"value": "../three/perspective",
"rawValue": "../three/perspective",
"raw": "'../three/perspective'"
}
},
{
"type": "ImportDeclaration",
"start": 388,
"end": 435,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 47
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 395,
"end": 406,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 395,
"end": 406,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 18
}
},
"name": "checkResize"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 412,
"end": 434,
"loc": {
"start": {
"line": 11,
"column": 24
},
"end": {
"line": 11,
"column": 46
}
},
"value": "element-resize-event",
"rawValue": "element-resize-event",
"raw": "'element-resize-event'"
},
"trailingComments": [
{
"type": "Block",
"value": "* A view represents a portion of canvas on which webGL can draw.\n The view is defined and tracked by a dom node on which the drawing take place. ",
"start": 437,
"end": 589,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 14,
"column": 85
}
},
"range": [
437,
589
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 590,
"end": 15897,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 403,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 605,
"end": 15897,
"loc": {
"start": {
"line": 15,
"column": 15
},
"end": {
"line": 403,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 611,
"end": 615,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 25
}
},
"name": "View",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 616,
"end": 15897,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 403,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 2095,
"end": 7205,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 158,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 2095,
"end": 2106,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 38,
"column": 15
}
},
"name": "constructor",
"leadingComments": null
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 2106,
"end": 7205,
"loc": {
"start": {
"line": 38,
"column": 15
},
"end": {
"line": 158,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start": 2107,
"end": 2127,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 36
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 2107,
"end": 2113,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 22
}
},
"name": "canvas"
},
"right": {
"type": "Identifier",
"start": 2116,
"end": 2127,
"loc": {
"start": {
"line": 38,
"column": 25
},
"end": {
"line": 38,
"column": 36
}
},
"name": "lastCreated"
}
},
{
"type": "AssignmentPattern",
"start": 2129,
"end": 2141,
"loc": {
"start": {
"line": 38,
"column": 38
},
"end": {
"line": 38,
"column": 50
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 2129,
"end": 2136,
"loc": {
"start": {
"line": 38,
"column": 38
},
"end": {
"line": 38,
"column": 45
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 2139,
"end": 2141,
"loc": {
"start": {
"line": 38,
"column": 48
},
"end": {
"line": 38,
"column": 50
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 2143,
"end": 7205,
"loc": {
"start": {
"line": 38,
"column": 52
},
"end": {
"line": 158,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 2154,
"end": 2171,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2154,
"end": 2170,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2154,
"end": 2161,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 2154,
"end": 2158,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2159,
"end": 2161,
"loc": {
"start": {
"line": 40,
"column": 13
},
"end": {
"line": 40,
"column": 15
}
},
"name": "id"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 2164,
"end": 2170,
"loc": {
"start": {
"line": 40,
"column": 18
},
"end": {
"line": 40,
"column": 24
}
},
"callee": {
"type": "Identifier",
"start": 2164,
"end": 2168,
"loc": {
"start": {
"line": 40,
"column": 18
},
"end": {
"line": 40,
"column": 22
}
},
"name": "guid"
},
"arguments": []
}
}
},
{
"type": "ExpressionStatement",
"start": 2180,
"end": 2201,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2180,
"end": 2200,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2180,
"end": 2191,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 2180,
"end": 2184,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2185,
"end": 2191,
"loc": {
"start": {
"line": 41,
"column": 13
},
"end": {
"line": 41,
"column": 19
}
},
"name": "canvas"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 2194,
"end": 2200,
"loc": {
"start": {
"line": 41,
"column": 22
},
"end": {
"line": 41,
"column": 28
}
},
"name": "canvas"
}
}
},
{
"type": "ExpressionStatement",
"start": 2210,
"end": 2242,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 40
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2210,
"end": 2241,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 39
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2210,
"end": 2223,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 2210,
"end": 2214,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2215,
"end": 2223,
"loc": {
"start": {
"line": 42,
"column": 13
},
"end": {
"line": 42,
"column": 21
}
},
"name": "renderer"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 2226,
"end": 2241,
"loc": {
"start": {
"line": 42,
"column": 24
},
"end": {
"line": 42,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 2226,
"end": 2232,
"loc": {
"start": {
"line": 42,
"column": 24
},
"end": {
"line": 42,
"column": 30
}
},
"name": "canvas"
},
"property": {
"type": "Identifier",
"start": 2233,
"end": 2241,
"loc": {
"start": {
"line": 42,
"column": 31
},
"end": {
"line": 42,
"column": 39
}
},
"name": "renderer"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 2251,
"end": 2277,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 34
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2251,
"end": 2276,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 33
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2251,
"end": 2272,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 2251,
"end": 2255,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2256,
"end": 2272,
"loc": {
"start": {
"line": 43,
"column": 13
},
"end": {
"line": 43,
"column": 29
}
},
"name": "invalidateFrames"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 2275,
"end": 2276,
"loc": {
"start": {
"line": 43,
"column": 32
},
"end": {
"line": 43,
"column": 33
}
},
"value": 2,
"rawValue": 2,
"raw": "2"
}
}
},
{
"type": "ExpressionStatement",
"start": 2286,
"end": 2301,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 23
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2286,
"end": 2300,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 22
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2286,
"end": 2296,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 2286,
"end": 2290,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2291,
"end": 2296,
"loc": {
"start": {
"line": 44,
"column": 13
},
"end": {
"line": 44,
"column": 18
}
},
"name": "force"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 2299,
"end": 2300,
"loc": {
"start": {
"line": 44,
"column": 21
},
"end": {
"line": 44,
"column": 22
}
},
"value": 0,
"rawValue": 0,
"raw": "0"
}
}
},
{
"type": "ExpressionStatement",
"start": 2310,
"end": 2328,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 26
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2310,
"end": 2327,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 25
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2310,
"end": 2320,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 2310,
"end": 2314,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2315,
"end": 2320,
"loc": {
"start": {
"line": 45,
"column": 13
},
"end": {
"line": 45,
"column": 18
}
},
"name": "dirty"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 2323,
"end": 2327,
"loc": {
"start": {
"line": 45,
"column": 21
},
"end": {
"line": 45,
"column": 25
}
},
"value": true,
"rawValue": true,
"raw": "true"
}
}
},
{
"type": "ExpressionStatement",
"start": 2337,
"end": 2437,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 49,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2337,
"end": 2436,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 49,
"column": 9
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2337,
"end": 2348,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 2337,
"end": 2341,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2342,
"end": 2348,
"loc": {
"start": {
"line": 46,
"column": 13