bruce-cesium 2.9.0 → 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 +426 -134
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +424 -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/entities/entities-loaded-render-manager.js +6 -0
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-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.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic,
|
|
3
|
+
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, SceneMode, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, Cesium3DTileColorBlendMode, KmlDataSource, OrthographicFrustum, EasingFunction, SceneTransforms, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, defined, Cesium3DTileset, Model, CesiumInspector, PolygonPipeline, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Matrix4, Matrix3, IonResource, Ion, ColorMaterialProperty, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere } from 'cesium';
|
|
4
4
|
|
|
5
5
|
var TIME_LAG = 300;
|
|
6
6
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -6834,6 +6834,12 @@ var EntitiesLoadedRenderManager;
|
|
|
6834
6834
|
})];
|
|
6835
6835
|
case 1:
|
|
6836
6836
|
cEntities = _b.sent();
|
|
6837
|
+
if (this.disposed) {
|
|
6838
|
+
this.visualsManager.RemoveRegos({
|
|
6839
|
+
menuItemId: this.item.id
|
|
6840
|
+
});
|
|
6841
|
+
return [2 /*return*/];
|
|
6842
|
+
}
|
|
6837
6843
|
for (i = 0; i < entities.length; i++) {
|
|
6838
6844
|
entity = entities[i];
|
|
6839
6845
|
id = entity.Bruce.ID;
|
|
@@ -9813,6 +9819,361 @@ var TilesetArbRenderManager;
|
|
|
9813
9819
|
|
|
9814
9820
|
var RelationsRenderManager;
|
|
9815
9821
|
(function (RelationsRenderManager) {
|
|
9822
|
+
var Manager = /** @class */ (function () {
|
|
9823
|
+
function Manager(params) {
|
|
9824
|
+
// If true, this menu item is disposed and should not be used.
|
|
9825
|
+
// Any rendering will be ignored.
|
|
9826
|
+
this.disposed = false;
|
|
9827
|
+
var apiGetter = params.apiGetter, item = params.item, register = params.register, viewer = params.viewer;
|
|
9828
|
+
this.apiGetter = apiGetter;
|
|
9829
|
+
this.item = item;
|
|
9830
|
+
this.register = register;
|
|
9831
|
+
this.viewer = viewer;
|
|
9832
|
+
}
|
|
9833
|
+
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
9834
|
+
get: function () {
|
|
9835
|
+
return this.disposed;
|
|
9836
|
+
},
|
|
9837
|
+
enumerable: false,
|
|
9838
|
+
configurable: true
|
|
9839
|
+
});
|
|
9840
|
+
/**
|
|
9841
|
+
* Starts rendering the menu item.
|
|
9842
|
+
* Re-call with an updated menu item to re-render. It will auto-cleanup old relations.
|
|
9843
|
+
* @param params
|
|
9844
|
+
* @returns
|
|
9845
|
+
*/
|
|
9846
|
+
Manager.prototype.Init = function (params) {
|
|
9847
|
+
if (this.disposed) {
|
|
9848
|
+
return;
|
|
9849
|
+
}
|
|
9850
|
+
if (params === null || params === void 0 ? void 0 : params.item) {
|
|
9851
|
+
this.item = params.item;
|
|
9852
|
+
}
|
|
9853
|
+
// Remove relationships we no longer want to render.
|
|
9854
|
+
// We'll have to get regos by the menu item ID then run a check on the related rego relationship.
|
|
9855
|
+
var regos = this.register.GetRegos({
|
|
9856
|
+
menuItemId: this.item.id
|
|
9857
|
+
});
|
|
9858
|
+
for (var i = 0; i < regos.length; i++) {
|
|
9859
|
+
var rego = regos[i];
|
|
9860
|
+
if (!this.shouldRenderRelation(rego.relation)) {
|
|
9861
|
+
this.register.RemoveRegos({
|
|
9862
|
+
relation: rego.relation,
|
|
9863
|
+
entityId: rego.entityId,
|
|
9864
|
+
menuItemId: this.item.id,
|
|
9865
|
+
requestRender: false
|
|
9866
|
+
});
|
|
9867
|
+
}
|
|
9868
|
+
}
|
|
9869
|
+
this.viewer.scene.requestRender();
|
|
9870
|
+
this.queueRenderRelations({
|
|
9871
|
+
relations: this.item.relations
|
|
9872
|
+
});
|
|
9873
|
+
};
|
|
9874
|
+
Manager.prototype.Dispose = function () {
|
|
9875
|
+
if (this.disposed) {
|
|
9876
|
+
return;
|
|
9877
|
+
}
|
|
9878
|
+
this.disposed = true;
|
|
9879
|
+
this.register.RemoveRegos({
|
|
9880
|
+
menuItemId: this.item.id
|
|
9881
|
+
});
|
|
9882
|
+
};
|
|
9883
|
+
/**
|
|
9884
|
+
* Re-renders specific entity relationships.
|
|
9885
|
+
* @param params
|
|
9886
|
+
*/
|
|
9887
|
+
Manager.prototype.ReRender = function (params) {
|
|
9888
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9889
|
+
var entityIds, force;
|
|
9890
|
+
return __generator(this, function (_a) {
|
|
9891
|
+
entityIds = params.entityIds, force = params.force;
|
|
9892
|
+
return [2 /*return*/];
|
|
9893
|
+
});
|
|
9894
|
+
});
|
|
9895
|
+
};
|
|
9896
|
+
Manager.prototype.queueRenderRelations = function (params) {
|
|
9897
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9898
|
+
var relations, allIds_1, _i, relations_1, relation, entityIds, toRender, i, entityId, data, j, relation, e_1;
|
|
9899
|
+
return __generator(this, function (_a) {
|
|
9900
|
+
switch (_a.label) {
|
|
9901
|
+
case 0:
|
|
9902
|
+
_a.trys.push([0, 5, , 6]);
|
|
9903
|
+
relations = params.relations;
|
|
9904
|
+
allIds_1 = [];
|
|
9905
|
+
for (_i = 0, relations_1 = relations; _i < relations_1.length; _i++) {
|
|
9906
|
+
relation = relations_1[_i];
|
|
9907
|
+
entityIds = relation.entityIds;
|
|
9908
|
+
allIds_1.push.apply(allIds_1, entityIds);
|
|
9909
|
+
}
|
|
9910
|
+
allIds_1 = allIds_1.filter(function (id, index) {
|
|
9911
|
+
return allIds_1.indexOf(id) === index;
|
|
9912
|
+
});
|
|
9913
|
+
toRender = [];
|
|
9914
|
+
i = 0;
|
|
9915
|
+
_a.label = 1;
|
|
9916
|
+
case 1:
|
|
9917
|
+
if (!(i < allIds_1.length)) return [3 /*break*/, 4];
|
|
9918
|
+
entityId = allIds_1[i];
|
|
9919
|
+
return [4 /*yield*/, EntityRelation.GetList({
|
|
9920
|
+
entityId: entityId,
|
|
9921
|
+
filter: {
|
|
9922
|
+
oneWayOnly: true,
|
|
9923
|
+
loadEntityData: false
|
|
9924
|
+
},
|
|
9925
|
+
api: this.apiGetter.getApi()
|
|
9926
|
+
})];
|
|
9927
|
+
case 2:
|
|
9928
|
+
data = _a.sent();
|
|
9929
|
+
console.log("get relations", data);
|
|
9930
|
+
for (j = 0; j < data.relations.length; j++) {
|
|
9931
|
+
relation = data.relations[j];
|
|
9932
|
+
if (this.shouldRenderRelation(relation)) {
|
|
9933
|
+
toRender.push(relation);
|
|
9934
|
+
}
|
|
9935
|
+
}
|
|
9936
|
+
_a.label = 3;
|
|
9937
|
+
case 3:
|
|
9938
|
+
i++;
|
|
9939
|
+
return [3 /*break*/, 1];
|
|
9940
|
+
case 4:
|
|
9941
|
+
console.log("all render", toRender);
|
|
9942
|
+
// Relations are not being returned??
|
|
9943
|
+
// const data = await Entity.GetListByIds({
|
|
9944
|
+
// entityIds: allIds,
|
|
9945
|
+
// expandRelations: true,
|
|
9946
|
+
// api: this.apiGetter.getApi()
|
|
9947
|
+
// });
|
|
9948
|
+
// for (let i = 0; i < data.entities.length; i++) {
|
|
9949
|
+
// const entity = data.entities[i];
|
|
9950
|
+
// if (entity?.Bruce?.relations?.length) {
|
|
9951
|
+
// const eRelations = entity.Bruce.relations;
|
|
9952
|
+
// for (let j = 0; j < eRelations.length; j++) {
|
|
9953
|
+
// const eRelation = eRelations[j];
|
|
9954
|
+
// const relation: EntityRelation.IRelation = {
|
|
9955
|
+
// "Principal.Entity.ID": entity.Bruce.ID,
|
|
9956
|
+
// "Related.Entity.ID": eRelation["Other.Entity.ID"],
|
|
9957
|
+
// "Relation.Type.ID": eRelation["Relation.Type.ID"]
|
|
9958
|
+
// };
|
|
9959
|
+
// if (this.shouldRenderRelation(relation)) {
|
|
9960
|
+
// toRender.push(relation);
|
|
9961
|
+
// }
|
|
9962
|
+
// }
|
|
9963
|
+
// }
|
|
9964
|
+
// }
|
|
9965
|
+
if (toRender.length) {
|
|
9966
|
+
this.onGetterUpdate(toRender);
|
|
9967
|
+
}
|
|
9968
|
+
return [3 /*break*/, 6];
|
|
9969
|
+
case 5:
|
|
9970
|
+
e_1 = _a.sent();
|
|
9971
|
+
console.error(e_1);
|
|
9972
|
+
return [3 /*break*/, 6];
|
|
9973
|
+
case 6: return [2 /*return*/];
|
|
9974
|
+
}
|
|
9975
|
+
});
|
|
9976
|
+
});
|
|
9977
|
+
};
|
|
9978
|
+
Manager.prototype.shouldRenderRelation = function (relation) {
|
|
9979
|
+
var _a, _b;
|
|
9980
|
+
var typeId = relation === null || relation === void 0 ? void 0 : relation["Relation.Type.ID"];
|
|
9981
|
+
if (!typeId || !((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.relations) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
9982
|
+
return false;
|
|
9983
|
+
}
|
|
9984
|
+
var group = this.item.relations.find(function (x) { return x.relationTypeId == typeId; });
|
|
9985
|
+
if (!(group === null || group === void 0 ? void 0 : group.entityIds)) {
|
|
9986
|
+
return false;
|
|
9987
|
+
}
|
|
9988
|
+
return group.entityIds.includes(relation["Principal.Entity.ID"]);
|
|
9989
|
+
};
|
|
9990
|
+
/**
|
|
9991
|
+
* Renders batch of entity relationships.
|
|
9992
|
+
* This will check if a relationship SHOULD be rendered before rendering it.
|
|
9993
|
+
* It will also handle already rendered relations to avoid re-rendering them.
|
|
9994
|
+
* @param relations
|
|
9995
|
+
*/
|
|
9996
|
+
Manager.prototype.onGetterUpdate = function (relations) {
|
|
9997
|
+
var _a, _b;
|
|
9998
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9999
|
+
var killCEntity, cEntities, key, i, relation, key, cEntity, visual, e_2;
|
|
10000
|
+
var _this = this;
|
|
10001
|
+
return __generator(this, function (_c) {
|
|
10002
|
+
switch (_c.label) {
|
|
10003
|
+
case 0:
|
|
10004
|
+
_c.trys.push([0, 2, , 3]);
|
|
10005
|
+
if (this.disposed || this.viewer.isDestroyed()) {
|
|
10006
|
+
return [2 /*return*/];
|
|
10007
|
+
}
|
|
10008
|
+
relations = relations.filter(function (x) { return _this.shouldRenderRelation(x); });
|
|
10009
|
+
killCEntity = function (cEntity) {
|
|
10010
|
+
if (cEntity && !_this.viewer.isDestroyed() && _this.viewer.entities.contains(cEntity)) {
|
|
10011
|
+
_this.viewer.entities.remove(cEntity);
|
|
10012
|
+
}
|
|
10013
|
+
};
|
|
10014
|
+
return [4 /*yield*/, RelationRenderEngine.Render({
|
|
10015
|
+
apiGetter: this.apiGetter,
|
|
10016
|
+
menuItemId: this.item.id,
|
|
10017
|
+
relations: relations,
|
|
10018
|
+
viewer: this.viewer,
|
|
10019
|
+
visualRegister: this.register
|
|
10020
|
+
})];
|
|
10021
|
+
case 1:
|
|
10022
|
+
cEntities = _c.sent();
|
|
10023
|
+
if (this.disposed) {
|
|
10024
|
+
this.register.RemoveRegos({
|
|
10025
|
+
menuItemId: this.item.id
|
|
10026
|
+
});
|
|
10027
|
+
for (key in cEntities) {
|
|
10028
|
+
killCEntity(cEntities[key]);
|
|
10029
|
+
}
|
|
10030
|
+
return [2 /*return*/];
|
|
10031
|
+
}
|
|
10032
|
+
for (i = 0; i < relations.length; i++) {
|
|
10033
|
+
relation = relations[i];
|
|
10034
|
+
key = RelationRenderEngine.GetRenderGroupId(relation);
|
|
10035
|
+
cEntity = cEntities[key];
|
|
10036
|
+
if (cEntity && this.shouldRenderRelation(relation)) {
|
|
10037
|
+
visual = (_a = this.register.GetRego({
|
|
10038
|
+
relation: relation,
|
|
10039
|
+
menuItemId: this.item.id
|
|
10040
|
+
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
10041
|
+
if (!visual || visual != cEntity) {
|
|
10042
|
+
this.register.AddRego({
|
|
10043
|
+
rego: {
|
|
10044
|
+
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
10045
|
+
menuItemId: this.item.id,
|
|
10046
|
+
relation: relation,
|
|
10047
|
+
visual: cEntity,
|
|
10048
|
+
priority: 0,
|
|
10049
|
+
accountId: this.apiGetter.accountId
|
|
10050
|
+
},
|
|
10051
|
+
requestRender: false
|
|
10052
|
+
});
|
|
10053
|
+
}
|
|
10054
|
+
}
|
|
10055
|
+
else {
|
|
10056
|
+
this.register.RemoveRegos({
|
|
10057
|
+
entityId: relation["Data.Entity.ID"],
|
|
10058
|
+
relation: relation,
|
|
10059
|
+
menuItemId: this.item.id,
|
|
10060
|
+
requestRender: false
|
|
10061
|
+
});
|
|
10062
|
+
killCEntity(cEntity);
|
|
10063
|
+
}
|
|
10064
|
+
}
|
|
10065
|
+
this.viewer.scene.requestRender();
|
|
10066
|
+
return [3 /*break*/, 3];
|
|
10067
|
+
case 2:
|
|
10068
|
+
e_2 = _c.sent();
|
|
10069
|
+
console.error(e_2);
|
|
10070
|
+
return [3 /*break*/, 3];
|
|
10071
|
+
case 3: return [2 /*return*/];
|
|
10072
|
+
}
|
|
10073
|
+
});
|
|
10074
|
+
});
|
|
10075
|
+
};
|
|
10076
|
+
return Manager;
|
|
10077
|
+
}());
|
|
10078
|
+
RelationsRenderManager.Manager = Manager;
|
|
10079
|
+
})(RelationsRenderManager || (RelationsRenderManager = {}));
|
|
10080
|
+
|
|
10081
|
+
var TilesetGooglePhotosRenderManager;
|
|
10082
|
+
(function (TilesetGooglePhotosRenderManager) {
|
|
10083
|
+
var Manager = /** @class */ (function () {
|
|
10084
|
+
function Manager(params) {
|
|
10085
|
+
this.disposed = false;
|
|
10086
|
+
this.cTileset = null;
|
|
10087
|
+
var viewer = params.viewer, item = params.item;
|
|
10088
|
+
this.viewer = viewer;
|
|
10089
|
+
this.item = item;
|
|
10090
|
+
}
|
|
10091
|
+
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
10092
|
+
get: function () {
|
|
10093
|
+
return this.disposed;
|
|
10094
|
+
},
|
|
10095
|
+
enumerable: false,
|
|
10096
|
+
configurable: true
|
|
10097
|
+
});
|
|
10098
|
+
Object.defineProperty(Manager.prototype, "Tileset", {
|
|
10099
|
+
get: function () {
|
|
10100
|
+
return this.cTileset;
|
|
10101
|
+
},
|
|
10102
|
+
enumerable: false,
|
|
10103
|
+
configurable: true
|
|
10104
|
+
});
|
|
10105
|
+
Manager.prototype.Dispose = function () {
|
|
10106
|
+
if (this.disposed) {
|
|
10107
|
+
return;
|
|
10108
|
+
}
|
|
10109
|
+
this.doDispose();
|
|
10110
|
+
};
|
|
10111
|
+
Manager.prototype.doDispose = function () {
|
|
10112
|
+
if (this.cTileset) {
|
|
10113
|
+
var viewer = this.viewer;
|
|
10114
|
+
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
10115
|
+
this.cTileset.show = false;
|
|
10116
|
+
this.viewer.scene.primitives.remove(this.cTileset);
|
|
10117
|
+
this.viewer.scene.requestRender();
|
|
10118
|
+
}
|
|
10119
|
+
this.cTileset = null;
|
|
10120
|
+
}
|
|
10121
|
+
};
|
|
10122
|
+
Manager.prototype.Init = function () {
|
|
10123
|
+
var _this = this;
|
|
10124
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10125
|
+
var _a, colorCss;
|
|
10126
|
+
var _b, _c;
|
|
10127
|
+
return __generator(this, function (_d) {
|
|
10128
|
+
switch (_d.label) {
|
|
10129
|
+
case 0:
|
|
10130
|
+
// Using as any to be OK with older versions.
|
|
10131
|
+
_a = this;
|
|
10132
|
+
return [4 /*yield*/, ((_c = (_b = Cesium).createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(_b))];
|
|
10133
|
+
case 1:
|
|
10134
|
+
// Using as any to be OK with older versions.
|
|
10135
|
+
_a.cTileset = _d.sent();
|
|
10136
|
+
if (this.disposed) {
|
|
10137
|
+
this.doDispose();
|
|
10138
|
+
return [2 /*return*/];
|
|
10139
|
+
}
|
|
10140
|
+
this.viewer.scene.primitives.add(this.cTileset);
|
|
10141
|
+
colorCss = this.item.colorMask;
|
|
10142
|
+
if (colorCss) {
|
|
10143
|
+
this.cTileset.style = new Cesium3DTileStyle({
|
|
10144
|
+
color: {
|
|
10145
|
+
conditions: [
|
|
10146
|
+
["true", "color(\"".concat(colorCss, "\")")]
|
|
10147
|
+
]
|
|
10148
|
+
}
|
|
10149
|
+
});
|
|
10150
|
+
}
|
|
10151
|
+
this.viewer.scene.requestRender();
|
|
10152
|
+
return [2 /*return*/];
|
|
10153
|
+
}
|
|
10154
|
+
});
|
|
10155
|
+
}); })();
|
|
10156
|
+
};
|
|
10157
|
+
Manager.prototype.ReRender = function (params) {
|
|
10158
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10159
|
+
var entityIds, force;
|
|
10160
|
+
return __generator(this, function (_a) {
|
|
10161
|
+
entityIds = params.entityIds, force = params.force;
|
|
10162
|
+
return [2 /*return*/];
|
|
10163
|
+
});
|
|
10164
|
+
});
|
|
10165
|
+
};
|
|
10166
|
+
return Manager;
|
|
10167
|
+
}());
|
|
10168
|
+
TilesetGooglePhotosRenderManager.Manager = Manager;
|
|
10169
|
+
})(TilesetGooglePhotosRenderManager || (TilesetGooglePhotosRenderManager = {}));
|
|
10170
|
+
|
|
10171
|
+
/**
|
|
10172
|
+
* Deprecated relations render manager.
|
|
10173
|
+
* This follows original navigator logic that renders both up/downstream relationships and ALL relationship types.
|
|
10174
|
+
*/
|
|
10175
|
+
var OldRelationsRenderManager;
|
|
10176
|
+
(function (OldRelationsRenderManager) {
|
|
9816
10177
|
var Manager = /** @class */ (function () {
|
|
9817
10178
|
function Manager(params) {
|
|
9818
10179
|
// If true, this menu item is disposed and should not be used.
|
|
@@ -10113,98 +10474,8 @@ var RelationsRenderManager;
|
|
|
10113
10474
|
};
|
|
10114
10475
|
return Manager;
|
|
10115
10476
|
}());
|
|
10116
|
-
|
|
10117
|
-
})(
|
|
10118
|
-
|
|
10119
|
-
var TilesetGooglePhotosRenderManager;
|
|
10120
|
-
(function (TilesetGooglePhotosRenderManager) {
|
|
10121
|
-
var Manager = /** @class */ (function () {
|
|
10122
|
-
function Manager(params) {
|
|
10123
|
-
this.disposed = false;
|
|
10124
|
-
this.cTileset = null;
|
|
10125
|
-
var viewer = params.viewer, item = params.item;
|
|
10126
|
-
this.viewer = viewer;
|
|
10127
|
-
this.item = item;
|
|
10128
|
-
}
|
|
10129
|
-
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
10130
|
-
get: function () {
|
|
10131
|
-
return this.disposed;
|
|
10132
|
-
},
|
|
10133
|
-
enumerable: false,
|
|
10134
|
-
configurable: true
|
|
10135
|
-
});
|
|
10136
|
-
Object.defineProperty(Manager.prototype, "Tileset", {
|
|
10137
|
-
get: function () {
|
|
10138
|
-
return this.cTileset;
|
|
10139
|
-
},
|
|
10140
|
-
enumerable: false,
|
|
10141
|
-
configurable: true
|
|
10142
|
-
});
|
|
10143
|
-
Manager.prototype.Dispose = function () {
|
|
10144
|
-
if (this.disposed) {
|
|
10145
|
-
return;
|
|
10146
|
-
}
|
|
10147
|
-
this.doDispose();
|
|
10148
|
-
};
|
|
10149
|
-
Manager.prototype.doDispose = function () {
|
|
10150
|
-
if (this.cTileset) {
|
|
10151
|
-
var viewer = this.viewer;
|
|
10152
|
-
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
10153
|
-
this.cTileset.show = false;
|
|
10154
|
-
this.viewer.scene.primitives.remove(this.cTileset);
|
|
10155
|
-
this.viewer.scene.requestRender();
|
|
10156
|
-
}
|
|
10157
|
-
this.cTileset = null;
|
|
10158
|
-
}
|
|
10159
|
-
};
|
|
10160
|
-
Manager.prototype.Init = function () {
|
|
10161
|
-
var _this = this;
|
|
10162
|
-
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10163
|
-
var _a, colorCss;
|
|
10164
|
-
var _b, _c;
|
|
10165
|
-
return __generator(this, function (_d) {
|
|
10166
|
-
switch (_d.label) {
|
|
10167
|
-
case 0:
|
|
10168
|
-
// Using as any to be OK with older versions.
|
|
10169
|
-
_a = this;
|
|
10170
|
-
return [4 /*yield*/, ((_c = (_b = Cesium).createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(_b))];
|
|
10171
|
-
case 1:
|
|
10172
|
-
// Using as any to be OK with older versions.
|
|
10173
|
-
_a.cTileset = _d.sent();
|
|
10174
|
-
if (this.disposed) {
|
|
10175
|
-
this.doDispose();
|
|
10176
|
-
return [2 /*return*/];
|
|
10177
|
-
}
|
|
10178
|
-
this.viewer.scene.primitives.add(this.cTileset);
|
|
10179
|
-
colorCss = this.item.colorMask;
|
|
10180
|
-
if (colorCss) {
|
|
10181
|
-
this.cTileset.style = new Cesium3DTileStyle({
|
|
10182
|
-
color: {
|
|
10183
|
-
conditions: [
|
|
10184
|
-
["true", "color(\"".concat(colorCss, "\")")]
|
|
10185
|
-
]
|
|
10186
|
-
}
|
|
10187
|
-
});
|
|
10188
|
-
}
|
|
10189
|
-
this.viewer.scene.requestRender();
|
|
10190
|
-
return [2 /*return*/];
|
|
10191
|
-
}
|
|
10192
|
-
});
|
|
10193
|
-
}); })();
|
|
10194
|
-
};
|
|
10195
|
-
Manager.prototype.ReRender = function (params) {
|
|
10196
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
10197
|
-
var entityIds, force;
|
|
10198
|
-
return __generator(this, function (_a) {
|
|
10199
|
-
entityIds = params.entityIds, force = params.force;
|
|
10200
|
-
return [2 /*return*/];
|
|
10201
|
-
});
|
|
10202
|
-
});
|
|
10203
|
-
};
|
|
10204
|
-
return Manager;
|
|
10205
|
-
}());
|
|
10206
|
-
TilesetGooglePhotosRenderManager.Manager = Manager;
|
|
10207
|
-
})(TilesetGooglePhotosRenderManager || (TilesetGooglePhotosRenderManager = {}));
|
|
10477
|
+
OldRelationsRenderManager.Manager = Manager;
|
|
10478
|
+
})(OldRelationsRenderManager || (OldRelationsRenderManager = {}));
|
|
10208
10479
|
|
|
10209
10480
|
/**
|
|
10210
10481
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
@@ -10317,12 +10588,21 @@ var MenuItemManager;
|
|
|
10317
10588
|
}
|
|
10318
10589
|
// This means we're updating a rendered relationships menu item.
|
|
10319
10590
|
// Eg: different entities need to be rendered, or one of the relationship data entities changed.
|
|
10591
|
+
// Deprecated: this relationships item is dead and being phased out. Use 'relationships' one instead.
|
|
10320
10592
|
else if (rItem.type == MenuItem.EType.Relations && params.item.Type == MenuItem.EType.Relations) {
|
|
10321
10593
|
rItem.renderManager.Init({
|
|
10322
10594
|
item: params.item,
|
|
10323
10595
|
});
|
|
10324
10596
|
rItem.item = params.item;
|
|
10325
10597
|
}
|
|
10598
|
+
// This means we're updating a rendered relationships menu item.
|
|
10599
|
+
// Eg: different entities need to be rendered, or one of the relationship data entities changed.
|
|
10600
|
+
else if (rItem.type == MenuItem.EType.Relationships && params.item.Type == MenuItem.EType.Relationships) {
|
|
10601
|
+
rItem.renderManager.Init({
|
|
10602
|
+
item: params.item,
|
|
10603
|
+
});
|
|
10604
|
+
rItem.item = params.item;
|
|
10605
|
+
}
|
|
10326
10606
|
}
|
|
10327
10607
|
else {
|
|
10328
10608
|
rItem = {
|
|
@@ -10423,7 +10703,17 @@ var MenuItemManager;
|
|
|
10423
10703
|
register: this.visualsRegister
|
|
10424
10704
|
});
|
|
10425
10705
|
break;
|
|
10706
|
+
// Deprecated to support a few demos until new one is phased in.
|
|
10707
|
+
// Use Relationships instead.
|
|
10426
10708
|
case MenuItem.EType.Relations:
|
|
10709
|
+
rItem.renderManager = new OldRelationsRenderManager.Manager({
|
|
10710
|
+
apiGetter: params.apiGetter,
|
|
10711
|
+
item: params.item,
|
|
10712
|
+
register: this.visualsRegister,
|
|
10713
|
+
viewer: this.viewer
|
|
10714
|
+
});
|
|
10715
|
+
break;
|
|
10716
|
+
case MenuItem.EType.Relationships:
|
|
10427
10717
|
rItem.renderManager = new RelationsRenderManager.Manager({
|
|
10428
10718
|
apiGetter: params.apiGetter,
|
|
10429
10719
|
item: params.item,
|
|
@@ -12797,6 +13087,7 @@ function assertIteration$1(viewer, iteration) {
|
|
|
12797
13087
|
}
|
|
12798
13088
|
/**
|
|
12799
13089
|
* Renders DATA_VERSION = 1 navigator.
|
|
13090
|
+
* param iteration
|
|
12800
13091
|
* @param params
|
|
12801
13092
|
* @param bookmark
|
|
12802
13093
|
* @param view
|
|
@@ -12920,33 +13211,32 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
|
|
|
12920
13211
|
}
|
|
12921
13212
|
_f.label = 3;
|
|
12922
13213
|
case 3:
|
|
12923
|
-
if (
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
13214
|
+
if ((_e = bSettings === null || bSettings === void 0 ? void 0 : bSettings.drawnRelationEntityIDs) === null || _e === void 0 ? void 0 : _e.length) {
|
|
13215
|
+
menuItem = {
|
|
13216
|
+
id: RELATION_MENU_ITEM_ID,
|
|
13217
|
+
Caption: "Entity relations",
|
|
13218
|
+
BruceEntity: {
|
|
13219
|
+
EntityIds: bSettings.drawnRelationEntityIDs
|
|
13220
|
+
},
|
|
13221
|
+
Type: MenuItem.EType.Relations
|
|
13222
|
+
};
|
|
13223
|
+
params.manager.RenderItem({
|
|
12933
13224
|
apiGetter: params.apiGetter,
|
|
12934
13225
|
getters: params.getters,
|
|
12935
13226
|
item: menuItem
|
|
12936
|
-
})
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
return [2 /*return*/];
|
|
13227
|
+
});
|
|
13228
|
+
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13229
|
+
return [2 /*return*/];
|
|
13230
|
+
}
|
|
12941
13231
|
}
|
|
12942
|
-
|
|
12943
|
-
case 5: return [2 /*return*/];
|
|
13232
|
+
return [2 /*return*/];
|
|
12944
13233
|
}
|
|
12945
13234
|
});
|
|
12946
13235
|
});
|
|
12947
13236
|
}
|
|
12948
13237
|
/**
|
|
12949
13238
|
* Renders DATA_VERSION > 1 navigator.
|
|
13239
|
+
* @param iteration
|
|
12950
13240
|
* @param params
|
|
12951
13241
|
* @param bookmark
|
|
12952
13242
|
* @param view
|
|
@@ -12954,7 +13244,7 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
|
|
|
12954
13244
|
function renderNavigator(iteration, params, bookmark, view) {
|
|
12955
13245
|
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;
|
|
12956
13246
|
return __awaiter(this, void 0, void 0, function () {
|
|
12957
|
-
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,
|
|
13247
|
+
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;
|
|
12958
13248
|
return __generator(this, function (_7) {
|
|
12959
13249
|
switch (_7.label) {
|
|
12960
13250
|
case 0:
|
|
@@ -13240,16 +13530,20 @@ function renderNavigator(iteration, params, bookmark, view) {
|
|
|
13240
13530
|
tiles: imagery,
|
|
13241
13531
|
viewer: params.manager.Viewer,
|
|
13242
13532
|
});
|
|
13243
|
-
|
|
13244
|
-
if (!
|
|
13245
|
-
|
|
13533
|
+
legacyRelationIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
|
|
13534
|
+
if (!legacyRelationIds) {
|
|
13535
|
+
legacyRelationIds = [];
|
|
13536
|
+
}
|
|
13537
|
+
relations = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedRelations;
|
|
13538
|
+
if (!relations) {
|
|
13539
|
+
relations = [];
|
|
13246
13540
|
}
|
|
13247
13541
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
13248
13542
|
newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
|
|
13249
13543
|
for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
|
|
13250
13544
|
id = curEnabled_1[_i];
|
|
13251
|
-
if (newItemIds.indexOf(id) === -1 ||
|
|
13252
|
-
(id == RELATION_MENU_ITEM_ID && !
|
|
13545
|
+
if ((newItemIds.indexOf(id) === -1 && id != RELATION_MENU_ITEM_ID) ||
|
|
13546
|
+
(id == RELATION_MENU_ITEM_ID && !legacyRelationIds.length && !relations.length)) {
|
|
13253
13547
|
params.manager.RemoveItemById({
|
|
13254
13548
|
menuItemId: id
|
|
13255
13549
|
});
|
|
@@ -13269,26 +13563,24 @@ function renderNavigator(iteration, params, bookmark, view) {
|
|
|
13269
13563
|
}
|
|
13270
13564
|
_7.label = 4;
|
|
13271
13565
|
case 4:
|
|
13272
|
-
if (
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
-
|
|
13566
|
+
if (legacyRelationIds.length || relations.length) {
|
|
13567
|
+
menuItem = {
|
|
13568
|
+
id: RELATION_MENU_ITEM_ID,
|
|
13569
|
+
Caption: "Entity relations",
|
|
13570
|
+
BruceEntity: {
|
|
13571
|
+
EntityIds: legacyRelationIds
|
|
13572
|
+
},
|
|
13573
|
+
relations: relations,
|
|
13574
|
+
Type: MenuItem.EType.Relations
|
|
13575
|
+
};
|
|
13576
|
+
params.manager.RenderItem({
|
|
13282
13577
|
getters: params.getters,
|
|
13283
13578
|
item: menuItem
|
|
13284
|
-
})
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
return [2 /*return*/];
|
|
13579
|
+
});
|
|
13580
|
+
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13581
|
+
return [2 /*return*/];
|
|
13582
|
+
}
|
|
13289
13583
|
}
|
|
13290
|
-
_7.label = 6;
|
|
13291
|
-
case 6:
|
|
13292
13584
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
13293
13585
|
if (gOcclusion == null) {
|
|
13294
13586
|
gOcclusion = (_6 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _6 === void 0 ? void 0 : _6.groundOcclusion;
|
|
@@ -16202,7 +16494,7 @@ var ViewerUtils;
|
|
|
16202
16494
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
16203
16495
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
16204
16496
|
|
|
16205
|
-
var VERSION$1 = "2.9.
|
|
16497
|
+
var VERSION$1 = "2.9.2";
|
|
16206
16498
|
|
|
16207
16499
|
export { VERSION$1 as VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
|
|
16208
16500
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|