bruce-cesium 2.9.1 → 2.9.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.
- package/dist/bruce-cesium.es5.js +420 -134
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +418 -132
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/menu-item-creator.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +20 -0
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/old-relations-render-manager.js +351 -0
- package/dist/lib/rendering/render-managers/other/old-relations-render-manager.js.map +1 -0
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js +83 -123
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +42 -40
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/utils/view-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/other/old-relations-render-manager.d.ts +60 -0
- package/dist/types/rendering/render-managers/other/relations-render-manager.d.ts +3 -12
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -9774,6 +9774,360 @@
|
|
|
9774
9774
|
})(exports.TilesetArbRenderManager || (exports.TilesetArbRenderManager = {}));
|
|
9775
9775
|
|
|
9776
9776
|
(function (RelationsRenderManager) {
|
|
9777
|
+
var Manager = /** @class */ (function () {
|
|
9778
|
+
function Manager(params) {
|
|
9779
|
+
// If true, this menu item is disposed and should not be used.
|
|
9780
|
+
// Any rendering will be ignored.
|
|
9781
|
+
this.disposed = false;
|
|
9782
|
+
var apiGetter = params.apiGetter, item = params.item, register = params.register, viewer = params.viewer;
|
|
9783
|
+
this.apiGetter = apiGetter;
|
|
9784
|
+
this.item = item;
|
|
9785
|
+
this.register = register;
|
|
9786
|
+
this.viewer = viewer;
|
|
9787
|
+
}
|
|
9788
|
+
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
9789
|
+
get: function () {
|
|
9790
|
+
return this.disposed;
|
|
9791
|
+
},
|
|
9792
|
+
enumerable: false,
|
|
9793
|
+
configurable: true
|
|
9794
|
+
});
|
|
9795
|
+
/**
|
|
9796
|
+
* Starts rendering the menu item.
|
|
9797
|
+
* Re-call with an updated menu item to re-render. It will auto-cleanup old relations.
|
|
9798
|
+
* @param params
|
|
9799
|
+
* @returns
|
|
9800
|
+
*/
|
|
9801
|
+
Manager.prototype.Init = function (params) {
|
|
9802
|
+
if (this.disposed) {
|
|
9803
|
+
return;
|
|
9804
|
+
}
|
|
9805
|
+
if (params === null || params === void 0 ? void 0 : params.item) {
|
|
9806
|
+
this.item = params.item;
|
|
9807
|
+
}
|
|
9808
|
+
// Remove relationships we no longer want to render.
|
|
9809
|
+
// We'll have to get regos by the menu item ID then run a check on the related rego relationship.
|
|
9810
|
+
var regos = this.register.GetRegos({
|
|
9811
|
+
menuItemId: this.item.id
|
|
9812
|
+
});
|
|
9813
|
+
for (var i = 0; i < regos.length; i++) {
|
|
9814
|
+
var rego = regos[i];
|
|
9815
|
+
if (!this.shouldRenderRelation(rego.relation)) {
|
|
9816
|
+
this.register.RemoveRegos({
|
|
9817
|
+
relation: rego.relation,
|
|
9818
|
+
entityId: rego.entityId,
|
|
9819
|
+
menuItemId: this.item.id,
|
|
9820
|
+
requestRender: false
|
|
9821
|
+
});
|
|
9822
|
+
}
|
|
9823
|
+
}
|
|
9824
|
+
this.viewer.scene.requestRender();
|
|
9825
|
+
this.queueRenderRelations({
|
|
9826
|
+
relations: this.item.relations
|
|
9827
|
+
});
|
|
9828
|
+
};
|
|
9829
|
+
Manager.prototype.Dispose = function () {
|
|
9830
|
+
if (this.disposed) {
|
|
9831
|
+
return;
|
|
9832
|
+
}
|
|
9833
|
+
this.disposed = true;
|
|
9834
|
+
this.register.RemoveRegos({
|
|
9835
|
+
menuItemId: this.item.id
|
|
9836
|
+
});
|
|
9837
|
+
};
|
|
9838
|
+
/**
|
|
9839
|
+
* Re-renders specific entity relationships.
|
|
9840
|
+
* @param params
|
|
9841
|
+
*/
|
|
9842
|
+
Manager.prototype.ReRender = function (params) {
|
|
9843
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9844
|
+
var entityIds, force;
|
|
9845
|
+
return __generator(this, function (_a) {
|
|
9846
|
+
entityIds = params.entityIds, force = params.force;
|
|
9847
|
+
return [2 /*return*/];
|
|
9848
|
+
});
|
|
9849
|
+
});
|
|
9850
|
+
};
|
|
9851
|
+
Manager.prototype.queueRenderRelations = function (params) {
|
|
9852
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9853
|
+
var relations, allIds_1, _i, relations_1, relation, entityIds, toRender, i, entityId, data, j, relation, e_1;
|
|
9854
|
+
return __generator(this, function (_a) {
|
|
9855
|
+
switch (_a.label) {
|
|
9856
|
+
case 0:
|
|
9857
|
+
_a.trys.push([0, 5, , 6]);
|
|
9858
|
+
relations = params.relations;
|
|
9859
|
+
allIds_1 = [];
|
|
9860
|
+
for (_i = 0, relations_1 = relations; _i < relations_1.length; _i++) {
|
|
9861
|
+
relation = relations_1[_i];
|
|
9862
|
+
entityIds = relation.entityIds;
|
|
9863
|
+
allIds_1.push.apply(allIds_1, entityIds);
|
|
9864
|
+
}
|
|
9865
|
+
allIds_1 = allIds_1.filter(function (id, index) {
|
|
9866
|
+
return allIds_1.indexOf(id) === index;
|
|
9867
|
+
});
|
|
9868
|
+
toRender = [];
|
|
9869
|
+
i = 0;
|
|
9870
|
+
_a.label = 1;
|
|
9871
|
+
case 1:
|
|
9872
|
+
if (!(i < allIds_1.length)) return [3 /*break*/, 4];
|
|
9873
|
+
entityId = allIds_1[i];
|
|
9874
|
+
return [4 /*yield*/, bruceModels.EntityRelation.GetList({
|
|
9875
|
+
entityId: entityId,
|
|
9876
|
+
filter: {
|
|
9877
|
+
oneWayOnly: true,
|
|
9878
|
+
loadEntityData: false
|
|
9879
|
+
},
|
|
9880
|
+
api: this.apiGetter.getApi()
|
|
9881
|
+
})];
|
|
9882
|
+
case 2:
|
|
9883
|
+
data = _a.sent();
|
|
9884
|
+
console.log("get relations", data);
|
|
9885
|
+
for (j = 0; j < data.relations.length; j++) {
|
|
9886
|
+
relation = data.relations[j];
|
|
9887
|
+
if (this.shouldRenderRelation(relation)) {
|
|
9888
|
+
toRender.push(relation);
|
|
9889
|
+
}
|
|
9890
|
+
}
|
|
9891
|
+
_a.label = 3;
|
|
9892
|
+
case 3:
|
|
9893
|
+
i++;
|
|
9894
|
+
return [3 /*break*/, 1];
|
|
9895
|
+
case 4:
|
|
9896
|
+
console.log("all render", toRender);
|
|
9897
|
+
// Relations are not being returned??
|
|
9898
|
+
// const data = await Entity.GetListByIds({
|
|
9899
|
+
// entityIds: allIds,
|
|
9900
|
+
// expandRelations: true,
|
|
9901
|
+
// api: this.apiGetter.getApi()
|
|
9902
|
+
// });
|
|
9903
|
+
// for (let i = 0; i < data.entities.length; i++) {
|
|
9904
|
+
// const entity = data.entities[i];
|
|
9905
|
+
// if (entity?.Bruce?.relations?.length) {
|
|
9906
|
+
// const eRelations = entity.Bruce.relations;
|
|
9907
|
+
// for (let j = 0; j < eRelations.length; j++) {
|
|
9908
|
+
// const eRelation = eRelations[j];
|
|
9909
|
+
// const relation: EntityRelation.IRelation = {
|
|
9910
|
+
// "Principal.Entity.ID": entity.Bruce.ID,
|
|
9911
|
+
// "Related.Entity.ID": eRelation["Other.Entity.ID"],
|
|
9912
|
+
// "Relation.Type.ID": eRelation["Relation.Type.ID"]
|
|
9913
|
+
// };
|
|
9914
|
+
// if (this.shouldRenderRelation(relation)) {
|
|
9915
|
+
// toRender.push(relation);
|
|
9916
|
+
// }
|
|
9917
|
+
// }
|
|
9918
|
+
// }
|
|
9919
|
+
// }
|
|
9920
|
+
if (toRender.length) {
|
|
9921
|
+
this.onGetterUpdate(toRender);
|
|
9922
|
+
}
|
|
9923
|
+
return [3 /*break*/, 6];
|
|
9924
|
+
case 5:
|
|
9925
|
+
e_1 = _a.sent();
|
|
9926
|
+
console.error(e_1);
|
|
9927
|
+
return [3 /*break*/, 6];
|
|
9928
|
+
case 6: return [2 /*return*/];
|
|
9929
|
+
}
|
|
9930
|
+
});
|
|
9931
|
+
});
|
|
9932
|
+
};
|
|
9933
|
+
Manager.prototype.shouldRenderRelation = function (relation) {
|
|
9934
|
+
var _a, _b;
|
|
9935
|
+
var typeId = relation === null || relation === void 0 ? void 0 : relation["Relation.Type.ID"];
|
|
9936
|
+
if (!typeId || !((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.relations) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
9937
|
+
return false;
|
|
9938
|
+
}
|
|
9939
|
+
var group = this.item.relations.find(function (x) { return x.relationTypeId == typeId; });
|
|
9940
|
+
if (!(group === null || group === void 0 ? void 0 : group.entityIds)) {
|
|
9941
|
+
return false;
|
|
9942
|
+
}
|
|
9943
|
+
return group.entityIds.includes(relation["Principal.Entity.ID"]);
|
|
9944
|
+
};
|
|
9945
|
+
/**
|
|
9946
|
+
* Renders batch of entity relationships.
|
|
9947
|
+
* This will check if a relationship SHOULD be rendered before rendering it.
|
|
9948
|
+
* It will also handle already rendered relations to avoid re-rendering them.
|
|
9949
|
+
* @param relations
|
|
9950
|
+
*/
|
|
9951
|
+
Manager.prototype.onGetterUpdate = function (relations) {
|
|
9952
|
+
var _a, _b;
|
|
9953
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9954
|
+
var killCEntity, cEntities, key, i, relation, key, cEntity, visual, e_2;
|
|
9955
|
+
var _this = this;
|
|
9956
|
+
return __generator(this, function (_c) {
|
|
9957
|
+
switch (_c.label) {
|
|
9958
|
+
case 0:
|
|
9959
|
+
_c.trys.push([0, 2, , 3]);
|
|
9960
|
+
if (this.disposed || this.viewer.isDestroyed()) {
|
|
9961
|
+
return [2 /*return*/];
|
|
9962
|
+
}
|
|
9963
|
+
relations = relations.filter(function (x) { return _this.shouldRenderRelation(x); });
|
|
9964
|
+
killCEntity = function (cEntity) {
|
|
9965
|
+
if (cEntity && !_this.viewer.isDestroyed() && _this.viewer.entities.contains(cEntity)) {
|
|
9966
|
+
_this.viewer.entities.remove(cEntity);
|
|
9967
|
+
}
|
|
9968
|
+
};
|
|
9969
|
+
return [4 /*yield*/, RelationRenderEngine.Render({
|
|
9970
|
+
apiGetter: this.apiGetter,
|
|
9971
|
+
menuItemId: this.item.id,
|
|
9972
|
+
relations: relations,
|
|
9973
|
+
viewer: this.viewer,
|
|
9974
|
+
visualRegister: this.register
|
|
9975
|
+
})];
|
|
9976
|
+
case 1:
|
|
9977
|
+
cEntities = _c.sent();
|
|
9978
|
+
if (this.disposed) {
|
|
9979
|
+
this.register.RemoveRegos({
|
|
9980
|
+
menuItemId: this.item.id
|
|
9981
|
+
});
|
|
9982
|
+
for (key in cEntities) {
|
|
9983
|
+
killCEntity(cEntities[key]);
|
|
9984
|
+
}
|
|
9985
|
+
return [2 /*return*/];
|
|
9986
|
+
}
|
|
9987
|
+
for (i = 0; i < relations.length; i++) {
|
|
9988
|
+
relation = relations[i];
|
|
9989
|
+
key = RelationRenderEngine.GetRenderGroupId(relation);
|
|
9990
|
+
cEntity = cEntities[key];
|
|
9991
|
+
if (cEntity && this.shouldRenderRelation(relation)) {
|
|
9992
|
+
visual = (_a = this.register.GetRego({
|
|
9993
|
+
relation: relation,
|
|
9994
|
+
menuItemId: this.item.id
|
|
9995
|
+
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
9996
|
+
if (!visual || visual != cEntity) {
|
|
9997
|
+
this.register.AddRego({
|
|
9998
|
+
rego: {
|
|
9999
|
+
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : bruceModels.ObjectUtils.UId(),
|
|
10000
|
+
menuItemId: this.item.id,
|
|
10001
|
+
relation: relation,
|
|
10002
|
+
visual: cEntity,
|
|
10003
|
+
priority: 0,
|
|
10004
|
+
accountId: this.apiGetter.accountId
|
|
10005
|
+
},
|
|
10006
|
+
requestRender: false
|
|
10007
|
+
});
|
|
10008
|
+
}
|
|
10009
|
+
}
|
|
10010
|
+
else {
|
|
10011
|
+
this.register.RemoveRegos({
|
|
10012
|
+
entityId: relation["Data.Entity.ID"],
|
|
10013
|
+
relation: relation,
|
|
10014
|
+
menuItemId: this.item.id,
|
|
10015
|
+
requestRender: false
|
|
10016
|
+
});
|
|
10017
|
+
killCEntity(cEntity);
|
|
10018
|
+
}
|
|
10019
|
+
}
|
|
10020
|
+
this.viewer.scene.requestRender();
|
|
10021
|
+
return [3 /*break*/, 3];
|
|
10022
|
+
case 2:
|
|
10023
|
+
e_2 = _c.sent();
|
|
10024
|
+
console.error(e_2);
|
|
10025
|
+
return [3 /*break*/, 3];
|
|
10026
|
+
case 3: return [2 /*return*/];
|
|
10027
|
+
}
|
|
10028
|
+
});
|
|
10029
|
+
});
|
|
10030
|
+
};
|
|
10031
|
+
return Manager;
|
|
10032
|
+
}());
|
|
10033
|
+
RelationsRenderManager.Manager = Manager;
|
|
10034
|
+
})(exports.RelationsRenderManager || (exports.RelationsRenderManager = {}));
|
|
10035
|
+
|
|
10036
|
+
(function (TilesetGooglePhotosRenderManager) {
|
|
10037
|
+
var Manager = /** @class */ (function () {
|
|
10038
|
+
function Manager(params) {
|
|
10039
|
+
this.disposed = false;
|
|
10040
|
+
this.cTileset = null;
|
|
10041
|
+
var viewer = params.viewer, item = params.item;
|
|
10042
|
+
this.viewer = viewer;
|
|
10043
|
+
this.item = item;
|
|
10044
|
+
}
|
|
10045
|
+
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
10046
|
+
get: function () {
|
|
10047
|
+
return this.disposed;
|
|
10048
|
+
},
|
|
10049
|
+
enumerable: false,
|
|
10050
|
+
configurable: true
|
|
10051
|
+
});
|
|
10052
|
+
Object.defineProperty(Manager.prototype, "Tileset", {
|
|
10053
|
+
get: function () {
|
|
10054
|
+
return this.cTileset;
|
|
10055
|
+
},
|
|
10056
|
+
enumerable: false,
|
|
10057
|
+
configurable: true
|
|
10058
|
+
});
|
|
10059
|
+
Manager.prototype.Dispose = function () {
|
|
10060
|
+
if (this.disposed) {
|
|
10061
|
+
return;
|
|
10062
|
+
}
|
|
10063
|
+
this.doDispose();
|
|
10064
|
+
};
|
|
10065
|
+
Manager.prototype.doDispose = function () {
|
|
10066
|
+
if (this.cTileset) {
|
|
10067
|
+
var viewer = this.viewer;
|
|
10068
|
+
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
10069
|
+
this.cTileset.show = false;
|
|
10070
|
+
this.viewer.scene.primitives.remove(this.cTileset);
|
|
10071
|
+
this.viewer.scene.requestRender();
|
|
10072
|
+
}
|
|
10073
|
+
this.cTileset = null;
|
|
10074
|
+
}
|
|
10075
|
+
};
|
|
10076
|
+
Manager.prototype.Init = function () {
|
|
10077
|
+
var _this = this;
|
|
10078
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10079
|
+
var _a, colorCss;
|
|
10080
|
+
var _b, _c;
|
|
10081
|
+
return __generator(this, function (_d) {
|
|
10082
|
+
switch (_d.label) {
|
|
10083
|
+
case 0:
|
|
10084
|
+
// Using as any to be OK with older versions.
|
|
10085
|
+
_a = this;
|
|
10086
|
+
return [4 /*yield*/, ((_c = (_b = Cesium).createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(_b))];
|
|
10087
|
+
case 1:
|
|
10088
|
+
// Using as any to be OK with older versions.
|
|
10089
|
+
_a.cTileset = _d.sent();
|
|
10090
|
+
if (this.disposed) {
|
|
10091
|
+
this.doDispose();
|
|
10092
|
+
return [2 /*return*/];
|
|
10093
|
+
}
|
|
10094
|
+
this.viewer.scene.primitives.add(this.cTileset);
|
|
10095
|
+
colorCss = this.item.colorMask;
|
|
10096
|
+
if (colorCss) {
|
|
10097
|
+
this.cTileset.style = new Cesium.Cesium3DTileStyle({
|
|
10098
|
+
color: {
|
|
10099
|
+
conditions: [
|
|
10100
|
+
["true", "color(\"".concat(colorCss, "\")")]
|
|
10101
|
+
]
|
|
10102
|
+
}
|
|
10103
|
+
});
|
|
10104
|
+
}
|
|
10105
|
+
this.viewer.scene.requestRender();
|
|
10106
|
+
return [2 /*return*/];
|
|
10107
|
+
}
|
|
10108
|
+
});
|
|
10109
|
+
}); })();
|
|
10110
|
+
};
|
|
10111
|
+
Manager.prototype.ReRender = function (params) {
|
|
10112
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10113
|
+
var entityIds, force;
|
|
10114
|
+
return __generator(this, function (_a) {
|
|
10115
|
+
entityIds = params.entityIds, force = params.force;
|
|
10116
|
+
return [2 /*return*/];
|
|
10117
|
+
});
|
|
10118
|
+
});
|
|
10119
|
+
};
|
|
10120
|
+
return Manager;
|
|
10121
|
+
}());
|
|
10122
|
+
TilesetGooglePhotosRenderManager.Manager = Manager;
|
|
10123
|
+
})(exports.TilesetGooglePhotosRenderManager || (exports.TilesetGooglePhotosRenderManager = {}));
|
|
10124
|
+
|
|
10125
|
+
/**
|
|
10126
|
+
* Deprecated relations render manager.
|
|
10127
|
+
* This follows original navigator logic that renders both up/downstream relationships and ALL relationship types.
|
|
10128
|
+
*/
|
|
10129
|
+
var OldRelationsRenderManager;
|
|
10130
|
+
(function (OldRelationsRenderManager) {
|
|
9777
10131
|
var Manager = /** @class */ (function () {
|
|
9778
10132
|
function Manager(params) {
|
|
9779
10133
|
// If true, this menu item is disposed and should not be used.
|
|
@@ -10074,97 +10428,8 @@
|
|
|
10074
10428
|
};
|
|
10075
10429
|
return Manager;
|
|
10076
10430
|
}());
|
|
10077
|
-
|
|
10078
|
-
})(
|
|
10079
|
-
|
|
10080
|
-
(function (TilesetGooglePhotosRenderManager) {
|
|
10081
|
-
var Manager = /** @class */ (function () {
|
|
10082
|
-
function Manager(params) {
|
|
10083
|
-
this.disposed = false;
|
|
10084
|
-
this.cTileset = null;
|
|
10085
|
-
var viewer = params.viewer, item = params.item;
|
|
10086
|
-
this.viewer = viewer;
|
|
10087
|
-
this.item = item;
|
|
10088
|
-
}
|
|
10089
|
-
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
10090
|
-
get: function () {
|
|
10091
|
-
return this.disposed;
|
|
10092
|
-
},
|
|
10093
|
-
enumerable: false,
|
|
10094
|
-
configurable: true
|
|
10095
|
-
});
|
|
10096
|
-
Object.defineProperty(Manager.prototype, "Tileset", {
|
|
10097
|
-
get: function () {
|
|
10098
|
-
return this.cTileset;
|
|
10099
|
-
},
|
|
10100
|
-
enumerable: false,
|
|
10101
|
-
configurable: true
|
|
10102
|
-
});
|
|
10103
|
-
Manager.prototype.Dispose = function () {
|
|
10104
|
-
if (this.disposed) {
|
|
10105
|
-
return;
|
|
10106
|
-
}
|
|
10107
|
-
this.doDispose();
|
|
10108
|
-
};
|
|
10109
|
-
Manager.prototype.doDispose = function () {
|
|
10110
|
-
if (this.cTileset) {
|
|
10111
|
-
var viewer = this.viewer;
|
|
10112
|
-
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
10113
|
-
this.cTileset.show = false;
|
|
10114
|
-
this.viewer.scene.primitives.remove(this.cTileset);
|
|
10115
|
-
this.viewer.scene.requestRender();
|
|
10116
|
-
}
|
|
10117
|
-
this.cTileset = null;
|
|
10118
|
-
}
|
|
10119
|
-
};
|
|
10120
|
-
Manager.prototype.Init = function () {
|
|
10121
|
-
var _this = this;
|
|
10122
|
-
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10123
|
-
var _a, colorCss;
|
|
10124
|
-
var _b, _c;
|
|
10125
|
-
return __generator(this, function (_d) {
|
|
10126
|
-
switch (_d.label) {
|
|
10127
|
-
case 0:
|
|
10128
|
-
// Using as any to be OK with older versions.
|
|
10129
|
-
_a = this;
|
|
10130
|
-
return [4 /*yield*/, ((_c = (_b = Cesium).createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(_b))];
|
|
10131
|
-
case 1:
|
|
10132
|
-
// Using as any to be OK with older versions.
|
|
10133
|
-
_a.cTileset = _d.sent();
|
|
10134
|
-
if (this.disposed) {
|
|
10135
|
-
this.doDispose();
|
|
10136
|
-
return [2 /*return*/];
|
|
10137
|
-
}
|
|
10138
|
-
this.viewer.scene.primitives.add(this.cTileset);
|
|
10139
|
-
colorCss = this.item.colorMask;
|
|
10140
|
-
if (colorCss) {
|
|
10141
|
-
this.cTileset.style = new Cesium.Cesium3DTileStyle({
|
|
10142
|
-
color: {
|
|
10143
|
-
conditions: [
|
|
10144
|
-
["true", "color(\"".concat(colorCss, "\")")]
|
|
10145
|
-
]
|
|
10146
|
-
}
|
|
10147
|
-
});
|
|
10148
|
-
}
|
|
10149
|
-
this.viewer.scene.requestRender();
|
|
10150
|
-
return [2 /*return*/];
|
|
10151
|
-
}
|
|
10152
|
-
});
|
|
10153
|
-
}); })();
|
|
10154
|
-
};
|
|
10155
|
-
Manager.prototype.ReRender = function (params) {
|
|
10156
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
10157
|
-
var entityIds, force;
|
|
10158
|
-
return __generator(this, function (_a) {
|
|
10159
|
-
entityIds = params.entityIds, force = params.force;
|
|
10160
|
-
return [2 /*return*/];
|
|
10161
|
-
});
|
|
10162
|
-
});
|
|
10163
|
-
};
|
|
10164
|
-
return Manager;
|
|
10165
|
-
}());
|
|
10166
|
-
TilesetGooglePhotosRenderManager.Manager = Manager;
|
|
10167
|
-
})(exports.TilesetGooglePhotosRenderManager || (exports.TilesetGooglePhotosRenderManager = {}));
|
|
10431
|
+
OldRelationsRenderManager.Manager = Manager;
|
|
10432
|
+
})(OldRelationsRenderManager || (OldRelationsRenderManager = {}));
|
|
10168
10433
|
|
|
10169
10434
|
(function (MenuItemManager) {
|
|
10170
10435
|
var Manager = /** @class */ (function () {
|
|
@@ -10273,12 +10538,21 @@
|
|
|
10273
10538
|
}
|
|
10274
10539
|
// This means we're updating a rendered relationships menu item.
|
|
10275
10540
|
// Eg: different entities need to be rendered, or one of the relationship data entities changed.
|
|
10541
|
+
// Deprecated: this relationships item is dead and being phased out. Use 'relationships' one instead.
|
|
10276
10542
|
else if (rItem.type == bruceModels.MenuItem.EType.Relations && params.item.Type == bruceModels.MenuItem.EType.Relations) {
|
|
10277
10543
|
rItem.renderManager.Init({
|
|
10278
10544
|
item: params.item,
|
|
10279
10545
|
});
|
|
10280
10546
|
rItem.item = params.item;
|
|
10281
10547
|
}
|
|
10548
|
+
// This means we're updating a rendered relationships menu item.
|
|
10549
|
+
// Eg: different entities need to be rendered, or one of the relationship data entities changed.
|
|
10550
|
+
else if (rItem.type == bruceModels.MenuItem.EType.Relationships && params.item.Type == bruceModels.MenuItem.EType.Relationships) {
|
|
10551
|
+
rItem.renderManager.Init({
|
|
10552
|
+
item: params.item,
|
|
10553
|
+
});
|
|
10554
|
+
rItem.item = params.item;
|
|
10555
|
+
}
|
|
10282
10556
|
}
|
|
10283
10557
|
else {
|
|
10284
10558
|
rItem = {
|
|
@@ -10379,7 +10653,17 @@
|
|
|
10379
10653
|
register: this.visualsRegister
|
|
10380
10654
|
});
|
|
10381
10655
|
break;
|
|
10656
|
+
// Deprecated to support a few demos until new one is phased in.
|
|
10657
|
+
// Use Relationships instead.
|
|
10382
10658
|
case bruceModels.MenuItem.EType.Relations:
|
|
10659
|
+
rItem.renderManager = new OldRelationsRenderManager.Manager({
|
|
10660
|
+
apiGetter: params.apiGetter,
|
|
10661
|
+
item: params.item,
|
|
10662
|
+
register: this.visualsRegister,
|
|
10663
|
+
viewer: this.viewer
|
|
10664
|
+
});
|
|
10665
|
+
break;
|
|
10666
|
+
case bruceModels.MenuItem.EType.Relationships:
|
|
10383
10667
|
rItem.renderManager = new exports.RelationsRenderManager.Manager({
|
|
10384
10668
|
apiGetter: params.apiGetter,
|
|
10385
10669
|
item: params.item,
|
|
@@ -12747,6 +13031,7 @@
|
|
|
12747
13031
|
}
|
|
12748
13032
|
/**
|
|
12749
13033
|
* Renders DATA_VERSION = 1 navigator.
|
|
13034
|
+
* param iteration
|
|
12750
13035
|
* @param params
|
|
12751
13036
|
* @param bookmark
|
|
12752
13037
|
* @param view
|
|
@@ -12870,33 +13155,32 @@
|
|
|
12870
13155
|
}
|
|
12871
13156
|
_f.label = 3;
|
|
12872
13157
|
case 3:
|
|
12873
|
-
if (
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
13158
|
+
if ((_e = bSettings === null || bSettings === void 0 ? void 0 : bSettings.drawnRelationEntityIDs) === null || _e === void 0 ? void 0 : _e.length) {
|
|
13159
|
+
menuItem = {
|
|
13160
|
+
id: RELATION_MENU_ITEM_ID,
|
|
13161
|
+
Caption: "Entity relations",
|
|
13162
|
+
BruceEntity: {
|
|
13163
|
+
EntityIds: bSettings.drawnRelationEntityIDs
|
|
13164
|
+
},
|
|
13165
|
+
Type: bruceModels.MenuItem.EType.Relations
|
|
13166
|
+
};
|
|
13167
|
+
params.manager.RenderItem({
|
|
12883
13168
|
apiGetter: params.apiGetter,
|
|
12884
13169
|
getters: params.getters,
|
|
12885
13170
|
item: menuItem
|
|
12886
|
-
})
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
return [2 /*return*/];
|
|
13171
|
+
});
|
|
13172
|
+
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13173
|
+
return [2 /*return*/];
|
|
13174
|
+
}
|
|
12891
13175
|
}
|
|
12892
|
-
|
|
12893
|
-
case 5: return [2 /*return*/];
|
|
13176
|
+
return [2 /*return*/];
|
|
12894
13177
|
}
|
|
12895
13178
|
});
|
|
12896
13179
|
});
|
|
12897
13180
|
}
|
|
12898
13181
|
/**
|
|
12899
13182
|
* Renders DATA_VERSION > 1 navigator.
|
|
13183
|
+
* @param iteration
|
|
12900
13184
|
* @param params
|
|
12901
13185
|
* @param bookmark
|
|
12902
13186
|
* @param view
|
|
@@ -12904,7 +13188,7 @@
|
|
|
12904
13188
|
function renderNavigator(iteration, params, bookmark, view) {
|
|
12905
13189
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
12906
13190
|
return __awaiter(this, void 0, void 0, function () {
|
|
12907
|
-
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery,
|
|
13191
|
+
var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, legacyRelationIds, relations, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
|
|
12908
13192
|
return __generator(this, function (_7) {
|
|
12909
13193
|
switch (_7.label) {
|
|
12910
13194
|
case 0:
|
|
@@ -13190,16 +13474,20 @@
|
|
|
13190
13474
|
tiles: imagery,
|
|
13191
13475
|
viewer: params.manager.Viewer,
|
|
13192
13476
|
});
|
|
13193
|
-
|
|
13194
|
-
if (!
|
|
13195
|
-
|
|
13477
|
+
legacyRelationIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
|
|
13478
|
+
if (!legacyRelationIds) {
|
|
13479
|
+
legacyRelationIds = [];
|
|
13480
|
+
}
|
|
13481
|
+
relations = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedRelations;
|
|
13482
|
+
if (!relations) {
|
|
13483
|
+
relations = [];
|
|
13196
13484
|
}
|
|
13197
13485
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
13198
13486
|
newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
|
|
13199
13487
|
for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
|
|
13200
13488
|
id = curEnabled_1[_i];
|
|
13201
|
-
if (newItemIds.indexOf(id) === -1 ||
|
|
13202
|
-
(id == RELATION_MENU_ITEM_ID && !
|
|
13489
|
+
if ((newItemIds.indexOf(id) === -1 && id != RELATION_MENU_ITEM_ID) ||
|
|
13490
|
+
(id == RELATION_MENU_ITEM_ID && !legacyRelationIds.length && !relations.length)) {
|
|
13203
13491
|
params.manager.RemoveItemById({
|
|
13204
13492
|
menuItemId: id
|
|
13205
13493
|
});
|
|
@@ -13219,26 +13507,24 @@
|
|
|
13219
13507
|
}
|
|
13220
13508
|
_7.label = 4;
|
|
13221
13509
|
case 4:
|
|
13222
|
-
if (
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13510
|
+
if (legacyRelationIds.length || relations.length) {
|
|
13511
|
+
menuItem = {
|
|
13512
|
+
id: RELATION_MENU_ITEM_ID,
|
|
13513
|
+
Caption: "Entity relations",
|
|
13514
|
+
BruceEntity: {
|
|
13515
|
+
EntityIds: legacyRelationIds
|
|
13516
|
+
},
|
|
13517
|
+
relations: relations,
|
|
13518
|
+
Type: bruceModels.MenuItem.EType.Relations
|
|
13519
|
+
};
|
|
13520
|
+
params.manager.RenderItem({
|
|
13232
13521
|
getters: params.getters,
|
|
13233
13522
|
item: menuItem
|
|
13234
|
-
})
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
return [2 /*return*/];
|
|
13523
|
+
});
|
|
13524
|
+
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13525
|
+
return [2 /*return*/];
|
|
13526
|
+
}
|
|
13239
13527
|
}
|
|
13240
|
-
_7.label = 6;
|
|
13241
|
-
case 6:
|
|
13242
13528
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
13243
13529
|
if (gOcclusion == null) {
|
|
13244
13530
|
gOcclusion = (_6 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _6 === void 0 ? void 0 : _6.groundOcclusion;
|
|
@@ -16150,7 +16436,7 @@
|
|
|
16150
16436
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
16151
16437
|
})(exports.ViewerUtils || (exports.ViewerUtils = {}));
|
|
16152
16438
|
|
|
16153
|
-
var VERSION$1 = "2.9.
|
|
16439
|
+
var VERSION$1 = "2.9.2";
|
|
16154
16440
|
|
|
16155
16441
|
exports.VERSION = VERSION$1;
|
|
16156
16442
|
exports.CesiumViewMonitor = CesiumViewMonitor;
|