bruce-cesium 2.7.9 → 2.8.1
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-cesium.es5.js +58 -51
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +57 -50
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js +17 -24
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +37 -24
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/other/relations-render-manager.d.ts +1 -1
- package/dist/types/rendering/visuals-register.d.ts +3 -3
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -4241,20 +4241,33 @@
|
|
|
4241
4241
|
/**
|
|
4242
4242
|
* Locates a visual corresponding to a given entity id.
|
|
4243
4243
|
* If no menu item id is provided, then it will pick the "best" one.
|
|
4244
|
-
* @param
|
|
4245
|
-
* @param menuItemId
|
|
4244
|
+
* @param params
|
|
4246
4245
|
* @returns
|
|
4247
4246
|
*/
|
|
4248
4247
|
Register.prototype.GetRego = function (params) {
|
|
4249
|
-
var entityId = params.entityId, menuItemId = params.menuItemId;
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4248
|
+
var entityId = params.entityId, menuItemId = params.menuItemId, relation = params.relation;
|
|
4249
|
+
if (relation) {
|
|
4250
|
+
var relationKey_1 = RelationRenderEngine.GetRenderGroupId(relation);
|
|
4251
|
+
for (var entityId_1 in this.rego) {
|
|
4252
|
+
var entityRegos = this.rego[entityId_1];
|
|
4253
|
+
if (entityRegos) {
|
|
4254
|
+
var rego = entityRegos.find(function (r) { return r.relation && RelationRenderEngine.GetRenderGroupId(r.relation) == relationKey_1; });
|
|
4255
|
+
if (rego) {
|
|
4256
|
+
return rego;
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
4253
4260
|
}
|
|
4254
|
-
|
|
4255
|
-
|
|
4261
|
+
else {
|
|
4262
|
+
var entityRegos = this.rego[entityId];
|
|
4263
|
+
if (!entityRegos) {
|
|
4264
|
+
return [];
|
|
4265
|
+
}
|
|
4266
|
+
if (menuItemId) {
|
|
4267
|
+
return entityRegos.find(function (r) { return r.menuItemId === menuItemId; });
|
|
4268
|
+
}
|
|
4269
|
+
return entityRegos.find(function (x) { return x.best; });
|
|
4256
4270
|
}
|
|
4257
|
-
return entityRegos.find(function (x) { return x.best; });
|
|
4258
4271
|
};
|
|
4259
4272
|
/**
|
|
4260
4273
|
* Returns regos matching given criteria.
|
|
@@ -4267,8 +4280,8 @@
|
|
|
4267
4280
|
// Currently this was made by merging two functions.
|
|
4268
4281
|
var entityId = params.entityId, menuItemId = params.menuItemId;
|
|
4269
4282
|
if (entityId) {
|
|
4270
|
-
var
|
|
4271
|
-
var entityRegos = this.rego[
|
|
4283
|
+
var entityId_2 = params.entityId;
|
|
4284
|
+
var entityRegos = this.rego[entityId_2];
|
|
4272
4285
|
if (!entityRegos) {
|
|
4273
4286
|
return [];
|
|
4274
4287
|
}
|
|
@@ -4277,8 +4290,8 @@
|
|
|
4277
4290
|
else if (menuItemId) {
|
|
4278
4291
|
var menuItemId_1 = params.menuItemId;
|
|
4279
4292
|
var visuals = [];
|
|
4280
|
-
for (var
|
|
4281
|
-
var entityRegos = this.rego[
|
|
4293
|
+
for (var entityId_3 in this.rego) {
|
|
4294
|
+
var entityRegos = this.rego[entityId_3];
|
|
4282
4295
|
if (entityRegos) {
|
|
4283
4296
|
var rego = entityRegos.find(function (r) { return r.menuItemId === menuItemId_1; });
|
|
4284
4297
|
if (rego) {
|
|
@@ -4307,8 +4320,8 @@
|
|
|
4307
4320
|
// TODO: refactor.
|
|
4308
4321
|
// Currently this was made by merging two functions.
|
|
4309
4322
|
if (menuItemId && !entityId) {
|
|
4310
|
-
for (var
|
|
4311
|
-
var entityRegos = this.rego[
|
|
4323
|
+
for (var entityId_4 in this.rego) {
|
|
4324
|
+
var entityRegos = this.rego[entityId_4];
|
|
4312
4325
|
if (entityRegos) {
|
|
4313
4326
|
var rego = entityRegos.find(function (r) { return r.menuItemId === menuItemId; });
|
|
4314
4327
|
if (!rego) {
|
|
@@ -4320,9 +4333,9 @@
|
|
|
4320
4333
|
continue;
|
|
4321
4334
|
}
|
|
4322
4335
|
removeEntity(this.viewer, rego.visual);
|
|
4323
|
-
var doesInclude = this.rego[
|
|
4336
|
+
var doesInclude = this.rego[entityId_4].find(function (r) { return r.menuItemId === menuItemId; });
|
|
4324
4337
|
if (doesInclude) {
|
|
4325
|
-
this.rego[
|
|
4338
|
+
this.rego[entityId_4] = entityRegos.filter(function (r) { return r.menuItemId !== menuItemId; });
|
|
4326
4339
|
}
|
|
4327
4340
|
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger({
|
|
4328
4341
|
type: EVisualUpdateType.Remove,
|
|
@@ -4330,7 +4343,7 @@
|
|
|
4330
4343
|
rego: rego
|
|
4331
4344
|
});
|
|
4332
4345
|
if (doesInclude) {
|
|
4333
|
-
updateEntity(this.viewer,
|
|
4346
|
+
updateEntity(this.viewer, entityId_4, this);
|
|
4334
4347
|
}
|
|
4335
4348
|
}
|
|
4336
4349
|
}
|
|
@@ -4366,23 +4379,23 @@
|
|
|
4366
4379
|
}
|
|
4367
4380
|
}
|
|
4368
4381
|
else if (relation) {
|
|
4369
|
-
var
|
|
4370
|
-
for (var
|
|
4371
|
-
var entityRegos = this.rego[
|
|
4382
|
+
var relationKey_2 = RelationRenderEngine.GetRenderGroupId(relation);
|
|
4383
|
+
for (var entityId_5 in this.rego) {
|
|
4384
|
+
var entityRegos = this.rego[entityId_5];
|
|
4372
4385
|
if (entityRegos) {
|
|
4373
|
-
var rego = entityRegos.find(function (r) { return r.relation && RelationRenderEngine.GetRenderGroupId(r.relation) ==
|
|
4386
|
+
var rego = entityRegos.find(function (r) { return r.relation && RelationRenderEngine.GetRenderGroupId(r.relation) == relationKey_2; });
|
|
4374
4387
|
if (!rego) {
|
|
4375
4388
|
continue;
|
|
4376
4389
|
}
|
|
4377
4390
|
removeEntity(this.viewer, rego.visual);
|
|
4378
|
-
this.rego[
|
|
4391
|
+
this.rego[entityId_5] = entityRegos.filter(function (r) { return r.menuItemId !== menuItemId; });
|
|
4379
4392
|
(_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger({
|
|
4380
4393
|
type: EVisualUpdateType.Remove,
|
|
4381
4394
|
entityId: rego.entityId,
|
|
4382
4395
|
rego: rego
|
|
4383
4396
|
});
|
|
4384
4397
|
if (doUpdate && menuItemId) {
|
|
4385
|
-
updateEntity(this.viewer,
|
|
4398
|
+
updateEntity(this.viewer, entityId_5, this);
|
|
4386
4399
|
}
|
|
4387
4400
|
}
|
|
4388
4401
|
}
|
|
@@ -9092,6 +9105,9 @@
|
|
|
9092
9105
|
// If true, this menu item is disposed and should not be used.
|
|
9093
9106
|
// Any rendering will be ignored.
|
|
9094
9107
|
this.disposed = false;
|
|
9108
|
+
// Record of the currently drawn entity IDs.
|
|
9109
|
+
// This is to avoid re-queueing already drawn entities when Init is called multiple times.
|
|
9110
|
+
this.drawnIds = [];
|
|
9095
9111
|
var apiGetter = params.apiGetter, item = params.item, register = params.register, viewer = params.viewer;
|
|
9096
9112
|
this.apiGetter = apiGetter;
|
|
9097
9113
|
this.item = item;
|
|
@@ -9112,6 +9128,7 @@
|
|
|
9112
9128
|
* @returns
|
|
9113
9129
|
*/
|
|
9114
9130
|
Manager.prototype.Init = function (params) {
|
|
9131
|
+
var _this = this;
|
|
9115
9132
|
var _a;
|
|
9116
9133
|
if (this.disposed) {
|
|
9117
9134
|
return;
|
|
@@ -9124,8 +9141,6 @@
|
|
|
9124
9141
|
var regos = this.register.GetRegos({
|
|
9125
9142
|
menuItemId: this.item.id
|
|
9126
9143
|
});
|
|
9127
|
-
var drawnIds = [];
|
|
9128
|
-
var toDrawIds = [];
|
|
9129
9144
|
var entityIds = (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.EntityIds;
|
|
9130
9145
|
if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
|
|
9131
9146
|
entityIds = [];
|
|
@@ -9140,27 +9155,12 @@
|
|
|
9140
9155
|
requestRender: false
|
|
9141
9156
|
});
|
|
9142
9157
|
}
|
|
9143
|
-
else {
|
|
9144
|
-
drawnIds.push(rego.entityId);
|
|
9145
|
-
if (rego.relation) {
|
|
9146
|
-
drawnIds.push(rego.relation["Principal.Entity.ID"]);
|
|
9147
|
-
drawnIds.push(rego.relation["Related.Entity.ID"]);
|
|
9148
|
-
}
|
|
9149
|
-
}
|
|
9150
9158
|
}
|
|
9151
9159
|
this.viewer.scene.requestRender();
|
|
9152
|
-
var _loop_1 = function (i) {
|
|
9153
|
-
if (!drawnIds.find(function (x) { return x == entityIds[i]; })) {
|
|
9154
|
-
toDrawIds.push(entityIds[i]);
|
|
9155
|
-
}
|
|
9156
|
-
};
|
|
9157
|
-
// We'll call a re-render on entity ids that are not drawn.
|
|
9158
|
-
for (var i = 0; i < entityIds.length; i++) {
|
|
9159
|
-
_loop_1(i);
|
|
9160
|
-
}
|
|
9161
9160
|
this.renderEntityIds({
|
|
9162
|
-
entityIds:
|
|
9161
|
+
entityIds: entityIds.filter(function (x) { return !_this.drawnIds.includes(x); })
|
|
9163
9162
|
});
|
|
9163
|
+
this.drawnIds = [].concat(entityIds);
|
|
9164
9164
|
};
|
|
9165
9165
|
Manager.prototype.Dispose = function () {
|
|
9166
9166
|
if (this.disposed) {
|
|
@@ -9173,18 +9173,25 @@
|
|
|
9173
9173
|
};
|
|
9174
9174
|
/**
|
|
9175
9175
|
* Re-renders specific entity relationships.
|
|
9176
|
-
* @TODO: This should re-render all relationships when entityIds=null.
|
|
9177
9176
|
* @param params
|
|
9178
9177
|
*/
|
|
9179
9178
|
Manager.prototype.ReRender = function (params) {
|
|
9180
9179
|
return __awaiter(this, void 0, void 0, function () {
|
|
9181
9180
|
var entityIds, force;
|
|
9181
|
+
var _this = this;
|
|
9182
9182
|
return __generator(this, function (_a) {
|
|
9183
9183
|
entityIds = params.entityIds, force = params.force;
|
|
9184
|
-
if (entityIds == null)
|
|
9184
|
+
if (entityIds == null) {
|
|
9185
|
+
this.renderEntityIds({
|
|
9186
|
+
entityIds: this.drawnIds
|
|
9187
|
+
});
|
|
9188
|
+
}
|
|
9185
9189
|
else {
|
|
9186
9190
|
this.renderEntityIds({
|
|
9187
|
-
|
|
9191
|
+
// TODO: This is a guess and not a proper check.
|
|
9192
|
+
// We need to record rendered relationships and check against them rather than the ID stored as the ID can be a child or parent.
|
|
9193
|
+
dataEntityIds: entityIds.filter(function (x) { return !_this.drawnIds.includes(x); }),
|
|
9194
|
+
entityIds: entityIds.filter(function (x) { return _this.drawnIds.includes(x); })
|
|
9188
9195
|
});
|
|
9189
9196
|
}
|
|
9190
9197
|
return [2 /*return*/];
|
|
@@ -9261,7 +9268,7 @@
|
|
|
9261
9268
|
}
|
|
9262
9269
|
}).then(function (data) {
|
|
9263
9270
|
var relations = data.relations;
|
|
9264
|
-
var
|
|
9271
|
+
var _loop_1 = function (j) {
|
|
9265
9272
|
var relation = relations[j];
|
|
9266
9273
|
var key = RelationRenderEngine.GetRenderGroupId(relation);
|
|
9267
9274
|
if (!drawn.find(function (x) { return x == key; })) {
|
|
@@ -9274,7 +9281,7 @@
|
|
|
9274
9281
|
}
|
|
9275
9282
|
};
|
|
9276
9283
|
for (var j = 0; j < relations.length; j++) {
|
|
9277
|
-
|
|
9284
|
+
_loop_1(j);
|
|
9278
9285
|
}
|
|
9279
9286
|
onResolve();
|
|
9280
9287
|
}).catch(function (e) {
|
|
@@ -9356,7 +9363,7 @@
|
|
|
9356
9363
|
cEntity = cEntities[key];
|
|
9357
9364
|
if (cEntity && this.shouldRenderRelation(relation)) {
|
|
9358
9365
|
visual = (_a = this.register.GetRego({
|
|
9359
|
-
|
|
9366
|
+
relation: relation,
|
|
9360
9367
|
menuItemId: this.item.id
|
|
9361
9368
|
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
9362
9369
|
if (!visual || visual != cEntity) {
|
|
@@ -15428,7 +15435,7 @@
|
|
|
15428
15435
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
15429
15436
|
})(exports.ViewerUtils || (exports.ViewerUtils = {}));
|
|
15430
15437
|
|
|
15431
|
-
var VERSION$1 = "2.
|
|
15438
|
+
var VERSION$1 = "2.8.1";
|
|
15432
15439
|
|
|
15433
15440
|
exports.VERSION = VERSION$1;
|
|
15434
15441
|
exports.CesiumViewMonitor = CesiumViewMonitor;
|