awv3
Version:
AWV client CAD framework
1,745 lines (1,744 loc) • 1.85 MB
JSON
{
"type": "Program",
"start": 0,
"end": 17408,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 432,
"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": 28,
"end": 67,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 39
}
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"start": 35,
"end": 45,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 40,
"end": 45,
"loc": {
"start": {
"line": 2,
"column": 12
},
"end": {
"line": 2,
"column": 17
}
},
"name": "Error"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 51,
"end": 66,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 38
}
},
"value": "../core/error",
"rawValue": "../core/error",
"raw": "'../core/error'"
}
},
{
"type": "ImportDeclaration",
"start": 69,
"end": 136,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 67
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 78,
"end": 82,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 78,
"end": 82,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 13
}
},
"name": "guid"
},
"local": {
"type": "Identifier",
"start": 78,
"end": 82,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 13
}
},
"name": "guid"
}
},
{
"type": "ImportSpecifier",
"start": 84,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 23
}
},
"imported": {
"type": "Identifier",
"start": 84,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 23
}
},
"name": "queryDom"
},
"local": {
"type": "Identifier",
"start": 84,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 23
}
},
"name": "queryDom"
}
},
{
"type": "ImportSpecifier",
"start": 94,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 41
}
},
"imported": {
"type": "Identifier",
"start": 94,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 41
}
},
"name": "setPrefixedValue"
},
"local": {
"type": "Identifier",
"start": 94,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 41
}
},
"name": "setPrefixedValue"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 118,
"end": 135,
"loc": {
"start": {
"line": 3,
"column": 49
},
"end": {
"line": 3,
"column": 66
}
},
"value": "../core/helpers",
"rawValue": "../core/helpers",
"raw": "'../core/helpers'"
}
},
{
"type": "ImportDeclaration",
"start": 138,
"end": 183,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 45
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 147,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 20
}
},
"imported": {
"type": "Identifier",
"start": 147,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 20
}
},
"name": "lastCreated"
},
"local": {
"type": "Identifier",
"start": 147,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 20
}
},
"name": "lastCreated"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 166,
"end": 182,
"loc": {
"start": {
"line": 4,
"column": 28
},
"end": {
"line": 4,
"column": 44
}
},
"value": "../core/canvas",
"rawValue": "../core/canvas",
"raw": "'../core/canvas'"
}
},
{
"type": "ImportDeclaration",
"start": 185,
"end": 221,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 36
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 192,
"end": 201,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 192,
"end": 201,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 16
}
},
"name": "DomEvents"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 207,
"end": 220,
"loc": {
"start": {
"line": 5,
"column": 22
},
"end": {
"line": 5,
"column": 35
}
},
"value": "../core/dom",
"rawValue": "../core/dom",
"raw": "'../core/dom'"
}
},
{
"type": "ImportDeclaration",
"start": 223,
"end": 269,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 46
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 230,
"end": 241,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 230,
"end": 241,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 18
}
},
"name": "Interaction"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 247,
"end": 268,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 45
}
},
"value": "../core/interaction",
"rawValue": "../core/interaction",
"raw": "'../core/interaction'"
}
},
{
"type": "ImportDeclaration",
"start": 271,
"end": 305,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 34
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 278,
"end": 283,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 278,
"end": 283,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 12
}
},
"name": "Stats"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 289,
"end": 304,
"loc": {
"start": {
"line": 7,
"column": 18
},
"end": {
"line": 7,
"column": 33
}
},
"value": "../misc/stats",
"rawValue": "../misc/stats",
"raw": "'../misc/stats'"
}
},
{
"type": "ImportDeclaration",
"start": 307,
"end": 345,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 38
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 314,
"end": 319,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 314,
"end": 319,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 12
}
},
"name": "Orbit"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 325,
"end": 344,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 37
}
},
"value": "../controls/orbit",
"rawValue": "../controls/orbit",
"raw": "'../controls/orbit'"
}
},
{
"type": "ImportDeclaration",
"start": 347,
"end": 394,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 47
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 354,
"end": 365,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 354,
"end": 365,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 18
}
},
"name": "Perspective"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 371,
"end": 393,
"loc": {
"start": {
"line": 9,
"column": 24
},
"end": {
"line": 9,
"column": 46
}
},
"value": "../three/perspective",
"rawValue": "../three/perspective",
"raw": "'../three/perspective'"
}
},
{
"type": "ImportDeclaration",
"start": 398,
"end": 445,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 47
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 405,
"end": 416,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 405,
"end": 416,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 18
}
},
"name": "checkResize"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 422,
"end": 444,
"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.\r\n The view is defined and tracked by a dom node on which the drawing take place. ",
"start": 449,
"end": 602,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 14,
"column": 85
}
},
"range": [
449,
602
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 604,
"end": 17406,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 431,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 619,
"end": 17406,
"loc": {
"start": {
"line": 15,
"column": 15
},
"end": {
"line": 431,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 625,
"end": 629,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 25
}
},
"name": "View",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 630,
"end": 17406,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 431,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 2132,
"end": 7340,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 158,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 2132,
"end": 2143,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 38,
"column": 15
}
},
"name": "constructor",
"leadingComments": null
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 2143,
"end": 7340,
"loc": {
"start": {
"line": 38,
"column": 15
},
"end": {
"line": 158,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start": 2144,
"end": 2164,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 36
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 2144,
"end": 2150,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 22
}
},
"name": "canvas"
},
"right": {
"type": "Identifier",
"start": 2153,
"end": 2164,
"loc": {
"start": {
"line": 38,
"column": 25
},
"end": {
"line": 38,
"column": 36
}
},
"name": "lastCreated"
}
},
{
"type": "AssignmentPattern",
"start": 2166,
"end": 2178,
"loc": {
"start": {
"line": 38,
"column": 38
},
"end": {
"line": 38,
"column": 50
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 2166,
"end": 2173,
"loc": {
"start": {
"line": 38,
"column": 38
},
"end": {
"line": 38,
"column": 45
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 2176,
"end": 2178,
"loc": {
"start": {
"line": 38,
"column": 48
},
"end": {
"line": 38,
"column": 50
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 2180,
"end": 7340,
"loc": {
"start": {
"line": 38,
"column": 52
},
"end": {
"line": 158,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 2193,
"end": 2210,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2193,
"end": 2209,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2193,
"end": 2200,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 2193,
"end": 2197,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2198,
"end": 2200,
"loc": {
"start": {
"line": 40,
"column": 13
},
"end": {
"line": 40,
"column": 15
}
},
"name": "id"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 2203,
"end": 2209,
"loc": {
"start": {
"line": 40,
"column": 18
},
"end": {
"line": 40,
"column": 24
}
},
"callee": {
"type": "Identifier",
"start": 2203,
"end": 2207,
"loc": {
"start": {
"line": 40,
"column": 18
},
"end": {
"line": 40,
"column": 22
}
},
"name": "guid"
},
"arguments": []
}
}
},
{
"type": "ExpressionStatement",
"start": 2220,
"end": 2241,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2220,
"end": 2240,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2220,
"end": 2231,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 2220,
"end": 2224,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2225,
"end": 2231,
"loc": {
"start": {
"line": 41,
"column": 13
},
"end": {
"line": 41,
"column": 19
}
},
"name": "canvas"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 2234,
"end": 2240,
"loc": {
"start": {
"line": 41,
"column": 22
},
"end": {
"line": 41,
"column": 28
}
},
"name": "canvas"
}
}
},
{
"type": "ExpressionStatement",
"start": 2251,
"end": 2283,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 40
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2251,
"end": 2282,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 39
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2251,
"end": 2264,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 2251,
"end": 2255,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2256,
"end": 2264,
"loc": {
"start": {
"line": 42,
"column": 13
},
"end": {
"line": 42,
"column": 21
}
},
"name": "renderer"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 2267,
"end": 2282,
"loc": {
"start": {
"line": 42,
"column": 24
},
"end": {
"line": 42,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 2267,
"end": 2273,
"loc": {
"start": {
"line": 42,
"column": 24
},
"end": {
"line": 42,
"column": 30
}
},
"name": "canvas"
},
"property": {
"type": "Identifier",
"start": 2274,
"end": 2282,
"loc": {
"start": {
"line": 42,
"column": 31
},
"end": {
"line": 42,
"column": 39
}
},
"name": "renderer"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 2293,
"end": 2319,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 34
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2293,
"end": 2318,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 33
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2293,
"end": 2314,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 2293,
"end": 2297,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2298,
"end": 2314,
"loc": {
"start": {
"line": 43,
"column": 13
},
"end": {
"line": 43,
"column": 29
}
},
"name": "invalidateFrames"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 2317,
"end": 2318,
"loc": {
"start": {
"line": 43,
"column": 32
},
"end": {
"line": 43,
"column": 33
}
},
"value": 2,
"rawValue": 2,
"raw": "2"
}
}
},
{
"type": "ExpressionStatement",
"start": 2329,
"end": 2344,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 23
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2329,
"end": 2343,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 22
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2329,
"end": 2339,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 2329,
"end": 2333,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2334,
"end": 2339,
"loc": {
"start": {
"line": 44,
"column": 13
},
"end": {
"line": 44,
"column": 18
}
},
"name": "force"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 2342,
"end": 2343,
"loc": {
"start": {
"line": 44,
"column": 21
},
"end": {
"line": 44,
"column": 22
}
},
"value": 0,
"rawValue": 0,
"raw": "0"
}
}
},
{
"type": "ExpressionStatement",
"start": 2354,
"end": 2372,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 26
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2354,
"end": 2371,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 25
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2354,
"end": 2364,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 2354,
"end": 2358,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2359,
"end": 2364,
"loc": {
"start": {
"line": 45,
"column": 13
},
"end": {
"line": 45,
"column": 18
}
},
"name": "dirty"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 2367,
"end": 2371,
"loc": {
"start": {
"line": 45,
"column": 21
},
"end": {
"line": 45,
"column": 25
}
},
"value": true,
"rawValue": true,
"raw": "true"
}
}
},
{
"type": "ExpressionStatement",
"start": 2382,
"end": 2485,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 49,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2382,
"end": 2484,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 49,
"column": 9
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2382,
"end": 2393,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 2382,
"end": 2386,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 2387,
"end": 2393,
"loc": {
"start": {
"line": 46,
"column": 13