bruce-models 0.7.4 → 0.7.5

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 (82) hide show
  1. package/dist/bruce-models.es5.js +11 -2
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +11 -2
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account.js +244 -244
  6. package/dist/lib/ann-document/ann-document.js +116 -116
  7. package/dist/lib/api/abstract-api.js +267 -267
  8. package/dist/lib/api/api.js +85 -85
  9. package/dist/lib/api/bruce-api.js +202 -202
  10. package/dist/lib/api/cam-api.js +132 -132
  11. package/dist/lib/api/global-api.js +131 -131
  12. package/dist/lib/api/idm-api.js +132 -132
  13. package/dist/lib/bruce-models.js +83 -83
  14. package/dist/lib/calculator/calculator.js +158 -158
  15. package/dist/lib/client-file/client-file.js +188 -188
  16. package/dist/lib/common/bounds.js +2 -2
  17. package/dist/lib/common/bruce-event.js +48 -48
  18. package/dist/lib/common/bruce-variable.js +54 -54
  19. package/dist/lib/common/cache.js +86 -86
  20. package/dist/lib/common/camera.js +11 -11
  21. package/dist/lib/common/cartes.js +55 -55
  22. package/dist/lib/common/carto.js +60 -60
  23. package/dist/lib/common/color.js +86 -86
  24. package/dist/lib/common/delay-queue.js +60 -60
  25. package/dist/lib/common/dictionary.js +2 -2
  26. package/dist/lib/common/geometry.js +120 -120
  27. package/dist/lib/common/transform.js +2 -2
  28. package/dist/lib/common/utc.js +39 -39
  29. package/dist/lib/custom-form/custom-form.js +136 -136
  30. package/dist/lib/data-lab/data-lab.js +90 -90
  31. package/dist/lib/entity/entity-attachment-type.js +132 -132
  32. package/dist/lib/entity/entity-attachment.js +208 -208
  33. package/dist/lib/entity/entity-comment.js +132 -132
  34. package/dist/lib/entity/entity-coords.js +181 -181
  35. package/dist/lib/entity/entity-link.js +132 -132
  36. package/dist/lib/entity/entity-lod.js +189 -189
  37. package/dist/lib/entity/entity-relation-type.js +150 -150
  38. package/dist/lib/entity/entity-relation.js +189 -189
  39. package/dist/lib/entity/entity-source.js +176 -176
  40. package/dist/lib/entity/entity-tag.js +229 -229
  41. package/dist/lib/entity/entity-type.js +163 -163
  42. package/dist/lib/entity/entity.js +358 -349
  43. package/dist/lib/entity/entity.js.map +1 -1
  44. package/dist/lib/entity/getters/batched-data-getter.js +91 -91
  45. package/dist/lib/entity/getters/entity-filter-getter.js +344 -344
  46. package/dist/lib/entity/getters/entity-globe.js +135 -135
  47. package/dist/lib/entity/getters/view-monitor.js +2 -2
  48. package/dist/lib/import/import-cad.js +82 -82
  49. package/dist/lib/import/import-csv.js +51 -51
  50. package/dist/lib/import/import-json.js +51 -51
  51. package/dist/lib/import/import-kml.js +51 -51
  52. package/dist/lib/import/imported-file.js +121 -121
  53. package/dist/lib/markup/markup.js +40 -40
  54. package/dist/lib/program-key/program-key.js +152 -152
  55. package/dist/lib/project/menu-item.js +115 -115
  56. package/dist/lib/project/project-view-bookmark.js +172 -172
  57. package/dist/lib/project/project-view-tile-source.js +115 -115
  58. package/dist/lib/project/project-view.js +166 -166
  59. package/dist/lib/project/zoom-control.js +17 -17
  60. package/dist/lib/server/pending-action.js +106 -106
  61. package/dist/lib/server/task.js +113 -113
  62. package/dist/lib/style/style.js +152 -152
  63. package/dist/lib/tileset/tileset-cad.js +2 -2
  64. package/dist/lib/tileset/tileset-entities-map-tiles.js +18 -18
  65. package/dist/lib/tileset/tileset-entities.js +2 -2
  66. package/dist/lib/tileset/tileset-ext-map-tiles.js +17 -17
  67. package/dist/lib/tileset/tileset-ext-terrain-tiles.js +2 -2
  68. package/dist/lib/tileset/tileset-map-tiles.js +2 -2
  69. package/dist/lib/tileset/tileset-pointcloud.js +2 -2
  70. package/dist/lib/tileset/tileset-terrain-tiles.js +2 -2
  71. package/dist/lib/tileset/tileset.js +403 -403
  72. package/dist/lib/user/permission.js +20 -20
  73. package/dist/lib/user/session.js +160 -160
  74. package/dist/lib/user/user-group.js +139 -139
  75. package/dist/lib/user/user.js +451 -451
  76. package/dist/lib/util/encrypt-utils.js +20 -20
  77. package/dist/lib/util/math-utils.js +41 -41
  78. package/dist/lib/util/object-utils.js +17 -17
  79. package/dist/lib/util/path-utils.js +61 -61
  80. package/dist/lib/util/url-utils.js +107 -107
  81. package/dist/types/entity/entity.d.ts +10 -1
  82. package/package.json +1 -1
@@ -1,61 +1,61 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DelayQueue = void 0;
4
- /**
5
- * Controls the flow of method calls.
6
- * If you have a method that may be called often, but you don't want it to run often, use this.
7
- */
8
- var DelayQueue = /** @class */ (function () {
9
- function DelayQueue(callback, delay) {
10
- if (delay === void 0) { delay = 200; }
11
- // Millisecond delay.
12
- this.delay = 200;
13
- // Date-time stamp for the last callback call.
14
- this.lastCallTime = null;
15
- this.callback = callback;
16
- this.delay = delay;
17
- }
18
- DelayQueue.prototype.Call = function (force) {
19
- var _this = this;
20
- if (force === void 0) { force = false; }
21
- if (this.lastCallTime == null) {
22
- force = true;
23
- }
24
- if (force) {
25
- var endDate = new Date().getTime();
26
- this.doCall(endDate);
27
- }
28
- else {
29
- var endDate = new Date().getTime();
30
- var seconds = (endDate - this.lastCallTime) / 1000;
31
- var delay = this.delay / 1000;
32
- if (seconds > delay) {
33
- this.doCall(endDate);
34
- }
35
- else if (this.delayTimeout == null) {
36
- var diff = (delay - seconds) * 1000;
37
- this.delayTimeout = setTimeout(function () {
38
- _this.delayTimeout = null;
39
- _this.Call();
40
- }, diff + 0.02);
41
- }
42
- }
43
- };
44
- DelayQueue.prototype.doCall = function (endDate) {
45
- if (this.delayTimeout != null) {
46
- clearTimeout(this.delayTimeout);
47
- this.delayTimeout = null;
48
- }
49
- this.lastCallTime = endDate;
50
- this.callback();
51
- };
52
- DelayQueue.prototype.Dispose = function () {
53
- if (this.delayTimeout != null) {
54
- clearTimeout(this.delayTimeout);
55
- this.delayTimeout = null;
56
- }
57
- };
58
- return DelayQueue;
59
- }());
60
- exports.DelayQueue = DelayQueue;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelayQueue = void 0;
4
+ /**
5
+ * Controls the flow of method calls.
6
+ * If you have a method that may be called often, but you don't want it to run often, use this.
7
+ */
8
+ var DelayQueue = /** @class */ (function () {
9
+ function DelayQueue(callback, delay) {
10
+ if (delay === void 0) { delay = 200; }
11
+ // Millisecond delay.
12
+ this.delay = 200;
13
+ // Date-time stamp for the last callback call.
14
+ this.lastCallTime = null;
15
+ this.callback = callback;
16
+ this.delay = delay;
17
+ }
18
+ DelayQueue.prototype.Call = function (force) {
19
+ var _this = this;
20
+ if (force === void 0) { force = false; }
21
+ if (this.lastCallTime == null) {
22
+ force = true;
23
+ }
24
+ if (force) {
25
+ var endDate = new Date().getTime();
26
+ this.doCall(endDate);
27
+ }
28
+ else {
29
+ var endDate = new Date().getTime();
30
+ var seconds = (endDate - this.lastCallTime) / 1000;
31
+ var delay = this.delay / 1000;
32
+ if (seconds > delay) {
33
+ this.doCall(endDate);
34
+ }
35
+ else if (this.delayTimeout == null) {
36
+ var diff = (delay - seconds) * 1000;
37
+ this.delayTimeout = setTimeout(function () {
38
+ _this.delayTimeout = null;
39
+ _this.Call();
40
+ }, diff + 0.02);
41
+ }
42
+ }
43
+ };
44
+ DelayQueue.prototype.doCall = function (endDate) {
45
+ if (this.delayTimeout != null) {
46
+ clearTimeout(this.delayTimeout);
47
+ this.delayTimeout = null;
48
+ }
49
+ this.lastCallTime = endDate;
50
+ this.callback();
51
+ };
52
+ DelayQueue.prototype.Dispose = function () {
53
+ if (this.delayTimeout != null) {
54
+ clearTimeout(this.delayTimeout);
55
+ this.delayTimeout = null;
56
+ }
57
+ };
58
+ return DelayQueue;
59
+ }());
60
+ exports.DelayQueue = DelayQueue;
61
61
  //# sourceMappingURL=delay-queue.js.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=dictionary.js.map
@@ -1,121 +1,121 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Geometry = void 0;
4
- /**
5
- * Describes vector geometry that Bruce uses.
6
- */
7
- var Geometry;
8
- (function (Geometry) {
9
- var EPolygonRingType;
10
- (function (EPolygonRingType) {
11
- EPolygonRingType["Boundaries"] = "out";
12
- EPolygonRingType["Hole"] = "in";
13
- })(EPolygonRingType = Geometry.EPolygonRingType || (Geometry.EPolygonRingType = {}));
14
- /**
15
- * Turns an array of points into string vector geometry that Bruce can use.
16
- * This is used for saving polyline and polygon data.
17
- * @param points
18
- * @returns
19
- */
20
- function LineStrFromPoints(points) {
21
- if (!points.length) {
22
- throw ("points is empty.");
23
- }
24
- var carto = points[0];
25
- var lineString = carto.longitude + "," + carto.latitude + (carto.altitude != null ? "," + carto.altitude : "");
26
- for (var i = 1; i < points.length; i++) {
27
- carto = points[i];
28
- lineString += " " + carto.longitude + "," + carto.latitude + (carto.altitude != null ? "," + carto.altitude : "");
29
- }
30
- return lineString;
31
- }
32
- Geometry.LineStrFromPoints = LineStrFromPoints;
33
- /**
34
- * Removes same points that occur in a row.
35
- * This will not modify the original array.
36
- * @param positions
37
- * @returns
38
- */
39
- function RemoveRepeatPoints(positions) {
40
- var filteredList = [];
41
- for (var i = 0; i < positions.length; i++) {
42
- var pos = positions[i];
43
- var lastPos = filteredList.length > 0 ? filteredList[filteredList.length - 1] : null;
44
- if (!lastPos || (pos.latitude != lastPos.latitude || pos.longitude != lastPos.longitude || pos.altitude != lastPos.altitude)) {
45
- filteredList.push(pos);
46
- }
47
- }
48
- return filteredList;
49
- }
50
- Geometry.RemoveRepeatPoints = RemoveRepeatPoints;
51
- function ParsePoints(data) {
52
- data = data.replace(/[^\d.,-\s]/g, "");
53
- var splitterCoordinates = " ";
54
- var splitterAxis = ",";
55
- var commaIndex = data.indexOf(",");
56
- var spaceIndex = data.indexOf(" ");
57
- if ((spaceIndex > -1 && commaIndex > spaceIndex) || commaIndex <= -1) {
58
- splitterCoordinates = ",";
59
- splitterAxis = " ";
60
- }
61
- var points = data.trim().split(splitterCoordinates);
62
- points = points.filter(function (a) { return a != ""; });
63
- var result = [];
64
- for (var i = 0; i < points.length; i++) {
65
- var pointData = points[i];
66
- var coords = pointData.trim().split(splitterAxis);
67
- if (coords.length == 2 || coords.length == 3) {
68
- var longitude = +coords[0];
69
- var latitude = +coords[1];
70
- var altitude = coords.length >= 3 ? +coords[2] : 0;
71
- if (longitude != null && latitude != null) {
72
- result.push({
73
- altitude: altitude,
74
- latitude: latitude,
75
- longitude: longitude
76
- });
77
- }
78
- else {
79
- console.warn("Invalid point data detected.", pointData);
80
- }
81
- }
82
- }
83
- return result;
84
- }
85
- Geometry.ParsePoints = ParsePoints;
86
- /**
87
- * Parses both string and object Bruce geometry.
88
- * String geometry is legacy Bruce data.
89
- * @param geometry
90
- * @returns
91
- */
92
- function ParseGeometry(geometry) {
93
- if (typeof geometry == "string") {
94
- var positions = [];
95
- var geometryParsed = (geometry || "").split(";");
96
- for (var i = 0; i < geometryParsed.length; i++) {
97
- var data = geometryParsed[i];
98
- var points = ParsePoints(data);
99
- if (points && points.length > 0) {
100
- positions = positions.concat(points);
101
- }
102
- }
103
- positions = RemoveRepeatPoints(positions);
104
- var newGeometry = {};
105
- if (positions.length > 0) {
106
- var topPoint = positions[0];
107
- newGeometry.Point = topPoint.latitude + "," + topPoint.longitude + (topPoint.altitude != null ? "," + topPoint.altitude : "");
108
- if (positions.length > 1) {
109
- newGeometry.Polygon = [{ Facing: EPolygonRingType.Boundaries, LinearRing: LineStrFromPoints(positions) }];
110
- }
111
- if (positions.length > 2) {
112
- newGeometry.LineString = LineStrFromPoints(positions);
113
- }
114
- }
115
- return newGeometry;
116
- }
117
- return geometry;
118
- }
119
- Geometry.ParseGeometry = ParseGeometry;
120
- })(Geometry = exports.Geometry || (exports.Geometry = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Geometry = void 0;
4
+ /**
5
+ * Describes vector geometry that Bruce uses.
6
+ */
7
+ var Geometry;
8
+ (function (Geometry) {
9
+ var EPolygonRingType;
10
+ (function (EPolygonRingType) {
11
+ EPolygonRingType["Boundaries"] = "out";
12
+ EPolygonRingType["Hole"] = "in";
13
+ })(EPolygonRingType = Geometry.EPolygonRingType || (Geometry.EPolygonRingType = {}));
14
+ /**
15
+ * Turns an array of points into string vector geometry that Bruce can use.
16
+ * This is used for saving polyline and polygon data.
17
+ * @param points
18
+ * @returns
19
+ */
20
+ function LineStrFromPoints(points) {
21
+ if (!points.length) {
22
+ throw ("points is empty.");
23
+ }
24
+ var carto = points[0];
25
+ var lineString = carto.longitude + "," + carto.latitude + (carto.altitude != null ? "," + carto.altitude : "");
26
+ for (var i = 1; i < points.length; i++) {
27
+ carto = points[i];
28
+ lineString += " " + carto.longitude + "," + carto.latitude + (carto.altitude != null ? "," + carto.altitude : "");
29
+ }
30
+ return lineString;
31
+ }
32
+ Geometry.LineStrFromPoints = LineStrFromPoints;
33
+ /**
34
+ * Removes same points that occur in a row.
35
+ * This will not modify the original array.
36
+ * @param positions
37
+ * @returns
38
+ */
39
+ function RemoveRepeatPoints(positions) {
40
+ var filteredList = [];
41
+ for (var i = 0; i < positions.length; i++) {
42
+ var pos = positions[i];
43
+ var lastPos = filteredList.length > 0 ? filteredList[filteredList.length - 1] : null;
44
+ if (!lastPos || (pos.latitude != lastPos.latitude || pos.longitude != lastPos.longitude || pos.altitude != lastPos.altitude)) {
45
+ filteredList.push(pos);
46
+ }
47
+ }
48
+ return filteredList;
49
+ }
50
+ Geometry.RemoveRepeatPoints = RemoveRepeatPoints;
51
+ function ParsePoints(data) {
52
+ data = data.replace(/[^\d.,-\s]/g, "");
53
+ var splitterCoordinates = " ";
54
+ var splitterAxis = ",";
55
+ var commaIndex = data.indexOf(",");
56
+ var spaceIndex = data.indexOf(" ");
57
+ if ((spaceIndex > -1 && commaIndex > spaceIndex) || commaIndex <= -1) {
58
+ splitterCoordinates = ",";
59
+ splitterAxis = " ";
60
+ }
61
+ var points = data.trim().split(splitterCoordinates);
62
+ points = points.filter(function (a) { return a != ""; });
63
+ var result = [];
64
+ for (var i = 0; i < points.length; i++) {
65
+ var pointData = points[i];
66
+ var coords = pointData.trim().split(splitterAxis);
67
+ if (coords.length == 2 || coords.length == 3) {
68
+ var longitude = +coords[0];
69
+ var latitude = +coords[1];
70
+ var altitude = coords.length >= 3 ? +coords[2] : 0;
71
+ if (longitude != null && latitude != null) {
72
+ result.push({
73
+ altitude: altitude,
74
+ latitude: latitude,
75
+ longitude: longitude
76
+ });
77
+ }
78
+ else {
79
+ console.warn("Invalid point data detected.", pointData);
80
+ }
81
+ }
82
+ }
83
+ return result;
84
+ }
85
+ Geometry.ParsePoints = ParsePoints;
86
+ /**
87
+ * Parses both string and object Bruce geometry.
88
+ * String geometry is legacy Bruce data.
89
+ * @param geometry
90
+ * @returns
91
+ */
92
+ function ParseGeometry(geometry) {
93
+ if (typeof geometry == "string") {
94
+ var positions = [];
95
+ var geometryParsed = (geometry || "").split(";");
96
+ for (var i = 0; i < geometryParsed.length; i++) {
97
+ var data = geometryParsed[i];
98
+ var points = ParsePoints(data);
99
+ if (points && points.length > 0) {
100
+ positions = positions.concat(points);
101
+ }
102
+ }
103
+ positions = RemoveRepeatPoints(positions);
104
+ var newGeometry = {};
105
+ if (positions.length > 0) {
106
+ var topPoint = positions[0];
107
+ newGeometry.Point = topPoint.latitude + "," + topPoint.longitude + (topPoint.altitude != null ? "," + topPoint.altitude : "");
108
+ if (positions.length > 1) {
109
+ newGeometry.Polygon = [{ Facing: EPolygonRingType.Boundaries, LinearRing: LineStrFromPoints(positions) }];
110
+ }
111
+ if (positions.length > 2) {
112
+ newGeometry.LineString = LineStrFromPoints(positions);
113
+ }
114
+ }
115
+ return newGeometry;
116
+ }
117
+ return geometry;
118
+ }
119
+ Geometry.ParseGeometry = ParseGeometry;
120
+ })(Geometry = exports.Geometry || (exports.Geometry = {}));
121
121
  //# sourceMappingURL=geometry.js.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=transform.js.map
@@ -1,40 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UTC = void 0;
4
- /**
5
- * Describes a Bruce stored date.
6
- */
7
- var UTC;
8
- (function (UTC) {
9
- var EMonth;
10
- (function (EMonth) {
11
- EMonth[EMonth["January"] = 1] = "January";
12
- EMonth[EMonth["February"] = 2] = "February";
13
- EMonth[EMonth["March"] = 3] = "March";
14
- EMonth[EMonth["April"] = 4] = "April";
15
- EMonth[EMonth["May"] = 5] = "May";
16
- EMonth[EMonth["June"] = 6] = "June";
17
- EMonth[EMonth["July"] = 7] = "July";
18
- EMonth[EMonth["August"] = 8] = "August";
19
- EMonth[EMonth["September"] = 9] = "September";
20
- EMonth[EMonth["October"] = 10] = "October";
21
- EMonth[EMonth["November"] = 11] = "November";
22
- EMonth[EMonth["December"] = 12] = "December";
23
- })(EMonth = UTC.EMonth || (UTC.EMonth = {}));
24
- function ToDate(utc) {
25
- return new Date(utc.y, utc.m - 1, utc.d, utc.hh, utc.mm, utc.ss, 0);
26
- }
27
- UTC.ToDate = ToDate;
28
- function FromDate(date) {
29
- return {
30
- y: date.getUTCFullYear(),
31
- m: date.getUTCMonth() + 1,
32
- d: date.getUTCDate(),
33
- hh: date.getUTCHours(),
34
- mm: date.getUTCMinutes(),
35
- ss: date.getUTCSeconds()
36
- };
37
- }
38
- UTC.FromDate = FromDate;
39
- })(UTC = exports.UTC || (exports.UTC = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UTC = void 0;
4
+ /**
5
+ * Describes a Bruce stored date.
6
+ */
7
+ var UTC;
8
+ (function (UTC) {
9
+ var EMonth;
10
+ (function (EMonth) {
11
+ EMonth[EMonth["January"] = 1] = "January";
12
+ EMonth[EMonth["February"] = 2] = "February";
13
+ EMonth[EMonth["March"] = 3] = "March";
14
+ EMonth[EMonth["April"] = 4] = "April";
15
+ EMonth[EMonth["May"] = 5] = "May";
16
+ EMonth[EMonth["June"] = 6] = "June";
17
+ EMonth[EMonth["July"] = 7] = "July";
18
+ EMonth[EMonth["August"] = 8] = "August";
19
+ EMonth[EMonth["September"] = 9] = "September";
20
+ EMonth[EMonth["October"] = 10] = "October";
21
+ EMonth[EMonth["November"] = 11] = "November";
22
+ EMonth[EMonth["December"] = 12] = "December";
23
+ })(EMonth = UTC.EMonth || (UTC.EMonth = {}));
24
+ function ToDate(utc) {
25
+ return new Date(utc.y, utc.m - 1, utc.d, utc.hh, utc.mm, utc.ss, 0);
26
+ }
27
+ UTC.ToDate = ToDate;
28
+ function FromDate(date) {
29
+ return {
30
+ y: date.getUTCFullYear(),
31
+ m: date.getUTCMonth() + 1,
32
+ d: date.getUTCDate(),
33
+ hh: date.getUTCHours(),
34
+ mm: date.getUTCMinutes(),
35
+ ss: date.getUTCSeconds()
36
+ };
37
+ }
38
+ UTC.FromDate = FromDate;
39
+ })(UTC = exports.UTC || (exports.UTC = {}));
40
40
  //# sourceMappingURL=utc.js.map