bruce-models 1.9.8 → 1.9.9
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.
- package/dist/bruce-models.es5.js +20 -14
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +20 -14
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-settings.js +2 -2
- package/dist/lib/account/account.js +185 -185
- package/dist/lib/ann-document/ann-document.js +86 -86
- package/dist/lib/api/abstract-api.js +246 -246
- package/dist/lib/api/api-getters.js +134 -134
- package/dist/lib/api/api.js +93 -93
- package/dist/lib/api/bruce-api.js +216 -216
- package/dist/lib/api/cam-api.js +85 -82
- package/dist/lib/api/cam-api.js.map +1 -1
- package/dist/lib/api/global-api.js +81 -81
- package/dist/lib/api/idm-api.js +85 -82
- package/dist/lib/api/idm-api.js.map +1 -1
- package/dist/lib/bruce-models.js +86 -86
- package/dist/lib/calculator/calculator.js +341 -341
- package/dist/lib/client-file/client-file.js +245 -245
- package/dist/lib/common/bounds.js +61 -61
- package/dist/lib/common/bruce-event.js +46 -46
- package/dist/lib/common/bruce-variable.js +60 -60
- package/dist/lib/common/cache.js +165 -165
- package/dist/lib/common/camera.js +11 -11
- package/dist/lib/common/cartes.js +123 -123
- package/dist/lib/common/carto.js +60 -60
- package/dist/lib/common/color.js +86 -86
- package/dist/lib/common/delay-queue.js +56 -56
- package/dist/lib/common/dictionary.js +2 -2
- package/dist/lib/common/geometry.js +120 -120
- package/dist/lib/common/transform.js +2 -2
- package/dist/lib/common/utc.js +39 -39
- package/dist/lib/custom-form/custom-form-content.js +26 -26
- package/dist/lib/custom-form/custom-form.js +106 -106
- package/dist/lib/data-lab/data-lab.js +49 -49
- package/dist/lib/entity/entity-attachment-type.js +83 -83
- package/dist/lib/entity/entity-attachment.js +122 -122
- package/dist/lib/entity/entity-attribute.js +29 -29
- package/dist/lib/entity/entity-comment.js +82 -82
- package/dist/lib/entity/entity-coords.js +149 -149
- package/dist/lib/entity/entity-link.js +82 -82
- package/dist/lib/entity/entity-lod-category.js +100 -100
- package/dist/lib/entity/entity-lod.js +185 -185
- package/dist/lib/entity/entity-relation-type.js +109 -109
- package/dist/lib/entity/entity-relation.js +132 -132
- package/dist/lib/entity/entity-source.js +136 -136
- package/dist/lib/entity/entity-tag.js +149 -149
- package/dist/lib/entity/entity-type-visual-settings.js +13 -13
- package/dist/lib/entity/entity-type.js +113 -113
- package/dist/lib/entity/entity.js +319 -319
- package/dist/lib/entity/getters/batched-data-getter.js +84 -84
- package/dist/lib/entity/getters/entity-filter-getter.js +303 -303
- package/dist/lib/entity/getters/entity-globe.js +211 -211
- package/dist/lib/entity/getters/view-monitor.js +2 -2
- package/dist/lib/import/import-cad.js +53 -53
- package/dist/lib/import/import-csv.js +23 -23
- package/dist/lib/import/import-json.js +23 -23
- package/dist/lib/import/import-kml.js +23 -23
- package/dist/lib/import/imported-file.js +91 -91
- package/dist/lib/internal/uploader.js +76 -76
- package/dist/lib/markup/markup.js +185 -185
- package/dist/lib/plugin/plugin.js +83 -83
- package/dist/lib/program-key/program-key.js +111 -111
- package/dist/lib/project/menu-item.js +121 -121
- package/dist/lib/project/project-view-bookmark.js +147 -147
- package/dist/lib/project/project-view-legacy-tile.js +77 -77
- package/dist/lib/project/project-view-tile.js +125 -125
- package/dist/lib/project/project-view.js +133 -133
- package/dist/lib/project/zoom-control.js +17 -17
- package/dist/lib/server/message-broker.js +142 -142
- package/dist/lib/server/pending-action.js +71 -71
- package/dist/lib/server/task.js +63 -63
- package/dist/lib/style/style.js +117 -117
- package/dist/lib/tileset/tileset.js +415 -415
- package/dist/lib/user/permission.js +20 -20
- package/dist/lib/user/session.js +137 -137
- package/dist/lib/user/user-group.js +94 -94
- package/dist/lib/user/user.js +446 -446
- package/dist/lib/util/encrypt-utils.js +19 -19
- package/dist/lib/util/math-utils.js +40 -40
- package/dist/lib/util/object-utils.js +17 -17
- package/dist/lib/util/path-utils.js +61 -61
- package/dist/lib/util/url-utils.js +94 -94
- package/package.json +3 -2
|
@@ -1,212 +1,212 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityGlobe = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This is a helper for making entity requests based on a grid area.
|
|
6
|
-
* It will return grid cells based on given view-area then will remember when stuff-
|
|
7
|
-
* was fully-fetched for those cells to avoid making duplicate requests.
|
|
8
|
-
*/
|
|
9
|
-
var EntityGlobe;
|
|
10
|
-
(function (EntityGlobe) {
|
|
11
|
-
class Cell {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.Fetched = false;
|
|
14
|
-
this.IsFetched = null;
|
|
15
|
-
this.FetchPageIndex = 0;
|
|
16
|
-
this.Boundaries = null;
|
|
17
|
-
}
|
|
18
|
-
GetBounds() {
|
|
19
|
-
// Entity data works in -180 to 180 range.
|
|
20
|
-
function prepareRangeForBounds(range) {
|
|
21
|
-
if (range > 180) {
|
|
22
|
-
return range - 360;
|
|
23
|
-
}
|
|
24
|
-
return range;
|
|
25
|
-
}
|
|
26
|
-
// Add minor decimal as API crashes when giving it whole numbers.
|
|
27
|
-
const maxLon = prepareRangeForBounds(this.Boundaries.maxLongitude) + 0.00001;
|
|
28
|
-
const minLon = prepareRangeForBounds(this.Boundaries.minLongitude) - 0.00001;
|
|
29
|
-
const maxLat = prepareRangeForBounds(this.Boundaries.maxLatitude) + 0.00001;
|
|
30
|
-
const minLat = prepareRangeForBounds(this.Boundaries.minLatitude) - 0.00001;
|
|
31
|
-
return {
|
|
32
|
-
east: maxLon,
|
|
33
|
-
north: maxLat,
|
|
34
|
-
south: minLat,
|
|
35
|
-
west: minLon
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
EntityGlobe.Cell = Cell;
|
|
40
|
-
class Grid {
|
|
41
|
-
constructor() {
|
|
42
|
-
this.cells = {};
|
|
43
|
-
this.patches = [];
|
|
44
|
-
}
|
|
45
|
-
GetCellsForView(viewRect) {
|
|
46
|
-
const MAX_CELLS = 150;
|
|
47
|
-
const { south: minLat, west: minLon, north: maxLat, east: maxLon } = viewRect;
|
|
48
|
-
const cellDegreeSize = getCellSizeFromHeight(viewRect.alt);
|
|
49
|
-
const [curMinLon, curMinLat] = [minLon, minLat].map((v) => floorValueToCellSize(cellDegreeSize, v));
|
|
50
|
-
const [width, height] = [maxLon - curMinLon, maxLat - curMinLat].map((v) => v / cellDegreeSize);
|
|
51
|
-
const ids = [];
|
|
52
|
-
const cells = [];
|
|
53
|
-
let max = [curMinLon, curMinLat];
|
|
54
|
-
const intersections = this.intersections(viewRect);
|
|
55
|
-
const addCell = (x, y) => {
|
|
56
|
-
const lon1 = x * cellDegreeSize + curMinLon;
|
|
57
|
-
const lat1 = y * cellDegreeSize + curMinLat;
|
|
58
|
-
const lon2 = lon1 + cellDegreeSize;
|
|
59
|
-
const lat2 = lat1 + cellDegreeSize;
|
|
60
|
-
const [id, cell] = getOrCreateCell(this.cells, cellDegreeSize, lon1, lon2, lat1, lat2);
|
|
61
|
-
/*
|
|
62
|
-
{
|
|
63
|
-
const cell_bounds = { south: lat1, west: lon1, north: lat2, east: lon2 };
|
|
64
|
-
const subcells = [];
|
|
65
|
-
for (const id of intersections) {
|
|
66
|
-
const c = this.cells[id].GetBounds();
|
|
67
|
-
if (contains(c, cell_bounds)) {
|
|
68
|
-
cell.Fetched = true;
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (intersects(c, cell_bounds)) {
|
|
72
|
-
const cropped = crop(c, cell.GetBounds());
|
|
73
|
-
subcells.push(cropped);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
let filled = 0;
|
|
77
|
-
while (subcells.length > 0) {
|
|
78
|
-
const c = subcells.pop();
|
|
79
|
-
filled += area(c);
|
|
80
|
-
for (const s of subcells) {
|
|
81
|
-
filled -= intersection(s, c);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (filled + Number.EPSILON * 2 > area(cell.GetBounds())) {
|
|
85
|
-
cell.Fetched = true;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
let [x2, y2] = max;
|
|
90
|
-
x2 = Math.max(x2, lon2);
|
|
91
|
-
y2 = Math.max(y2, lat2);
|
|
92
|
-
max = [x2, y2];
|
|
93
|
-
}
|
|
94
|
-
*/
|
|
95
|
-
ids.push(id);
|
|
96
|
-
cells.push(cell);
|
|
97
|
-
cells[id] = cell;
|
|
98
|
-
};
|
|
99
|
-
for (let x = 0; x < width; x++) {
|
|
100
|
-
for (let y = 0; y < height; y++) {
|
|
101
|
-
addCell(x, y);
|
|
102
|
-
if (cells.length >= MAX_CELLS) {
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const [x2, y2] = max;
|
|
108
|
-
if (x2 != curMinLon && y2 != curMinLat) {
|
|
109
|
-
this.patches.push([{ west: curMinLon, east: x2, south: curMinLat, north: y2 }, ids]);
|
|
110
|
-
}
|
|
111
|
-
return cells;
|
|
112
|
-
}
|
|
113
|
-
intersections(withRect) {
|
|
114
|
-
return this.patches
|
|
115
|
-
.filter(([rect, _]) => intersects(rect, withRect))
|
|
116
|
-
.map(([_, ids]) => ids)
|
|
117
|
-
.reduce((all, ids) => {
|
|
118
|
-
all.push(...ids);
|
|
119
|
-
return all;
|
|
120
|
-
}, []);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
EntityGlobe.Grid = Grid;
|
|
124
|
-
})(EntityGlobe = exports.EntityGlobe || (exports.EntityGlobe = {}));
|
|
125
|
-
function intersects(l, r) {
|
|
126
|
-
const { west: w, south: s, north: n, east: e } = l;
|
|
127
|
-
const { west: wr, south: sr, north: nr, east: er } = r;
|
|
128
|
-
return !(e <= wr || w >= er || n <= sr || s >= nr);
|
|
129
|
-
}
|
|
130
|
-
function contains(l, r) {
|
|
131
|
-
const { west: w, south: s, north: n, east: e } = l;
|
|
132
|
-
const { west: wr, south: sr, north: nr, east: er } = r;
|
|
133
|
-
return !(er < e || wr > w || nr > n || sr < s);
|
|
134
|
-
}
|
|
135
|
-
function crop(rect, by) {
|
|
136
|
-
let { west: w, south: s, north: n, east: e } = rect;
|
|
137
|
-
const { west: wc, south: sc, north: nc, east: ec } = by;
|
|
138
|
-
w = Math.max(w, ec);
|
|
139
|
-
e = Math.min(e, wc);
|
|
140
|
-
s = Math.max(s, nc);
|
|
141
|
-
n = Math.min(n, sc);
|
|
142
|
-
return { west: w, south: s, north: n, east: e };
|
|
143
|
-
}
|
|
144
|
-
function intersection(l, r) {
|
|
145
|
-
const { west: w, south: s, north: n, east: e } = l;
|
|
146
|
-
const { west: wr, south: sr, north: nr, east: er } = r;
|
|
147
|
-
const x = Math.min(e, er) - Math.max(w, wr);
|
|
148
|
-
const y = Math.min(n, nr) - Math.max(s, sr);
|
|
149
|
-
return (x > 0 && y > 0) ? x * y : 0;
|
|
150
|
-
}
|
|
151
|
-
function area(rect) {
|
|
152
|
-
let { west: w, south: s, north: n, east: e } = rect;
|
|
153
|
-
return Math.abs((e - w) * (n - s));
|
|
154
|
-
}
|
|
155
|
-
function floorValueToCellSize(size, value) {
|
|
156
|
-
return Math.floor(value / size) * size;
|
|
157
|
-
}
|
|
158
|
-
function getCellSizeFromHeight(height) {
|
|
159
|
-
if (height < 1000) {
|
|
160
|
-
return 0.01;
|
|
161
|
-
}
|
|
162
|
-
if (height < 5000) {
|
|
163
|
-
return 0.025;
|
|
164
|
-
}
|
|
165
|
-
else if (height < 10000) {
|
|
166
|
-
return 0.05;
|
|
167
|
-
}
|
|
168
|
-
else if (height < 30000) {
|
|
169
|
-
return 0.1;
|
|
170
|
-
}
|
|
171
|
-
else if (height < 70000) {
|
|
172
|
-
return 0.2;
|
|
173
|
-
}
|
|
174
|
-
else if (height < 100000) {
|
|
175
|
-
return 0.3;
|
|
176
|
-
}
|
|
177
|
-
else if (height < 150000) {
|
|
178
|
-
return 0.4;
|
|
179
|
-
}
|
|
180
|
-
else if (height < 200000) {
|
|
181
|
-
return 0.5;
|
|
182
|
-
}
|
|
183
|
-
else if (height < 300000) {
|
|
184
|
-
return 0.6;
|
|
185
|
-
}
|
|
186
|
-
else if (height < 500000) {
|
|
187
|
-
return 1;
|
|
188
|
-
}
|
|
189
|
-
return 1.5;
|
|
190
|
-
}
|
|
191
|
-
function isCellFetched(cell) {
|
|
192
|
-
if (cell.Fetched) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
function getOrCreateCell(cells, cellSize, lon, maxLon, lat, maxLat) {
|
|
198
|
-
const id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
|
|
199
|
-
let cell = cells[id];
|
|
200
|
-
if (!cell) {
|
|
201
|
-
cell = cells[id] = new EntityGlobe.Cell();
|
|
202
|
-
cell.Boundaries = {
|
|
203
|
-
minLatitude: lat,
|
|
204
|
-
maxLatitude: maxLat,
|
|
205
|
-
minLongitude: lon,
|
|
206
|
-
maxLongitude: maxLon
|
|
207
|
-
};
|
|
208
|
-
cell.IsFetched = () => isCellFetched(cell);
|
|
209
|
-
}
|
|
210
|
-
return [id, cell];
|
|
211
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityGlobe = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This is a helper for making entity requests based on a grid area.
|
|
6
|
+
* It will return grid cells based on given view-area then will remember when stuff-
|
|
7
|
+
* was fully-fetched for those cells to avoid making duplicate requests.
|
|
8
|
+
*/
|
|
9
|
+
var EntityGlobe;
|
|
10
|
+
(function (EntityGlobe) {
|
|
11
|
+
class Cell {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.Fetched = false;
|
|
14
|
+
this.IsFetched = null;
|
|
15
|
+
this.FetchPageIndex = 0;
|
|
16
|
+
this.Boundaries = null;
|
|
17
|
+
}
|
|
18
|
+
GetBounds() {
|
|
19
|
+
// Entity data works in -180 to 180 range.
|
|
20
|
+
function prepareRangeForBounds(range) {
|
|
21
|
+
if (range > 180) {
|
|
22
|
+
return range - 360;
|
|
23
|
+
}
|
|
24
|
+
return range;
|
|
25
|
+
}
|
|
26
|
+
// Add minor decimal as API crashes when giving it whole numbers.
|
|
27
|
+
const maxLon = prepareRangeForBounds(this.Boundaries.maxLongitude) + 0.00001;
|
|
28
|
+
const minLon = prepareRangeForBounds(this.Boundaries.minLongitude) - 0.00001;
|
|
29
|
+
const maxLat = prepareRangeForBounds(this.Boundaries.maxLatitude) + 0.00001;
|
|
30
|
+
const minLat = prepareRangeForBounds(this.Boundaries.minLatitude) - 0.00001;
|
|
31
|
+
return {
|
|
32
|
+
east: maxLon,
|
|
33
|
+
north: maxLat,
|
|
34
|
+
south: minLat,
|
|
35
|
+
west: minLon
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
EntityGlobe.Cell = Cell;
|
|
40
|
+
class Grid {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.cells = {};
|
|
43
|
+
this.patches = [];
|
|
44
|
+
}
|
|
45
|
+
GetCellsForView(viewRect) {
|
|
46
|
+
const MAX_CELLS = 150;
|
|
47
|
+
const { south: minLat, west: minLon, north: maxLat, east: maxLon } = viewRect;
|
|
48
|
+
const cellDegreeSize = getCellSizeFromHeight(viewRect.alt);
|
|
49
|
+
const [curMinLon, curMinLat] = [minLon, minLat].map((v) => floorValueToCellSize(cellDegreeSize, v));
|
|
50
|
+
const [width, height] = [maxLon - curMinLon, maxLat - curMinLat].map((v) => v / cellDegreeSize);
|
|
51
|
+
const ids = [];
|
|
52
|
+
const cells = [];
|
|
53
|
+
let max = [curMinLon, curMinLat];
|
|
54
|
+
const intersections = this.intersections(viewRect);
|
|
55
|
+
const addCell = (x, y) => {
|
|
56
|
+
const lon1 = x * cellDegreeSize + curMinLon;
|
|
57
|
+
const lat1 = y * cellDegreeSize + curMinLat;
|
|
58
|
+
const lon2 = lon1 + cellDegreeSize;
|
|
59
|
+
const lat2 = lat1 + cellDegreeSize;
|
|
60
|
+
const [id, cell] = getOrCreateCell(this.cells, cellDegreeSize, lon1, lon2, lat1, lat2);
|
|
61
|
+
/*
|
|
62
|
+
{
|
|
63
|
+
const cell_bounds = { south: lat1, west: lon1, north: lat2, east: lon2 };
|
|
64
|
+
const subcells = [];
|
|
65
|
+
for (const id of intersections) {
|
|
66
|
+
const c = this.cells[id].GetBounds();
|
|
67
|
+
if (contains(c, cell_bounds)) {
|
|
68
|
+
cell.Fetched = true;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (intersects(c, cell_bounds)) {
|
|
72
|
+
const cropped = crop(c, cell.GetBounds());
|
|
73
|
+
subcells.push(cropped);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
let filled = 0;
|
|
77
|
+
while (subcells.length > 0) {
|
|
78
|
+
const c = subcells.pop();
|
|
79
|
+
filled += area(c);
|
|
80
|
+
for (const s of subcells) {
|
|
81
|
+
filled -= intersection(s, c);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (filled + Number.EPSILON * 2 > area(cell.GetBounds())) {
|
|
85
|
+
cell.Fetched = true;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let [x2, y2] = max;
|
|
90
|
+
x2 = Math.max(x2, lon2);
|
|
91
|
+
y2 = Math.max(y2, lat2);
|
|
92
|
+
max = [x2, y2];
|
|
93
|
+
}
|
|
94
|
+
*/
|
|
95
|
+
ids.push(id);
|
|
96
|
+
cells.push(cell);
|
|
97
|
+
cells[id] = cell;
|
|
98
|
+
};
|
|
99
|
+
for (let x = 0; x < width; x++) {
|
|
100
|
+
for (let y = 0; y < height; y++) {
|
|
101
|
+
addCell(x, y);
|
|
102
|
+
if (cells.length >= MAX_CELLS) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const [x2, y2] = max;
|
|
108
|
+
if (x2 != curMinLon && y2 != curMinLat) {
|
|
109
|
+
this.patches.push([{ west: curMinLon, east: x2, south: curMinLat, north: y2 }, ids]);
|
|
110
|
+
}
|
|
111
|
+
return cells;
|
|
112
|
+
}
|
|
113
|
+
intersections(withRect) {
|
|
114
|
+
return this.patches
|
|
115
|
+
.filter(([rect, _]) => intersects(rect, withRect))
|
|
116
|
+
.map(([_, ids]) => ids)
|
|
117
|
+
.reduce((all, ids) => {
|
|
118
|
+
all.push(...ids);
|
|
119
|
+
return all;
|
|
120
|
+
}, []);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
EntityGlobe.Grid = Grid;
|
|
124
|
+
})(EntityGlobe = exports.EntityGlobe || (exports.EntityGlobe = {}));
|
|
125
|
+
function intersects(l, r) {
|
|
126
|
+
const { west: w, south: s, north: n, east: e } = l;
|
|
127
|
+
const { west: wr, south: sr, north: nr, east: er } = r;
|
|
128
|
+
return !(e <= wr || w >= er || n <= sr || s >= nr);
|
|
129
|
+
}
|
|
130
|
+
function contains(l, r) {
|
|
131
|
+
const { west: w, south: s, north: n, east: e } = l;
|
|
132
|
+
const { west: wr, south: sr, north: nr, east: er } = r;
|
|
133
|
+
return !(er < e || wr > w || nr > n || sr < s);
|
|
134
|
+
}
|
|
135
|
+
function crop(rect, by) {
|
|
136
|
+
let { west: w, south: s, north: n, east: e } = rect;
|
|
137
|
+
const { west: wc, south: sc, north: nc, east: ec } = by;
|
|
138
|
+
w = Math.max(w, ec);
|
|
139
|
+
e = Math.min(e, wc);
|
|
140
|
+
s = Math.max(s, nc);
|
|
141
|
+
n = Math.min(n, sc);
|
|
142
|
+
return { west: w, south: s, north: n, east: e };
|
|
143
|
+
}
|
|
144
|
+
function intersection(l, r) {
|
|
145
|
+
const { west: w, south: s, north: n, east: e } = l;
|
|
146
|
+
const { west: wr, south: sr, north: nr, east: er } = r;
|
|
147
|
+
const x = Math.min(e, er) - Math.max(w, wr);
|
|
148
|
+
const y = Math.min(n, nr) - Math.max(s, sr);
|
|
149
|
+
return (x > 0 && y > 0) ? x * y : 0;
|
|
150
|
+
}
|
|
151
|
+
function area(rect) {
|
|
152
|
+
let { west: w, south: s, north: n, east: e } = rect;
|
|
153
|
+
return Math.abs((e - w) * (n - s));
|
|
154
|
+
}
|
|
155
|
+
function floorValueToCellSize(size, value) {
|
|
156
|
+
return Math.floor(value / size) * size;
|
|
157
|
+
}
|
|
158
|
+
function getCellSizeFromHeight(height) {
|
|
159
|
+
if (height < 1000) {
|
|
160
|
+
return 0.01;
|
|
161
|
+
}
|
|
162
|
+
if (height < 5000) {
|
|
163
|
+
return 0.025;
|
|
164
|
+
}
|
|
165
|
+
else if (height < 10000) {
|
|
166
|
+
return 0.05;
|
|
167
|
+
}
|
|
168
|
+
else if (height < 30000) {
|
|
169
|
+
return 0.1;
|
|
170
|
+
}
|
|
171
|
+
else if (height < 70000) {
|
|
172
|
+
return 0.2;
|
|
173
|
+
}
|
|
174
|
+
else if (height < 100000) {
|
|
175
|
+
return 0.3;
|
|
176
|
+
}
|
|
177
|
+
else if (height < 150000) {
|
|
178
|
+
return 0.4;
|
|
179
|
+
}
|
|
180
|
+
else if (height < 200000) {
|
|
181
|
+
return 0.5;
|
|
182
|
+
}
|
|
183
|
+
else if (height < 300000) {
|
|
184
|
+
return 0.6;
|
|
185
|
+
}
|
|
186
|
+
else if (height < 500000) {
|
|
187
|
+
return 1;
|
|
188
|
+
}
|
|
189
|
+
return 1.5;
|
|
190
|
+
}
|
|
191
|
+
function isCellFetched(cell) {
|
|
192
|
+
if (cell.Fetched) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
function getOrCreateCell(cells, cellSize, lon, maxLon, lat, maxLat) {
|
|
198
|
+
const id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
|
|
199
|
+
let cell = cells[id];
|
|
200
|
+
if (!cell) {
|
|
201
|
+
cell = cells[id] = new EntityGlobe.Cell();
|
|
202
|
+
cell.Boundaries = {
|
|
203
|
+
minLatitude: lat,
|
|
204
|
+
maxLatitude: maxLat,
|
|
205
|
+
minLongitude: lon,
|
|
206
|
+
maxLongitude: maxLon
|
|
207
|
+
};
|
|
208
|
+
cell.IsFetched = () => isCellFetched(cell);
|
|
209
|
+
}
|
|
210
|
+
return [id, cell];
|
|
211
|
+
}
|
|
212
212
|
//# sourceMappingURL=entity-globe.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=view-monitor.js.map
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ImportCad = void 0;
|
|
13
|
-
const api_1 = require("../api/api");
|
|
14
|
-
/**
|
|
15
|
-
* TODO: The analysis result is currently a mix of multiple layers of legacy.
|
|
16
|
-
* We will first decide what we want it to do and then describe just the needed portions of the existing implementation.
|
|
17
|
-
*/
|
|
18
|
-
var ImportCad;
|
|
19
|
-
(function (ImportCad) {
|
|
20
|
-
function Analyze(params) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const { api, fileAnalyze, req: reqParams } = params;
|
|
23
|
-
return api.POST("entities/PrepareIFCForImport", fileAnalyze, api_1.Api.PrepReqParams(reqParams));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
ImportCad.Analyze = Analyze;
|
|
27
|
-
function ImportEntities(params) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const { api, fileImport, req: reqParams } = params;
|
|
30
|
-
return api.POST("entities/importIFCWithProgress", fileImport, api_1.Api.PrepReqParams(reqParams));
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
ImportCad.ImportEntities = ImportEntities;
|
|
34
|
-
/**
|
|
35
|
-
* Parses the completed pending action result from running "ImportEntities".
|
|
36
|
-
* This will return the root entity's id if any is present.
|
|
37
|
-
* @param paResult
|
|
38
|
-
*/
|
|
39
|
-
function ParseRootId(paResult) {
|
|
40
|
-
var _a;
|
|
41
|
-
try {
|
|
42
|
-
const obj = typeof paResult == "string" ? JSON.parse(paResult) : paResult;
|
|
43
|
-
if ((_a = obj === null || obj === void 0 ? void 0 : obj.result) === null || _a === void 0 ? void 0 : _a.length) {
|
|
44
|
-
return obj.result[0];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch (_b) {
|
|
48
|
-
// Failed to parse json.
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
ImportCad.ParseRootId = ParseRootId;
|
|
53
|
-
})(ImportCad = exports.ImportCad || (exports.ImportCad = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImportCad = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
/**
|
|
15
|
+
* TODO: The analysis result is currently a mix of multiple layers of legacy.
|
|
16
|
+
* We will first decide what we want it to do and then describe just the needed portions of the existing implementation.
|
|
17
|
+
*/
|
|
18
|
+
var ImportCad;
|
|
19
|
+
(function (ImportCad) {
|
|
20
|
+
function Analyze(params) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { api, fileAnalyze, req: reqParams } = params;
|
|
23
|
+
return api.POST("entities/PrepareIFCForImport", fileAnalyze, api_1.Api.PrepReqParams(reqParams));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
ImportCad.Analyze = Analyze;
|
|
27
|
+
function ImportEntities(params) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const { api, fileImport, req: reqParams } = params;
|
|
30
|
+
return api.POST("entities/importIFCWithProgress", fileImport, api_1.Api.PrepReqParams(reqParams));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
ImportCad.ImportEntities = ImportEntities;
|
|
34
|
+
/**
|
|
35
|
+
* Parses the completed pending action result from running "ImportEntities".
|
|
36
|
+
* This will return the root entity's id if any is present.
|
|
37
|
+
* @param paResult
|
|
38
|
+
*/
|
|
39
|
+
function ParseRootId(paResult) {
|
|
40
|
+
var _a;
|
|
41
|
+
try {
|
|
42
|
+
const obj = typeof paResult == "string" ? JSON.parse(paResult) : paResult;
|
|
43
|
+
if ((_a = obj === null || obj === void 0 ? void 0 : obj.result) === null || _a === void 0 ? void 0 : _a.length) {
|
|
44
|
+
return obj.result[0];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (_b) {
|
|
48
|
+
// Failed to parse json.
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
ImportCad.ParseRootId = ParseRootId;
|
|
53
|
+
})(ImportCad = exports.ImportCad || (exports.ImportCad = {}));
|
|
54
54
|
//# sourceMappingURL=import-cad.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ImportCsv = void 0;
|
|
13
|
-
const api_1 = require("../api/api");
|
|
14
|
-
var ImportCsv;
|
|
15
|
-
(function (ImportCsv) {
|
|
16
|
-
function ImportEntities(params) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const { api, fileImport, req: reqParams } = params;
|
|
19
|
-
return api.POST("entities/importCSVWithProgress2", fileImport, api_1.Api.PrepReqParams(reqParams));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
ImportCsv.ImportEntities = ImportEntities;
|
|
23
|
-
})(ImportCsv = exports.ImportCsv || (exports.ImportCsv = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImportCsv = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
var ImportCsv;
|
|
15
|
+
(function (ImportCsv) {
|
|
16
|
+
function ImportEntities(params) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { api, fileImport, req: reqParams } = params;
|
|
19
|
+
return api.POST("entities/importCSVWithProgress2", fileImport, api_1.Api.PrepReqParams(reqParams));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
ImportCsv.ImportEntities = ImportEntities;
|
|
23
|
+
})(ImportCsv = exports.ImportCsv || (exports.ImportCsv = {}));
|
|
24
24
|
//# sourceMappingURL=import-csv.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ImportJson = void 0;
|
|
13
|
-
const api_1 = require("../api/api");
|
|
14
|
-
var ImportJson;
|
|
15
|
-
(function (ImportJson) {
|
|
16
|
-
function ImportEntities(params) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const { api, fileImport, req: reqParams } = params;
|
|
19
|
-
return api.POST("entities/importJsonWithProgress", fileImport, api_1.Api.PrepReqParams(reqParams));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
ImportJson.ImportEntities = ImportEntities;
|
|
23
|
-
})(ImportJson = exports.ImportJson || (exports.ImportJson = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImportJson = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
var ImportJson;
|
|
15
|
+
(function (ImportJson) {
|
|
16
|
+
function ImportEntities(params) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { api, fileImport, req: reqParams } = params;
|
|
19
|
+
return api.POST("entities/importJsonWithProgress", fileImport, api_1.Api.PrepReqParams(reqParams));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
ImportJson.ImportEntities = ImportEntities;
|
|
23
|
+
})(ImportJson = exports.ImportJson || (exports.ImportJson = {}));
|
|
24
24
|
//# sourceMappingURL=import-json.js.map
|