@shapediver/viewer.shared.node-tree 1.15.7 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{AbstractTreeNodeData.d.ts → implementation/AbstractTreeNodeData.d.ts} +1 -1
  2. package/dist/implementation/AbstractTreeNodeData.d.ts.map +1 -0
  3. package/dist/{AbstractTreeNodeData.js → implementation/AbstractTreeNodeData.js} +0 -0
  4. package/dist/implementation/AbstractTreeNodeData.js.map +1 -0
  5. package/dist/implementation/Tree.d.ts +13 -0
  6. package/dist/implementation/Tree.d.ts.map +1 -0
  7. package/dist/{Tree.js → implementation/Tree.js} +17 -54
  8. package/dist/implementation/Tree.js.map +1 -0
  9. package/dist/implementation/TreeNode.d.ts +57 -0
  10. package/dist/implementation/TreeNode.d.ts.map +1 -0
  11. package/dist/{TreeNode.js → implementation/TreeNode.js} +91 -96
  12. package/dist/implementation/TreeNode.js.map +1 -0
  13. package/dist/index.d.ts +7 -5
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +4 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/{Tree.d.ts → interfaces/ITree.d.ts} +16 -22
  18. package/dist/interfaces/ITree.d.ts.map +1 -0
  19. package/dist/interfaces/ITree.js +3 -0
  20. package/dist/interfaces/ITree.js.map +1 -0
  21. package/dist/interfaces/ITreeNode.d.ts +115 -0
  22. package/dist/interfaces/ITreeNode.d.ts.map +1 -0
  23. package/dist/interfaces/ITreeNode.js +3 -0
  24. package/dist/interfaces/ITreeNode.js.map +1 -0
  25. package/package.json +12 -9
  26. package/src/implementation/AbstractTreeNodeData.ts +62 -0
  27. package/src/implementation/Tree.ts +120 -0
  28. package/src/implementation/TreeNode.ts +321 -0
  29. package/src/index.ts +21 -0
  30. package/src/interfaces/ISDObject.ts +11 -0
  31. package/src/interfaces/ITree.ts +56 -0
  32. package/src/interfaces/ITreeNode.ts +150 -0
  33. package/src/interfaces/ITreeNodeData.ts +6 -0
  34. package/tsconfig.json +17 -0
  35. package/dist/AbstractTreeNodeData.d.ts.map +0 -1
  36. package/dist/AbstractTreeNodeData.js.map +0 -1
  37. package/dist/Tree.d.ts.map +0 -1
  38. package/dist/Tree.js.map +0 -1
  39. package/dist/TreeNode.d.ts +0 -93
  40. package/dist/TreeNode.d.ts.map +0 -1
  41. package/dist/TreeNode.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { ITreeNodeData } from './interfaces/ITreeNodeData';
1
+ import { ITreeNodeData } from '../interfaces/ITreeNodeData';
2
2
  export declare abstract class AbstractTreeNodeData implements ITreeNodeData {
3
3
  #private;
4
4
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractTreeNodeData.d.ts","sourceRoot":"","sources":["../../src/implementation/AbstractTreeNodeData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAE3D,8BAAsB,oBAAqB,YAAW,aAAa;;IAajE;;;;OAIG;gBACS,EAAE,CAAC,EAAE,MAAM;IASvB,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;IAMD;;OAEG;IACI,aAAa,IAAI,IAAI;IAQ5B;;OAEG;aACa,KAAK,IAAI,aAAa;CAGvC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractTreeNodeData.js","sourceRoot":"","sources":["../../src/implementation/AbstractTreeNodeData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAAoC;AACpC,+EAA0F;AAI1F,MAAsB,oBAAoB;IASxC,4BAA4B;IAE5B,2BAA2B;IAE3B;;;;OAIG;IACH,YAAY,EAAW;QAjBvB,yBAAyB;QAEzB,gDAAiB;QAEjB,2CAAqB;QACrB,8CAAwD,oBAAS,CAAC,OAAO,CAAC,sCAAa,CAAC,EAAC;QACzF,4CAAkD,oBAAS,CAAC,OAAO,CAAC,oCAAW,CAAC,EAAC;QAY/E,uBAAA,IAAI,4BAAO,EAAE,IAAI,uBAAA,IAAI,2CAAe,CAAC,MAAM,EAAE,MAAA,CAAC;QAC9C,uBAAA,IAAI,iCAAY,uBAAA,IAAI,2CAAe,CAAC,MAAM,EAAE,MAAA,CAAC;IAC/C,CAAC;IAED,8BAA8B;IAE9B,+BAA+B;IAE/B,IAAW,EAAE;QACX,OAAO,uBAAA,IAAI,gCAAI,CAAC;IAClB,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,uBAAA,IAAI,qCAAS,CAAC;IACvB,CAAC;IAED,kCAAkC;IAElC,6BAA6B;IAE7B;;OAEG;IACI,aAAa;QAClB,uBAAA,IAAI,iCAAY,uBAAA,IAAI,2CAAe,CAAC,MAAM,EAAE,MAAA,CAAC;IAC/C,CAAC;CAYF;AAxDD,oDAwDC"}
@@ -0,0 +1,13 @@
1
+ import { ITree } from '../interfaces/ITree';
2
+ import { ITreeNode } from '../interfaces/ITreeNode';
3
+ export declare class Tree implements ITree {
4
+ #private;
5
+ constructor();
6
+ get root(): ITreeNode;
7
+ addNode(node: ITreeNode, parent?: ITreeNode, root?: ITreeNode): boolean;
8
+ addNodeAtPath(node: ITreeNode, path?: string, root?: ITreeNode): boolean;
9
+ getNodeAtPath(path?: string, root?: ITreeNode): ITreeNode | null;
10
+ removeNode(node: ITreeNode, root?: ITreeNode): boolean;
11
+ removeNodeAtPath(path: string, root?: ITreeNode): boolean;
12
+ }
13
+ //# sourceMappingURL=Tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../src/implementation/Tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,qBACa,IAAK,YAAW,KAAK;;;IAehC,IAAW,IAAI,IAAI,SAAS,CAE3B;IAMM,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,SAAsB,EAAE,IAAI,GAAE,SAAsB,GAAG,OAAO;IAe/F,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,GAAE,MAA4B,EAAE,IAAI,GAAE,SAAsB,GAAG,OAAO;IAoBzG,aAAa,CAAC,IAAI,GAAE,MAA4B,EAAE,IAAI,GAAE,SAAsB,GAAG,SAAS,GAAG,IAAI;IAiBjG,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,GAAE,SAAsB,GAAG,OAAO;IAgBlE,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,SAAsB,GAAG,OAAO;CAqB7E"}
@@ -21,10 +21,6 @@ const TreeNode_1 = require("./TreeNode");
21
21
  let Tree = class Tree {
22
22
  // #endregion Properties (1)
23
23
  // #region Constructors (1)
24
- /**
25
- * @ignore
26
- * Management of the main tree node.
27
- */
28
24
  constructor() {
29
25
  // #region Properties (1)
30
26
  _Tree_root.set(this, new TreeNode_1.TreeNode('root'));
@@ -35,14 +31,7 @@ let Tree = class Tree {
35
31
  return __classPrivateFieldGet(this, _Tree_root, "f");
36
32
  }
37
33
  // #endregion Public Accessors (1)
38
- // #region Public Methods (4)
39
- /**
40
- * Add the node as a child of the corresponding parent node.
41
- *
42
- * @param node the node to be added
43
- * @param parent the targeted parent node
44
- * @param root optional root at which the process begins, root node will be used per default
45
- */
34
+ // #region Public Methods (6)
46
35
  addNode(node, parent = __classPrivateFieldGet(this, _Tree_root, "f"), root = __classPrivateFieldGet(this, _Tree_root, "f")) {
47
36
  if (root === parent) {
48
37
  root.addChild(node);
@@ -56,13 +45,6 @@ let Tree = class Tree {
56
45
  }
57
46
  return false;
58
47
  }
59
- /**
60
- * Add the node at the corresponding path. (paths are dot separated ids)
61
- *
62
- * @param node the node to be added
63
- * @param path the path at which the node should be added
64
- * @param root optional root at which the process begins, root node will be used per default
65
- */
66
48
  addNodeAtPath(node, path = this.root.getPath(), root = __classPrivateFieldGet(this, _Tree_root, "f")) {
67
49
  if (root.name === path) {
68
50
  root.addChild(node);
@@ -80,12 +62,21 @@ let Tree = class Tree {
80
62
  }
81
63
  return false;
82
64
  }
83
- /**
84
- * Remove a node from the tree.
85
- *
86
- * @param node the node to remove
87
- * @param root optional root at which the process begins, root node will be used per default
88
- */
65
+ getNodeAtPath(path = this.root.getPath(), root = __classPrivateFieldGet(this, _Tree_root, "f")) {
66
+ if (root.name === path)
67
+ return root;
68
+ const pathStart = path.substr(0, path.indexOf('.'));
69
+ if (root.name === pathStart) {
70
+ const shortenedPath = path.substr(pathStart.length + 1, path.length);
71
+ for (let i = 0; i < root.children.length; i++) {
72
+ const child = root.children[i];
73
+ const res = this.getNodeAtPath(shortenedPath, child);
74
+ if (res)
75
+ return res;
76
+ }
77
+ }
78
+ return null;
79
+ }
89
80
  removeNode(node, root = __classPrivateFieldGet(this, _Tree_root, "f")) {
90
81
  if (root.hasChild(node)) {
91
82
  root.removeChild(node);
@@ -99,12 +90,6 @@ let Tree = class Tree {
99
90
  }
100
91
  return false;
101
92
  }
102
- /**
103
- * Remove a node via the path of it.
104
- *
105
- * @param path the path of the node to be removed
106
- * @param root optional root at which the process begins, root node will be used per default
107
- */
108
93
  removeNodeAtPath(path, root = __classPrivateFieldGet(this, _Tree_root, "f")) {
109
94
  var _a;
110
95
  if (root.name === path) {
@@ -123,32 +108,10 @@ let Tree = class Tree {
123
108
  }
124
109
  return false;
125
110
  }
126
- /**
127
- * Get the node at the provided path.
128
- *
129
- * @param path
130
- * @param root
131
- * @returns
132
- */
133
- getNodeAtPath(path = this.root.getPath(), root = __classPrivateFieldGet(this, _Tree_root, "f")) {
134
- if (root.name === path)
135
- return root;
136
- const pathStart = path.substr(0, path.indexOf('.'));
137
- if (root.name === pathStart) {
138
- const shortenedPath = path.substr(pathStart.length + 1, path.length);
139
- for (let i = 0; i < root.children.length; i++) {
140
- const child = root.children[i];
141
- const res = this.getNodeAtPath(shortenedPath, child);
142
- if (res)
143
- return res;
144
- }
145
- }
146
- return null;
147
- }
148
111
  };
149
112
  _Tree_root = new WeakMap();
150
113
  Tree = __decorate([
151
- tsyringe_1.singleton(),
114
+ (0, tsyringe_1.singleton)(),
152
115
  __metadata("design:paramtypes", [])
153
116
  ], Tree);
154
117
  exports.Tree = Tree;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../src/implementation/Tree.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAoC;AAIpC,yCAAqC;AAGrC,IAAa,IAAI,GAAjB,MAAa,IAAI;IAKf,4BAA4B;IAE5B,2BAA2B;IAE3B;QARA,yBAAyB;QAEzB,qBAAiB,IAAI,mBAAQ,CAAC,MAAM,CAAC,EAAC;IAMtB,CAAC;IAEjB,8BAA8B;IAE9B,+BAA+B;IAE/B,IAAW,IAAI;QACb,OAAO,uBAAA,IAAI,kBAAM,CAAC;IACpB,CAAC;IAED,kCAAkC;IAElC,6BAA6B;IAEtB,OAAO,CAAC,IAAe,EAAE,SAAoB,uBAAA,IAAI,kBAAM,EAAE,OAAkB,uBAAA,IAAI,kBAAM;QAC1F,IAAI,IAAI,KAAK,MAAM,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpB,OAAO,IAAI,CAAC;SACb;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE;gBAC9C,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,aAAa,CAAC,IAAe,EAAE,OAAe,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAkB,uBAAA,IAAI,k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,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAErE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAC/B,IAAI,KAAK,IAAI,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE;oBACxD,OAAO,IAAI,CAAC;iBACb;aACF;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CAGF,CAAA;;AAhHY,IAAI;IADhB,IAAA,oBAAS,GAAE;;GACC,IAAI,CAgHhB;AAhHY,oBAAI"}
@@ -0,0 +1,57 @@
1
+ import { mat4 } from 'gl-matrix';
2
+ import { IBox } from '@shapediver/viewer.shared.math';
3
+ import { ITransformation, ITreeNode } from '../interfaces/ITreeNode';
4
+ import { ITreeNodeData } from '../interfaces/ITreeNodeData';
5
+ import { ISDObject } from '../interfaces/ISDObject';
6
+ export declare class TreeNode implements ITreeNode {
7
+ #private;
8
+ /**
9
+ * Creation of a node that can be used in the node tree.
10
+ *
11
+ * @param name the name of the node
12
+ * @param parent the parent of this node
13
+ * @param data the array of data
14
+ * @param transformations the array of transformations
15
+ */
16
+ constructor(name?: string, parent?: ITreeNode, data?: ITreeNodeData[], transformations?: ITransformation[]);
17
+ get boundingBox(): IBox;
18
+ get children(): ITreeNode[];
19
+ get data(): ITreeNodeData[];
20
+ get excludeViewports(): string[];
21
+ set excludeViewports(value: string[]);
22
+ get id(): string;
23
+ get name(): string;
24
+ get nodeMatrix(): mat4;
25
+ get parent(): ITreeNode | undefined;
26
+ set parent(value: ITreeNode | undefined);
27
+ get restrictViewports(): string[];
28
+ set restrictViewports(value: string[]);
29
+ get transformations(): ITransformation[];
30
+ set transformations(value: ITransformation[]);
31
+ get transformedNodes(): {
32
+ [key: string]: ISDObject;
33
+ };
34
+ get version(): string;
35
+ set version(value: string);
36
+ get visible(): boolean;
37
+ set visible(value: boolean);
38
+ get worldMatrix(): mat4;
39
+ addChild(child: ITreeNode): boolean;
40
+ addData(data: ITreeNodeData): boolean;
41
+ addTransformation(transformation: ITransformation): boolean;
42
+ clone(): ITreeNode;
43
+ cloneInstance(): ITreeNode;
44
+ getChild(id: string): ITreeNode | undefined;
45
+ getData(id: string): ITreeNodeData | undefined;
46
+ getPath(): string;
47
+ getTransformation(id: string): ITransformation | undefined;
48
+ hasChild(child: ITreeNode): boolean;
49
+ hasData(data: ITreeNodeData): boolean;
50
+ hasTransformation(transformation: ITransformation): boolean;
51
+ removeChild(child: ITreeNode): boolean;
52
+ removeData(data: ITreeNodeData): boolean;
53
+ removeTransformation(transformation: ITransformation): boolean;
54
+ traverse(callback: (node: ITreeNode) => void): void;
55
+ updateVersion(): void;
56
+ }
57
+ //# sourceMappingURL=TreeNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeNode.d.ts","sourceRoot":"","sources":["../../src/implementation/TreeNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAO,IAAI,EAAE,MAAM,gCAAgC,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,qBAAa,QAAS,YAAW,SAAS;;IA4BxC;;;;;;;OAOG;gBAED,IAAI,GAAE,MAAe,EACrB,MAAM,CAAC,EAAE,SAAS,EAClB,IAAI,GAAE,aAAa,EAAO,EAC1B,eAAe,GAAE,eAAe,EAAO;IAgBzC,IAAW,WAAW,IAAI,IAAI,CAE7B;IAED,IAAW,QAAQ,IAAI,SAAS,EAAE,CAEjC;IAED,IAAW,IAAI,IAAI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G,SAAS;IAO1D,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAInC,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAIrC,iBAAiB,CAAC,cAAc,EAAE,eAAe,GAAG,OAAO;IAI3D,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAStC,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAQxC,oBAAoB,CAAC,cAAc,EAAE,eAAe,GAAG,OAAO;IAQ9D,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,IAAI;IAOnD,aAAa,IAAI,IAAI;CAc7B"}
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _TreeNode_children, _TreeNode_data, _TreeNode_eventEngine, _TreeNode_name, _TreeNode_uuidGenerator, _TreeNode_boundingBox, _TreeNode_id, _TreeNode_parent, _TreeNode_transformations, _TreeNode_transformedNodes, _TreeNode_excludeViewers, _TreeNode_includeViewers, _TreeNode_version, _TreeNode_visible, _TreeNode_bone;
13
+ var _TreeNode_uuidGenerator, _TreeNode_children, _TreeNode_data, _TreeNode_transformations, _TreeNode_id, _TreeNode_name, _TreeNode_version, _TreeNode_parent, _TreeNode_boundingBox, _TreeNode_transformedNodes, _TreeNode_excludeViewports, _TreeNode_restrictViewports, _TreeNode_visible;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.TreeNode = void 0;
16
16
  const gl_matrix_1 = require("gl-matrix");
@@ -18,7 +18,7 @@ const tsyringe_1 = require("tsyringe");
18
18
  const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
19
19
  const viewer_shared_math_1 = require("@shapediver/viewer.shared.math");
20
20
  class TreeNode {
21
- // #endregion Properties (10)
21
+ // #endregion Properties (13)
22
22
  // #region Constructors (1)
23
23
  /**
24
24
  * Creation of a node that can be used in the node tree.
@@ -28,24 +28,22 @@ class TreeNode {
28
28
  * @param data the array of data
29
29
  * @param transformations the array of transformations
30
30
  */
31
- constructor(name = 'node', parent = null, data = [], transformations = []) {
31
+ constructor(name = 'node', parent, data = [], transformations = []) {
32
32
  var _a;
33
- // #region Properties (10)
33
+ // #region Properties (13)
34
+ _TreeNode_uuidGenerator.set(this, tsyringe_1.container.resolve(viewer_shared_services_1.UuidGenerator));
34
35
  _TreeNode_children.set(this, []);
35
36
  _TreeNode_data.set(this, []);
36
- _TreeNode_eventEngine.set(this, tsyringe_1.container.resolve(viewer_shared_services_1.EventEngine));
37
+ _TreeNode_transformations.set(this, []);
38
+ _TreeNode_id.set(this, void 0);
37
39
  _TreeNode_name.set(this, '');
38
- _TreeNode_uuidGenerator.set(this, tsyringe_1.container.resolve(viewer_shared_services_1.UuidGenerator));
40
+ _TreeNode_version.set(this, void 0);
41
+ _TreeNode_parent.set(this, void 0);
39
42
  _TreeNode_boundingBox.set(this, new viewer_shared_math_1.Box());
40
- _TreeNode_id.set(this, void 0);
41
- _TreeNode_parent.set(this, null);
42
- _TreeNode_transformations.set(this, []);
43
43
  _TreeNode_transformedNodes.set(this, {});
44
- _TreeNode_excludeViewers.set(this, []);
45
- _TreeNode_includeViewers.set(this, []);
46
- _TreeNode_version.set(this, void 0);
44
+ _TreeNode_excludeViewports.set(this, []);
45
+ _TreeNode_restrictViewports.set(this, []);
47
46
  _TreeNode_visible.set(this, true);
48
- _TreeNode_bone.set(this, false);
49
47
  __classPrivateFieldSet(this, _TreeNode_name, name.replace(/\./g, "_"), "f");
50
48
  __classPrivateFieldSet(this, _TreeNode_parent, parent, "f");
51
49
  __classPrivateFieldSet(this, _TreeNode_data, data, "f");
@@ -55,43 +53,26 @@ class TreeNode {
55
53
  (_a = __classPrivateFieldGet(this, _TreeNode_parent, "f")) === null || _a === void 0 ? void 0 : _a.addChild(this);
56
54
  }
57
55
  // #endregion Constructors (1)
58
- // #region Public Accessors (14)
59
- get bone() {
60
- return __classPrivateFieldGet(this, _TreeNode_bone, "f");
61
- }
62
- set bone(value) {
63
- __classPrivateFieldSet(this, _TreeNode_bone, value, "f");
64
- }
56
+ // #region Public Accessors (19)
65
57
  get boundingBox() {
66
58
  return __classPrivateFieldGet(this, _TreeNode_boundingBox, "f");
67
59
  }
68
- set boundingBox(value) {
69
- __classPrivateFieldSet(this, _TreeNode_boundingBox, value, "f");
70
- }
71
60
  get children() {
72
61
  return __classPrivateFieldGet(this, _TreeNode_children, "f");
73
62
  }
74
63
  get data() {
75
64
  return __classPrivateFieldGet(this, _TreeNode_data, "f");
76
65
  }
77
- get excludeViewers() {
78
- return __classPrivateFieldGet(this, _TreeNode_excludeViewers, "f");
66
+ get excludeViewports() {
67
+ return __classPrivateFieldGet(this, _TreeNode_excludeViewports, "f");
79
68
  }
80
- set excludeViewers(value) {
81
- __classPrivateFieldSet(this, _TreeNode_excludeViewers, value, "f");
69
+ set excludeViewports(value) {
70
+ __classPrivateFieldSet(this, _TreeNode_excludeViewports, value, "f");
71
+ this.updateVersion();
82
72
  }
83
73
  get id() {
84
74
  return __classPrivateFieldGet(this, _TreeNode_id, "f");
85
75
  }
86
- set id(value) {
87
- __classPrivateFieldSet(this, _TreeNode_id, value, "f");
88
- }
89
- get includeViewers() {
90
- return __classPrivateFieldGet(this, _TreeNode_includeViewers, "f");
91
- }
92
- set includeViewers(value) {
93
- __classPrivateFieldSet(this, _TreeNode_includeViewers, value, "f");
94
- }
95
76
  get name() {
96
77
  return __classPrivateFieldGet(this, _TreeNode_name, "f");
97
78
  }
@@ -102,40 +83,40 @@ class TreeNode {
102
83
  gl_matrix_1.mat4.multiply(matrix, matrix, transform.matrix);
103
84
  return matrix;
104
85
  }
105
- get nodeMatrixSDTF() {
106
- const matrix = gl_matrix_1.mat4.create();
107
- for (let transform of __classPrivateFieldGet(this, _TreeNode_transformations, "f"))
108
- gl_matrix_1.mat4.multiply(matrix, matrix, transform.matrix);
109
- return matrix;
110
- }
111
86
  get parent() {
112
87
  return __classPrivateFieldGet(this, _TreeNode_parent, "f");
113
88
  }
114
89
  set parent(value) {
115
90
  // check if it was removed from previous parent
116
- if (value === null && __classPrivateFieldGet(this, _TreeNode_parent, "f") !== null)
91
+ if (__classPrivateFieldGet(this, _TreeNode_parent, "f"))
117
92
  __classPrivateFieldGet(this, _TreeNode_parent, "f").removeChild(this);
118
93
  // check if it is in children of new parent
119
- if (value !== null)
94
+ if (value)
120
95
  value.addChild(this);
121
96
  __classPrivateFieldSet(this, _TreeNode_parent, value, "f");
122
97
  }
98
+ get restrictViewports() {
99
+ return __classPrivateFieldGet(this, _TreeNode_restrictViewports, "f");
100
+ }
101
+ set restrictViewports(value) {
102
+ __classPrivateFieldSet(this, _TreeNode_restrictViewports, value, "f");
103
+ this.updateVersion();
104
+ }
123
105
  get transformations() {
124
106
  return __classPrivateFieldGet(this, _TreeNode_transformations, "f");
125
107
  }
126
108
  set transformations(value) {
127
109
  __classPrivateFieldSet(this, _TreeNode_transformations, value, "f");
128
- this.updateVersion();
129
110
  }
130
111
  get transformedNodes() {
131
112
  return __classPrivateFieldGet(this, _TreeNode_transformedNodes, "f");
132
113
  }
133
- set transformedNodes(value) {
134
- __classPrivateFieldSet(this, _TreeNode_transformedNodes, value, "f");
135
- }
136
114
  get version() {
137
115
  return __classPrivateFieldGet(this, _TreeNode_version, "f");
138
116
  }
117
+ set version(value) {
118
+ __classPrivateFieldSet(this, _TreeNode_version, value, "f");
119
+ }
139
120
  get visible() {
140
121
  return __classPrivateFieldGet(this, _TreeNode_visible, "f");
141
122
  }
@@ -149,30 +130,33 @@ class TreeNode {
149
130
  gl_matrix_1.mat4.multiply(matrix, matrix, transform.matrix);
150
131
  let node = this;
151
132
  while (node.parent) {
152
- gl_matrix_1.mat4.multiply(matrix, matrix, node.parent.nodeMatrix);
133
+ gl_matrix_1.mat4.multiply(matrix, node.parent.nodeMatrix, matrix);
153
134
  node = node.parent;
154
135
  }
155
136
  return matrix;
156
137
  }
157
- // #endregion Public Accessors (14)
158
- // #region Public Methods (9)
159
- /**
160
- * Add a child from the children of this node.
161
- *
162
- * @param child the child to add
163
- */
138
+ // #endregion Public Accessors (19)
139
+ // #region Public Methods (16)
164
140
  addChild(child) {
165
141
  if (this.hasChild(child))
166
142
  return false;
167
143
  __classPrivateFieldGet(this, _TreeNode_children, "f").push(child);
168
- if (child.parent !== null)
144
+ if (child.parent)
169
145
  child.parent.removeChild(child);
170
146
  child.parent = this;
147
+ this.updateVersion();
148
+ return true;
149
+ }
150
+ addData(data) {
151
+ __classPrivateFieldGet(this, _TreeNode_data, "f").push(data);
152
+ this.updateVersion();
153
+ return true;
154
+ }
155
+ addTransformation(transformation) {
156
+ __classPrivateFieldGet(this, _TreeNode_transformations, "f").push(transformation);
157
+ this.updateVersion();
171
158
  return true;
172
159
  }
173
- /**
174
- * Clones this node and all its children.
175
- */
176
160
  clone() {
177
161
  const clone = new TreeNode(this.name);
178
162
  clone.visible = this.visible;
@@ -181,15 +165,12 @@ class TreeNode {
181
165
  for (let data of __classPrivateFieldGet(this, _TreeNode_data, "f"))
182
166
  clone.data.push(data.clone());
183
167
  for (let transform of __classPrivateFieldGet(this, _TreeNode_transformations, "f"))
184
- clone.transformations.push({
168
+ clone.addTransformation({
185
169
  id: transform.id,
186
170
  matrix: gl_matrix_1.mat4.clone(transform.matrix)
187
171
  });
188
172
  return clone;
189
173
  }
190
- /**
191
- * Clones this node and all its children.
192
- */
193
174
  cloneInstance() {
194
175
  const clone = new TreeNode(this.name);
195
176
  clone.visible = this.visible;
@@ -198,25 +179,24 @@ class TreeNode {
198
179
  for (let data of __classPrivateFieldGet(this, _TreeNode_data, "f"))
199
180
  clone.data.push(data);
200
181
  for (let transform of __classPrivateFieldGet(this, _TreeNode_transformations, "f"))
201
- clone.transformations.push({
182
+ clone.addTransformation({
202
183
  id: transform.id,
203
184
  matrix: gl_matrix_1.mat4.clone(transform.matrix)
204
185
  });
205
186
  return clone;
206
187
  }
207
- /**
208
- * Returns the child with the specified id
209
- * @return {TreeNode}
210
- */
211
188
  getChild(id) {
212
189
  for (let i = 0; i < __classPrivateFieldGet(this, _TreeNode_children, "f").length; i++)
213
190
  if (__classPrivateFieldGet(this, _TreeNode_children, "f")[i].id === id)
214
191
  return __classPrivateFieldGet(this, _TreeNode_children, "f")[i];
215
- return null;
192
+ return;
193
+ }
194
+ getData(id) {
195
+ for (let i = 0; i < __classPrivateFieldGet(this, _TreeNode_data, "f").length; i++)
196
+ if (__classPrivateFieldGet(this, _TreeNode_data, "f")[i].id === id)
197
+ return __classPrivateFieldGet(this, _TreeNode_data, "f")[i];
198
+ return;
216
199
  }
217
- /**
218
- * Return the path to this node.
219
- */
220
200
  getPath() {
221
201
  let path = this.name;
222
202
  let node = this.parent;
@@ -226,47 +206,62 @@ class TreeNode {
226
206
  }
227
207
  return path;
228
208
  }
229
- /**
230
- * Check for existence of a child from the children of this node.
231
- *
232
- * @param child the child to check
233
- */
209
+ getTransformation(id) {
210
+ for (let i = 0; i < __classPrivateFieldGet(this, _TreeNode_transformations, "f").length; i++)
211
+ if (__classPrivateFieldGet(this, _TreeNode_transformations, "f")[i].id === id)
212
+ return __classPrivateFieldGet(this, _TreeNode_transformations, "f")[i];
213
+ return;
214
+ }
234
215
  hasChild(child) {
235
216
  return __classPrivateFieldGet(this, _TreeNode_children, "f").includes(child);
236
217
  }
237
- /**
238
- * Remove a child from the children of this node.
239
- *
240
- * @param child the child to remove
241
- */
218
+ hasData(data) {
219
+ return __classPrivateFieldGet(this, _TreeNode_data, "f").includes(data);
220
+ }
221
+ hasTransformation(transformation) {
222
+ return __classPrivateFieldGet(this, _TreeNode_transformations, "f").includes(transformation);
223
+ }
242
224
  removeChild(child) {
243
225
  const index = __classPrivateFieldGet(this, _TreeNode_children, "f").indexOf(child);
244
226
  if (index === -1)
245
227
  return false;
246
228
  __classPrivateFieldGet(this, _TreeNode_children, "f").splice(index, 1);
247
- child.parent = null;
229
+ child.parent = undefined;
230
+ this.updateVersion();
248
231
  return true;
249
232
  }
250
- /**
251
- * Update the version
252
- */
233
+ removeData(data) {
234
+ const index = __classPrivateFieldGet(this, _TreeNode_data, "f").indexOf(data);
235
+ if (index === -1)
236
+ return false;
237
+ __classPrivateFieldGet(this, _TreeNode_data, "f").splice(index, 1);
238
+ this.updateVersion();
239
+ return true;
240
+ }
241
+ removeTransformation(transformation) {
242
+ const index = __classPrivateFieldGet(this, _TreeNode_transformations, "f").indexOf(transformation);
243
+ if (index === -1)
244
+ return false;
245
+ __classPrivateFieldGet(this, _TreeNode_transformations, "f").splice(index, 1);
246
+ this.updateVersion();
247
+ return true;
248
+ }
249
+ traverse(callback) {
250
+ callback(this);
251
+ for (let i = 0; i < this.children.length; i++)
252
+ this.children[i].traverse(callback);
253
+ }
253
254
  updateVersion() {
254
255
  let node = this;
255
- while (node.parent !== null) {
256
+ while (node.parent) {
256
257
  node = node.parent;
257
- node.updateVersionAtomic();
258
+ node.version = __classPrivateFieldGet(this, _TreeNode_uuidGenerator, "f").create();
258
259
  }
259
260
  for (let i = 0; i < __classPrivateFieldGet(this, _TreeNode_children, "f").length; i++)
260
261
  __classPrivateFieldGet(this, _TreeNode_children, "f")[i].updateVersion();
261
262
  __classPrivateFieldSet(this, _TreeNode_version, __classPrivateFieldGet(this, _TreeNode_uuidGenerator, "f").create(), "f");
262
263
  }
263
- /**
264
- * Only updates the version of this node.
265
- */
266
- updateVersionAtomic() {
267
- __classPrivateFieldSet(this, _TreeNode_version, __classPrivateFieldGet(this, _TreeNode_uuidGenerator, "f").create(), "f");
268
- }
269
264
  }
270
265
  exports.TreeNode = TreeNode;
271
- _TreeNode_children = new WeakMap(), _TreeNode_data = new WeakMap(), _TreeNode_eventEngine = new WeakMap(), _TreeNode_name = new WeakMap(), _TreeNode_uuidGenerator = new WeakMap(), _TreeNode_boundingBox = new WeakMap(), _TreeNode_id = new WeakMap(), _TreeNode_parent = new WeakMap(), _TreeNode_transformations = new WeakMap(), _TreeNode_transformedNodes = new WeakMap(), _TreeNode_excludeViewers = new WeakMap(), _TreeNode_includeViewers = new WeakMap(), _TreeNode_version = new WeakMap(), _TreeNode_visible = new WeakMap(), _TreeNode_bone = new WeakMap();
266
+ _TreeNode_uuidGenerator = new WeakMap(), _TreeNode_children = new WeakMap(), _TreeNode_data = new WeakMap(), _TreeNode_transformations = new WeakMap(), _TreeNode_id = new WeakMap(), _TreeNode_name = new WeakMap(), _TreeNode_version = new WeakMap(), _TreeNode_parent = new WeakMap(), _TreeNode_boundingBox = new WeakMap(), _TreeNode_transformedNodes = new WeakMap(), _TreeNode_excludeViewports = new WeakMap(), _TreeNode_restrictViewports = new WeakMap(), _TreeNode_visible = new WeakMap();
272
267
  //# sourceMappingURL=TreeNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeNode.js","sourceRoot":"","sources":["../../src/implementation/TreeNode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAAgC;AAChC,uCAAoC;AACpC,+EAAkE;AAClE,uEAA0D;AAM1D,MAAa,QAAQ;IAwBnB,6BAA6B;IAE7B,2BAA2B;IAE3B;;;;;;;OAOG;IACH,YACE,OAAe,MAAM,EACrB,MAAkB,EAClB,OAAwB,EAAE,EAC1B,kBAAqC,EAAE;;QAvCzC,0BAA0B;QAE1B,kCAAwD,oBAAS,CAAC,OAAO,CAAC,sCAAa,CAAC,EAAC;QAEzF,6BAAkC,EAAE,EAAC;QACrC,yBAAkC,EAAE,EAAC;QACrC,oCAAsC,EAAE,EAAC;QAEzC,+BAAqB;QACrB,yBAAyB,EAAE,EAAC;QAC5B,oCAAiB;QACjB,mCAAoB;QAEpB,gCAA8B,IAAI,wBAAG,EAAE,EAAC;QACxC,qCAEI,EAAE,EAAC;QAEP,qCAA8B,EAAE,EAAC;QACjC,sCAA+B,EAAE,EAAC;QAElC,4BAAoB,IAA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AI,CAAC,CAAC;QAEf,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAEM,aAAa;QAClB,IAAI,IAAI,GAAc,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,MAAM,EAAE;YAClB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;YACb,IAAI,CAAC,OAAQ,GAAG,uBAAA,IAAI,+BAAe,CAAC,MAAM,EAAE,CAAC;SACpD;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAA,IAAI,0BAAU,CAAC,MAAM,EAAE,CAAC,EAAE;YAC5C,uBAAA,IAAI,0BAAU,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAEpC,uBAAA,IAAI,qBAAY,uBAAA,IAAI,+BAAe,CAAC,MAAM,EAAE,MAAA,CAAC;IAC/C,CAAC;CAGF;AAvTD,4BAuTC"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
- import { Tree } from './Tree';
2
- import { ITransformation, TreeNode } from './TreeNode';
3
1
  import { ITreeNodeData } from './interfaces/ITreeNodeData';
4
- import { AbstractTreeNodeData } from './AbstractTreeNodeData';
2
+ import { AbstractTreeNodeData } from './implementation/AbstractTreeNodeData';
5
3
  import { ISDObject } from './interfaces/ISDObject';
6
- export { Tree };
7
- export { TreeNode, ITransformation };
4
+ import { ITree } from './interfaces/ITree';
5
+ import { Tree } from './implementation/Tree';
6
+ import { ITransformation, ITreeNode } from './interfaces/ITreeNode';
7
+ import { TreeNode } from './implementation/TreeNode';
8
+ export { ITree, Tree };
9
+ export { ITreeNode, TreeNode, ITransformation };
8
10
  export { ITreeNodeData, ISDObject, AbstractTreeNodeData };
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,EACH,IAAI,EACP,CAAA;AAED,OAAO,EACH,QAAQ,EAAE,eAAe,EAC5B,CAAA;AAED,OAAO,EACH,aAAa,EACb,SAAS,EACT,oBAAoB,EACvB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEpD,OAAO,EACH,KAAK,EAAE,IAAI,EACd,CAAA;AAED,OAAO,EACH,SAAS,EAAE,QAAQ,EAAE,eAAe,EACvC,CAAA;AAED,OAAO,EACH,aAAa,EACb,SAAS,EACT,oBAAoB,EACvB,CAAA"}
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbstractTreeNodeData = exports.TreeNode = exports.Tree = void 0;
4
- const Tree_1 = require("./Tree");
4
+ const AbstractTreeNodeData_1 = require("./implementation/AbstractTreeNodeData");
5
+ Object.defineProperty(exports, "AbstractTreeNodeData", { enumerable: true, get: function () { return AbstractTreeNodeData_1.AbstractTreeNodeData; } });
6
+ const Tree_1 = require("./implementation/Tree");
5
7
  Object.defineProperty(exports, "Tree", { enumerable: true, get: function () { return Tree_1.Tree; } });
6
- const TreeNode_1 = require("./TreeNode");
8
+ const TreeNode_1 = require("./implementation/TreeNode");
7
9
  Object.defineProperty(exports, "TreeNode", { enumerable: true, get: function () { return TreeNode_1.TreeNode; } });
8
- const AbstractTreeNodeData_1 = require("./AbstractTreeNodeData");
9
- Object.defineProperty(exports, "AbstractTreeNodeData", { enumerable: true, get: function () { return AbstractTreeNodeData_1.AbstractTreeNodeData; } });
10
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAOzB,qFAPK,WAAI,OAOL;AANR,yCAAsD;AAUlD,yFAVsB,mBAAQ,OAUtB;AARZ,iEAA6D;AAczD,qGAdK,2CAAoB,OAcL"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,gFAA4E;AAkBxE,qGAlBK,2CAAoB,OAkBL;AAfxB,gDAA4C;AAKjC,qFALF,WAAI,OAKE;AAHf,wDAAoD;AAOrC,yFAPN,mBAAQ,OAOM"}