awv3
Version:
AWV client CAD framework
1,492 lines (1,491 loc) • 558 kB
JSON
{
"type": "Program",
"start": 0,
"end": 6774,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 185,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 74,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 74
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 8,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 17
}
},
"imported": {
"type": "Identifier",
"start": 8,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 17
}
},
"name": "Statement"
},
"local": {
"type": "Identifier",
"start": 8,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 17
}
},
"name": "Statement"
}
},
{
"type": "ImportSpecifier",
"start": 19,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 26
}
},
"imported": {
"type": "Identifier",
"start": 19,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 26
}
},
"name": "parseTo"
},
"local": {
"type": "Identifier",
"start": 19,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 26
}
},
"name": "parseTo"
}
},
{
"type": "ImportSpecifier",
"start": 28,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 43
}
},
"imported": {
"type": "Identifier",
"start": 28,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 43
}
},
"name": "parseObjectTree"
},
"local": {
"type": "Identifier",
"start": 28,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 43
}
},
"name": "parseObjectTree"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 50,
"end": 73,
"loc": {
"start": {
"line": 1,
"column": 50
},
"end": {
"line": 1,
"column": 73
}
},
"value": "../sketcher/cchelpers",
"rawValue": "../sketcher/cchelpers",
"raw": "'../sketcher/cchelpers'"
}
},
{
"type": "ImportDeclaration",
"start": 76,
"end": 102,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 83,
"end": 88,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 83,
"end": 88,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 94,
"end": 101,
"loc": {
"start": {
"line": 2,
"column": 18
},
"end": {
"line": 2,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
}
},
{
"type": "ImportDeclaration",
"start": 104,
"end": 143,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 39
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 111,
"end": 118,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 111,
"end": 118,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 14
}
},
"name": "Object3"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 124,
"end": 142,
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 38
}
},
"value": "../three/object3",
"rawValue": "../three/object3",
"raw": "'../three/object3'"
},
"trailingComments": [
{
"type": "Block",
"value": "\r\n * Base class for all objects having corresponding object on the server.\r\n * It is the default class for creating objects when parsing object tree.\r\n * To provide more specialized client class for corresponding server class use classMapping:\r\n * ClassCadObject.classMapping[\"MyServerClass\"] = MyClientClass;\r\n ",
"start": 147,
"end": 463,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 10,
"column": 3
}
},
"range": [
147,
463
]
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 465,
"end": 3095,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 78,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 472,
"end": 3095,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 78,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 478,
"end": 492,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 27
}
},
"name": "ClassCadObject",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 501,
"end": 508,
"loc": {
"start": {
"line": 11,
"column": 36
},
"end": {
"line": 11,
"column": 43
}
},
"name": "Object3"
},
"body": {
"type": "ClassBody",
"start": 509,
"end": 3095,
"loc": {
"start": {
"line": 11,
"column": 44
},
"end": {
"line": 78,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 516,
"end": 601,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 15,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 516,
"end": 527,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 527,
"end": 601,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 15,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 530,
"end": 601,
"loc": {
"start": {
"line": 12,
"column": 18
},
"end": {
"line": 15,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 541,
"end": 549,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 541,
"end": 548,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 541,
"end": 546,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 13
}
}
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 559,
"end": 594,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 43
}
},
"expression": {
"type": "AssignmentExpression",
"start": 559,
"end": 593,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 42
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 559,
"end": 571,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 559,
"end": 563,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 564,
"end": 571,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 20
}
},
"name": "members"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 574,
"end": 593,
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 42
}
},
"callee": {
"type": "MemberExpression",
"start": 574,
"end": 587,
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 36
}
},
"object": {
"type": "Identifier",
"start": 574,
"end": 580,
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 29
}
},
"name": "Object"
},
"property": {
"type": "Identifier",
"start": 581,
"end": 587,
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 36
}
},
"name": "create"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 588,
"end": 592,
"loc": {
"start": {
"line": 14,
"column": 37
},
"end": {
"line": 14,
"column": 41
}
},
"value": null,
"rawValue": null,
"raw": "null"
}
]
}
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 609,
"end": 806,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 21,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 613,
"end": 621,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 16
}
},
"name": "fullName"
},
"static": false,
"kind": "get",
"value": {
"type": "FunctionExpression",
"start": 621,
"end": 806,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 21,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 624,
"end": 806,
"loc": {
"start": {
"line": 17,
"column": 19
},
"end": {
"line": 21,
"column": 5
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 635,
"end": 659,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 32
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 639,
"end": 658,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 31
}
},
"id": {
"type": "Identifier",
"start": 639,
"end": 644,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 17
}
},
"name": "names"
},
"init": {
"type": "ArrayExpression",
"start": 647,
"end": 658,
"loc": {
"start": {
"line": 18,
"column": 20
},
"end": {
"line": 18,
"column": 31
}
},
"elements": [
{
"type": "MemberExpression",
"start": 648,
"end": 657,
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 18,
"column": 30
}
},
"object": {
"type": "ThisExpression",
"start": 648,
"end": 652,
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 18,
"column": 25
}
}
},
"property": {
"type": "Identifier",
"start": 653,
"end": 657,
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 30
}
},
"name": "name"
},
"computed": false
}
]
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 669,
"end": 756,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 95
}
},
"expression": {
"type": "CallExpression",
"start": 669,
"end": 755,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 94
}
},
"callee": {
"type": "MemberExpression",
"start": 669,
"end": 691,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 30
}
},
"object": {
"type": "ThisExpression",
"start": 669,
"end": 673,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 674,
"end": 691,
"loc": {
"start": {
"line": 19,
"column": 13
},
"end": {
"line": 19,
"column": 30
}
},
"name": "traverseAncestors"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 692,
"end": 754,
"loc": {
"start": {
"line": 19,
"column": 31
},
"end": {
"line": 19,
"column": 93
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 692,
"end": 695,
"loc": {
"start": {
"line": 19,
"column": 31
},
"end": {
"line": 19,
"column": 34
}
},
"name": "anc"
}
],
"body": {
"type": "LogicalExpression",
"start": 699,
"end": 754,
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 93
}
},
"left": {
"type": "BinaryExpression",
"start": 700,
"end": 729,
"loc": {
"start": {
"line": 19,
"column": 39
},
"end": {
"line": 19,
"column": 68
}
},
"left": {
"type": "Identifier",
"start": 700,
"end": 703,
"loc": {
"start": {
"line": 19,
"column": 39
},
"end": {
"line": 19,
"column": 42
}
},
"name": "anc"
},
"operator": "instanceof",
"right": {
"type": "Identifier",
"start": 715,
"end": 729,
"loc": {
"start": {
"line": 19,
"column": 54
},
"end": {
"line": 19,
"column": 68
}
},
"name": "ClassCadObject"
},
"parenthesizedExpression": true
},
"operator": "&&",
"right": {
"type": "CallExpression",
"start": 734,
"end": 754,
"loc": {
"start": {
"line": 19,
"column": 73
},
"end": {
"line": 19,
"column": 93
}
},
"callee": {
"type": "MemberExpression",
"start": 734,
"end": 744,
"loc": {
"start": {
"line": 19,
"column": 73
},
"end": {
"line": 19,
"column": 83
}
},
"object": {
"type": "Identifier",
"start": 734,
"end": 739,
"loc": {
"start": {
"line": 19,
"column": 73
},
"end": {
"line": 19,
"column": 78
}
},
"name": "names"
},
"property": {
"type": "Identifier",
"start": 740,
"end": 744,
"loc": {
"start": {
"line": 19,
"column": 79
},
"end": {
"line": 19,
"column": 83
}
},
"name": "push"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 745,
"end": 753,
"loc": {
"start": {
"line": 19,
"column": 84
},
"end": {
"line": 19,
"column": 92
}
},
"object": {
"type": "Identifier",
"start": 745,
"end": 748,
"loc": {
"start": {
"line": 19,
"column": 84
},
"end": {
"line": 19,
"column": 87
}
},
"name": "anc"
},
"property": {
"type": "Identifier",
"start": 749,
"end": 753,
"loc": {
"start": {
"line": 19,
"column": 88
},
"end": {
"line": 19,
"column": 92
}
},
"name": "name"
},
"computed": false
}
]
}
}
}
]
}
},
{
"type": "ReturnStatement",
"start": 766,
"end": 799,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 41
}
},
"argument": {
"type": "CallExpression",
"start": 773,
"end": 798,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 40
}
},
"callee": {
"type": "MemberExpression",
"start": 773,
"end": 793,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 35
}
},
"object": {
"type": "CallExpression",
"start": 773,
"end": 788,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 30
}
},
"callee": {
"type": "MemberExpression",
"start": 773,
"end": 786,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 28
}
},
"object": {
"type": "Identifier",
"start": 773,
"end": 778,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 20
}
},
"name": "names"
},
"property": {
"type": "Identifier",
"start": 779,
"end": 786,
"loc": {
"start": {
"line": 20,
"column": 21
},
"end": {
"line": 20,
"column": 28
}
},
"name": "reverse"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 789,
"end": 793,
"loc": {
"start": {
"line": 20,
"column": 31
},
"end": {
"line": 20,
"column": 35
}
},
"name": "join"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 794,
"end": 797,
"loc": {
"start": {
"line": 20,
"column": 36
},
"end": {
"line": 20,
"column": 39
}
},
"value": ".",
"rawValue": ".",
"raw": "'.'"
}
]
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 814,
"end": 905,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 25,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 814,
"end": 830,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 20
}
},
"name": "updateFromServer"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 830,
"end": 905,
"loc": {
"start": {
"line": 23,
"column": 20
},
"end": {
"line": 25,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 833,
"end": 905,
"loc": {
"start": {
"line": 23,
"column": 23
},
"end": {
"line": 25,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 844,
"end": 898,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 62
}
},
"argument": {
"type": "CallExpression",
"start": 851,
"end": 897,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 24,
"column": 61
}
},
"callee": {
"type": "MemberExpression",
"start": 851,
"end": 882,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 24,
"column": 46
}
},
"object": {
"type": "CallExpression",
"start": 851,
"end": 877,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 24,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 851,
"end": 871,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 24,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 851,
"end": 860,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 24,
"column": 24
}
},
"name": "Statement"
},
"property": {
"type": "Identifier",
"start": 861,
"end": 871,
"loc": {
"start": {
"line": 24,
"column": 25
},
"end": {
"line": 24,