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.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, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate,
|
|
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;
|
|
@@ -9819,6 +9819,361 @@ var TilesetArbRenderManager;
|
|
|
9819
9819
|
|
|
9820
9820
|
var RelationsRenderManager;
|
|
9821
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) {
|
|
9822
10177
|
var Manager = /** @class */ (function () {
|
|
9823
10178
|
function Manager(params) {
|
|
9824
10179
|
// If true, this menu item is disposed and should not be used.
|
|
@@ -10119,98 +10474,8 @@ var RelationsRenderManager;
|
|
|
10119
10474
|
};
|
|
10120
10475
|
return Manager;
|
|
10121
10476
|
}());
|
|
10122
|
-
|
|
10123
|
-
})(
|
|
10124
|
-
|
|
10125
|
-
var TilesetGooglePhotosRenderManager;
|
|
10126
|
-
(function (TilesetGooglePhotosRenderManager) {
|
|
10127
|
-
var Manager = /** @class */ (function () {
|
|
10128
|
-
function Manager(params) {
|
|
10129
|
-
this.disposed = false;
|
|
10130
|
-
this.cTileset = null;
|
|
10131
|
-
var viewer = params.viewer, item = params.item;
|
|
10132
|
-
this.viewer = viewer;
|
|
10133
|
-
this.item = item;
|
|
10134
|
-
}
|
|
10135
|
-
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
10136
|
-
get: function () {
|
|
10137
|
-
return this.disposed;
|
|
10138
|
-
},
|
|
10139
|
-
enumerable: false,
|
|
10140
|
-
configurable: true
|
|
10141
|
-
});
|
|
10142
|
-
Object.defineProperty(Manager.prototype, "Tileset", {
|
|
10143
|
-
get: function () {
|
|
10144
|
-
return this.cTileset;
|
|
10145
|
-
},
|
|
10146
|
-
enumerable: false,
|
|
10147
|
-
configurable: true
|
|
10148
|
-
});
|
|
10149
|
-
Manager.prototype.Dispose = function () {
|
|
10150
|
-
if (this.disposed) {
|
|
10151
|
-
return;
|
|
10152
|
-
}
|
|
10153
|
-
this.doDispose();
|
|
10154
|
-
};
|
|
10155
|
-
Manager.prototype.doDispose = function () {
|
|
10156
|
-
if (this.cTileset) {
|
|
10157
|
-
var viewer = this.viewer;
|
|
10158
|
-
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
10159
|
-
this.cTileset.show = false;
|
|
10160
|
-
this.viewer.scene.primitives.remove(this.cTileset);
|
|
10161
|
-
this.viewer.scene.requestRender();
|
|
10162
|
-
}
|
|
10163
|
-
this.cTileset = null;
|
|
10164
|
-
}
|
|
10165
|
-
};
|
|
10166
|
-
Manager.prototype.Init = function () {
|
|
10167
|
-
var _this = this;
|
|
10168
|
-
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10169
|
-
var _a, colorCss;
|
|
10170
|
-
var _b, _c;
|
|
10171
|
-
return __generator(this, function (_d) {
|
|
10172
|
-
switch (_d.label) {
|
|
10173
|
-
case 0:
|
|
10174
|
-
// Using as any to be OK with older versions.
|
|
10175
|
-
_a = this;
|
|
10176
|
-
return [4 /*yield*/, ((_c = (_b = Cesium).createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(_b))];
|
|
10177
|
-
case 1:
|
|
10178
|
-
// Using as any to be OK with older versions.
|
|
10179
|
-
_a.cTileset = _d.sent();
|
|
10180
|
-
if (this.disposed) {
|
|
10181
|
-
this.doDispose();
|
|
10182
|
-
return [2 /*return*/];
|
|
10183
|
-
}
|
|
10184
|
-
this.viewer.scene.primitives.add(this.cTileset);
|
|
10185
|
-
colorCss = this.item.colorMask;
|
|
10186
|
-
if (colorCss) {
|
|
10187
|
-
this.cTileset.style = new Cesium3DTileStyle({
|
|
10188
|
-
color: {
|
|
10189
|
-
conditions: [
|
|
10190
|
-
["true", "color(\"".concat(colorCss, "\")")]
|
|
10191
|
-
]
|
|
10192
|
-
}
|
|
10193
|
-
});
|
|
10194
|
-
}
|
|
10195
|
-
this.viewer.scene.requestRender();
|
|
10196
|
-
return [2 /*return*/];
|
|
10197
|
-
}
|
|
10198
|
-
});
|
|
10199
|
-
}); })();
|
|
10200
|
-
};
|
|
10201
|
-
Manager.prototype.ReRender = function (params) {
|
|
10202
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
10203
|
-
var entityIds, force;
|
|
10204
|
-
return __generator(this, function (_a) {
|
|
10205
|
-
entityIds = params.entityIds, force = params.force;
|
|
10206
|
-
return [2 /*return*/];
|
|
10207
|
-
});
|
|
10208
|
-
});
|
|
10209
|
-
};
|
|
10210
|
-
return Manager;
|
|
10211
|
-
}());
|
|
10212
|
-
TilesetGooglePhotosRenderManager.Manager = Manager;
|
|
10213
|
-
})(TilesetGooglePhotosRenderManager || (TilesetGooglePhotosRenderManager = {}));
|
|
10477
|
+
OldRelationsRenderManager.Manager = Manager;
|
|
10478
|
+
})(OldRelationsRenderManager || (OldRelationsRenderManager = {}));
|
|
10214
10479
|
|
|
10215
10480
|
/**
|
|
10216
10481
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
@@ -10323,12 +10588,21 @@ var MenuItemManager;
|
|
|
10323
10588
|
}
|
|
10324
10589
|
// This means we're updating a rendered relationships menu item.
|
|
10325
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.
|
|
10326
10592
|
else if (rItem.type == MenuItem.EType.Relations && params.item.Type == MenuItem.EType.Relations) {
|
|
10327
10593
|
rItem.renderManager.Init({
|
|
10328
10594
|
item: params.item,
|
|
10329
10595
|
});
|
|
10330
10596
|
rItem.item = params.item;
|
|
10331
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
|
+
}
|
|
10332
10606
|
}
|
|
10333
10607
|
else {
|
|
10334
10608
|
rItem = {
|
|
@@ -10429,7 +10703,17 @@ var MenuItemManager;
|
|
|
10429
10703
|
register: this.visualsRegister
|
|
10430
10704
|
});
|
|
10431
10705
|
break;
|
|
10706
|
+
// Deprecated to support a few demos until new one is phased in.
|
|
10707
|
+
// Use Relationships instead.
|
|
10432
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:
|
|
10433
10717
|
rItem.renderManager = new RelationsRenderManager.Manager({
|
|
10434
10718
|
apiGetter: params.apiGetter,
|
|
10435
10719
|
item: params.item,
|
|
@@ -12803,6 +13087,7 @@ function assertIteration$1(viewer, iteration) {
|
|
|
12803
13087
|
}
|
|
12804
13088
|
/**
|
|
12805
13089
|
* Renders DATA_VERSION = 1 navigator.
|
|
13090
|
+
* param iteration
|
|
12806
13091
|
* @param params
|
|
12807
13092
|
* @param bookmark
|
|
12808
13093
|
* @param view
|
|
@@ -12926,33 +13211,32 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
|
|
|
12926
13211
|
}
|
|
12927
13212
|
_f.label = 3;
|
|
12928
13213
|
case 3:
|
|
12929
|
-
if (
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
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({
|
|
12939
13224
|
apiGetter: params.apiGetter,
|
|
12940
13225
|
getters: params.getters,
|
|
12941
13226
|
item: menuItem
|
|
12942
|
-
})
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
return [2 /*return*/];
|
|
13227
|
+
});
|
|
13228
|
+
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13229
|
+
return [2 /*return*/];
|
|
13230
|
+
}
|
|
12947
13231
|
}
|
|
12948
|
-
|
|
12949
|
-
case 5: return [2 /*return*/];
|
|
13232
|
+
return [2 /*return*/];
|
|
12950
13233
|
}
|
|
12951
13234
|
});
|
|
12952
13235
|
});
|
|
12953
13236
|
}
|
|
12954
13237
|
/**
|
|
12955
13238
|
* Renders DATA_VERSION > 1 navigator.
|
|
13239
|
+
* @param iteration
|
|
12956
13240
|
* @param params
|
|
12957
13241
|
* @param bookmark
|
|
12958
13242
|
* @param view
|
|
@@ -12960,7 +13244,7 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
|
|
|
12960
13244
|
function renderNavigator(iteration, params, bookmark, view) {
|
|
12961
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;
|
|
12962
13246
|
return __awaiter(this, void 0, void 0, function () {
|
|
12963
|
-
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;
|
|
12964
13248
|
return __generator(this, function (_7) {
|
|
12965
13249
|
switch (_7.label) {
|
|
12966
13250
|
case 0:
|
|
@@ -13246,16 +13530,20 @@ function renderNavigator(iteration, params, bookmark, view) {
|
|
|
13246
13530
|
tiles: imagery,
|
|
13247
13531
|
viewer: params.manager.Viewer,
|
|
13248
13532
|
});
|
|
13249
|
-
|
|
13250
|
-
if (!
|
|
13251
|
-
|
|
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 = [];
|
|
13252
13540
|
}
|
|
13253
13541
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
13254
13542
|
newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
|
|
13255
13543
|
for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
|
|
13256
13544
|
id = curEnabled_1[_i];
|
|
13257
|
-
if (newItemIds.indexOf(id) === -1 ||
|
|
13258
|
-
(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)) {
|
|
13259
13547
|
params.manager.RemoveItemById({
|
|
13260
13548
|
menuItemId: id
|
|
13261
13549
|
});
|
|
@@ -13275,26 +13563,24 @@ function renderNavigator(iteration, params, bookmark, view) {
|
|
|
13275
13563
|
}
|
|
13276
13564
|
_7.label = 4;
|
|
13277
13565
|
case 4:
|
|
13278
|
-
if (
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
-
|
|
13282
|
-
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
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({
|
|
13288
13577
|
getters: params.getters,
|
|
13289
13578
|
item: menuItem
|
|
13290
|
-
})
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
return [2 /*return*/];
|
|
13579
|
+
});
|
|
13580
|
+
if (!assertIteration$1(params.viewer, iteration)) {
|
|
13581
|
+
return [2 /*return*/];
|
|
13582
|
+
}
|
|
13295
13583
|
}
|
|
13296
|
-
_7.label = 6;
|
|
13297
|
-
case 6:
|
|
13298
13584
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
13299
13585
|
if (gOcclusion == null) {
|
|
13300
13586
|
gOcclusion = (_6 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _6 === void 0 ? void 0 : _6.groundOcclusion;
|
|
@@ -16208,7 +16494,7 @@ var ViewerUtils;
|
|
|
16208
16494
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
16209
16495
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
16210
16496
|
|
|
16211
|
-
var VERSION$1 = "2.9.
|
|
16497
|
+
var VERSION$1 = "2.9.2";
|
|
16212
16498
|
|
|
16213
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 };
|
|
16214
16500
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|