bruce-cesium 1.3.1 → 1.3.3
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 +87 -41
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +86 -40
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +36 -28
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +21 -0
- package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +30 -12
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +3 -0
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +4 -2
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, Tileset, EntityCoords, EntityFilterGetter, EntitySource, EntityRelation, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Cartesian3, Entity, Primitive, Cesium3DTileFeature, Color, HeightReference, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, HeadingPitchRange, Cesium3DTileColorBlendMode, createOsmBuildings, Cesium3DTileStyle, Rectangle, KmlDataSource, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Matrix4, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance, CallbackProperty } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -1218,6 +1218,8 @@ var EntityRenderEngine;
|
|
|
1218
1218
|
else if (displayType == "polygon") {
|
|
1219
1219
|
displayType = ZoomControl.EDisplayType.Geometry;
|
|
1220
1220
|
}
|
|
1221
|
+
displayType = ZoomControl.EDisplayType.Geometry;
|
|
1222
|
+
// @ts-ignore
|
|
1221
1223
|
if (displayType != ZoomControl.EDisplayType.Hidden) {
|
|
1222
1224
|
newRenderId = getRenderGroupId(zoomItem);
|
|
1223
1225
|
existingRego = params.visualRegister.GetRego({
|
|
@@ -1229,6 +1231,7 @@ var EntityRenderEngine;
|
|
|
1229
1231
|
cEntities[id] = existingRego.visual;
|
|
1230
1232
|
}
|
|
1231
1233
|
else {
|
|
1234
|
+
// @ts-ignore
|
|
1232
1235
|
if (displayType == ZoomControl.EDisplayType.Model3D) {
|
|
1233
1236
|
models.push(entity);
|
|
1234
1237
|
}
|
|
@@ -1267,7 +1270,7 @@ var EntityRenderEngine;
|
|
|
1267
1270
|
case 2:
|
|
1268
1271
|
if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
|
|
1269
1272
|
_loop_1 = function (i) {
|
|
1270
|
-
var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints,
|
|
1273
|
+
var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
|
|
1271
1274
|
return __generator(this, function (_a) {
|
|
1272
1275
|
switch (_a.label) {
|
|
1273
1276
|
case 0:
|
|
@@ -1303,16 +1306,19 @@ var EntityRenderEngine;
|
|
|
1303
1306
|
rendered = rendered.concat(Object.values(cPoints));
|
|
1304
1307
|
rendered = rendered.filter(function (x) { return x != null; });
|
|
1305
1308
|
if (rendered.length) {
|
|
1306
|
-
|
|
1307
|
-
params.viewer.entities.add(
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
cEntities[entity.Bruce.ID] =
|
|
1309
|
+
rootEntity_1 = new Entity({});
|
|
1310
|
+
params.viewer.entities.add(rootEntity_1);
|
|
1311
|
+
rootEntity_1._siblingGraphics = [];
|
|
1312
|
+
rootEntity_1._renderGroup = getRenderGroupId(zoomItem);
|
|
1313
|
+
rootEntity_1._siblingGraphics = rootEntity_1._siblingGraphics.concat(rendered);
|
|
1314
|
+
cEntities[entity.Bruce.ID] = rootEntity_1;
|
|
1312
1315
|
firstEntity = rendered[0];
|
|
1313
1316
|
if (firstEntity) {
|
|
1314
|
-
|
|
1317
|
+
rootEntity_1.position = getValue(params.viewer, firstEntity.position.getValue);
|
|
1315
1318
|
}
|
|
1319
|
+
rendered.forEach(function (child) {
|
|
1320
|
+
child._parentEntity = rootEntity_1;
|
|
1321
|
+
});
|
|
1316
1322
|
}
|
|
1317
1323
|
else {
|
|
1318
1324
|
polygons.push(entity);
|
|
@@ -1729,7 +1735,7 @@ var EntityRenderEngine;
|
|
|
1729
1735
|
show: false
|
|
1730
1736
|
});
|
|
1731
1737
|
cEntity._siblingGraphics = [];
|
|
1732
|
-
if (width > 0 &&
|
|
1738
|
+
if (width > 0 && cLineColor) {
|
|
1733
1739
|
var cEntityBorder = new Entity({
|
|
1734
1740
|
polyline: new PolylineGraphics({
|
|
1735
1741
|
positions: posses,
|
|
@@ -1742,26 +1748,28 @@ var EntityRenderEngine;
|
|
|
1742
1748
|
}),
|
|
1743
1749
|
show: false
|
|
1744
1750
|
});
|
|
1751
|
+
params.viewer.entities.add(cEntityBorder);
|
|
1752
|
+
cEntityBorder._parentEntity = cEntity;
|
|
1745
1753
|
cEntity._siblingGraphics.push(cEntityBorder);
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1754
|
+
for (var i = 0; i < holePosses.length; i++) {
|
|
1755
|
+
var posses_1 = holePosses[i];
|
|
1756
|
+
Cartes.CloseRing3(posses_1);
|
|
1757
|
+
var cEntityHole = new Entity({
|
|
1758
|
+
polyline: new PolylineGraphics({
|
|
1759
|
+
positions: posses_1,
|
|
1760
|
+
material: cLineColor,
|
|
1761
|
+
width: width,
|
|
1762
|
+
clampToGround: heightRef == HeightReference.CLAMP_TO_GROUND,
|
|
1763
|
+
classificationType: ClassificationType.TERRAIN,
|
|
1764
|
+
arcType: ArcType.GEODESIC,
|
|
1765
|
+
zIndex: zIndex
|
|
1766
|
+
}),
|
|
1767
|
+
show: false
|
|
1768
|
+
});
|
|
1769
|
+
cEntity._siblingGraphics.push(cEntityHole);
|
|
1770
|
+
cEntityHole._parentEntity = cEntity;
|
|
1771
|
+
params.viewer.entities.add(cEntityHole);
|
|
1772
|
+
}
|
|
1765
1773
|
}
|
|
1766
1774
|
params.viewer.entities.add(cEntity);
|
|
1767
1775
|
return cEntity;
|
|
@@ -2034,6 +2042,8 @@ var EntitiesRenderManager;
|
|
|
2034
2042
|
this.entityCheckRemoval = null;
|
|
2035
2043
|
this.isRunningCheck = false;
|
|
2036
2044
|
this.viewMonitorRemoval = null;
|
|
2045
|
+
this.renderQueue = [];
|
|
2046
|
+
this.renderQueueInterval = null;
|
|
2037
2047
|
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register, sharedGetters = params.sharedGetters;
|
|
2038
2048
|
this.viewer = viewer;
|
|
2039
2049
|
this.sharedGetters = sharedGetters;
|
|
@@ -2066,6 +2076,7 @@ var EntitiesRenderManager;
|
|
|
2066
2076
|
if (!tagsToRender) {
|
|
2067
2077
|
tagsToRender = [];
|
|
2068
2078
|
}
|
|
2079
|
+
tagsToRender = [].concat(tagsToRender);
|
|
2069
2080
|
shouldRender = !isTagItem || tagsToRender.length > 0;
|
|
2070
2081
|
(_a = this.getter) === null || _a === void 0 ? void 0 : _a.ExcludeMenuItem(this.item.id);
|
|
2071
2082
|
this.getter = null;
|
|
@@ -2075,6 +2086,9 @@ var EntitiesRenderManager;
|
|
|
2075
2086
|
this.viewMonitorRemoval = null;
|
|
2076
2087
|
(_d = this.entityCheckQueue) === null || _d === void 0 ? void 0 : _d.Dispose();
|
|
2077
2088
|
this.entityCheckQueue = null;
|
|
2089
|
+
clearInterval(this.renderQueueInterval);
|
|
2090
|
+
this.renderQueueInterval = null;
|
|
2091
|
+
this.renderQueue = [];
|
|
2078
2092
|
this.visualsManager.RemoveRegos({
|
|
2079
2093
|
menuItemId: this.item.id
|
|
2080
2094
|
});
|
|
@@ -2087,15 +2101,17 @@ var EntitiesRenderManager;
|
|
|
2087
2101
|
attrFilter: (_e = this.item.BruceEntity.Filter) !== null && _e !== void 0 ? _e : {},
|
|
2088
2102
|
batchSize: 500,
|
|
2089
2103
|
typeId: this.item.BruceEntity["EntityType.ID"],
|
|
2090
|
-
monitor: this.monitor
|
|
2104
|
+
monitor: this.monitor,
|
|
2105
|
+
viewer: this.viewer,
|
|
2106
|
+
debugShowBounds: false
|
|
2091
2107
|
});
|
|
2092
2108
|
minMax = RenderManager.GetZoomMinMax({
|
|
2093
2109
|
zoomControl: this.item.CameraZoomSettings
|
|
2094
2110
|
});
|
|
2095
|
-
this.getter.IncludeMenuItem(this.item.id,
|
|
2111
|
+
this.getter.IncludeMenuItem(this.item.id, [], minMax[0], minMax[1]);
|
|
2096
2112
|
this.getterSub = this.getter.OnUpdate.Subscribe(function (entities) {
|
|
2097
2113
|
if (isTagItem) {
|
|
2098
|
-
_this.
|
|
2114
|
+
_this.distributeForRender(entities.filter(function (entity) {
|
|
2099
2115
|
var entityTags = entity.Bruce["Layer.ID"];
|
|
2100
2116
|
if (!entityTags) {
|
|
2101
2117
|
entityTags = [];
|
|
@@ -2106,7 +2122,7 @@ var EntitiesRenderManager;
|
|
|
2106
2122
|
}));
|
|
2107
2123
|
}
|
|
2108
2124
|
else {
|
|
2109
|
-
_this.
|
|
2125
|
+
_this.distributeForRender(entities);
|
|
2110
2126
|
}
|
|
2111
2127
|
});
|
|
2112
2128
|
this.viewMonitorRemoval = this.monitor.Updated().Subscribe(function () {
|
|
@@ -2135,6 +2151,8 @@ var EntitiesRenderManager;
|
|
|
2135
2151
|
});
|
|
2136
2152
|
(_b = this.entityCheckRemoval) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
2137
2153
|
(_c = this.viewMonitorRemoval) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
2154
|
+
clearInterval(this.renderQueueInterval);
|
|
2155
|
+
this.renderQueue = [];
|
|
2138
2156
|
};
|
|
2139
2157
|
Manager.prototype.ReRender = function (entityIds) {
|
|
2140
2158
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2198,7 +2216,7 @@ var EntitiesRenderManager;
|
|
|
2198
2216
|
if (this.disposed) {
|
|
2199
2217
|
return [2 /*return*/];
|
|
2200
2218
|
}
|
|
2201
|
-
this.
|
|
2219
|
+
this.distributeForRender(entities);
|
|
2202
2220
|
return [2 /*return*/];
|
|
2203
2221
|
}
|
|
2204
2222
|
});
|
|
@@ -2222,14 +2240,22 @@ var EntitiesRenderManager;
|
|
|
2222
2240
|
});
|
|
2223
2241
|
});
|
|
2224
2242
|
};
|
|
2225
|
-
Manager.prototype.
|
|
2226
|
-
var
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2243
|
+
Manager.prototype.distributeForRender = function (entities) {
|
|
2244
|
+
var _this = this;
|
|
2245
|
+
var BATCH_SIZE = 300;
|
|
2246
|
+
this.renderQueue = this.renderQueue.concat(entities);
|
|
2247
|
+
if (!this.renderQueueInterval && this.renderQueue.length) {
|
|
2248
|
+
this.renderQueueInterval = setInterval(function () {
|
|
2249
|
+
var batch = _this.renderQueue.splice(0, BATCH_SIZE);
|
|
2250
|
+
_this.renderEntities(batch);
|
|
2251
|
+
if (_this.renderQueue.length <= 0) {
|
|
2252
|
+
clearInterval(_this.renderQueueInterval);
|
|
2253
|
+
_this.renderQueueInterval = null;
|
|
2254
|
+
}
|
|
2255
|
+
}, 50);
|
|
2230
2256
|
}
|
|
2231
2257
|
};
|
|
2232
|
-
Manager.prototype.
|
|
2258
|
+
Manager.prototype.renderEntities = function (entities) {
|
|
2233
2259
|
var _a, _b, _c;
|
|
2234
2260
|
return __awaiter(this, void 0, void 0, function () {
|
|
2235
2261
|
var typeId_1, cEntities, i, entity, id, cEntity, visual, tagIds, e_2;
|
|
@@ -2274,7 +2300,7 @@ var EntitiesRenderManager;
|
|
|
2274
2300
|
priority: 0,
|
|
2275
2301
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
2276
2302
|
accountId: this.apiGetter.accountId,
|
|
2277
|
-
tagIds: tagIds ? tagIds : []
|
|
2303
|
+
tagIds: tagIds ? [].concat(tagIds) : []
|
|
2278
2304
|
}
|
|
2279
2305
|
});
|
|
2280
2306
|
}
|
|
@@ -5066,6 +5092,26 @@ var SharedGetters;
|
|
|
5066
5092
|
if (!getter) {
|
|
5067
5093
|
getter = new EntityFilterGetter.Getter(params.api, params.monitor, params.typeId, params.batchSize, params.attrFilter, true);
|
|
5068
5094
|
this.data[cacheKey] = getter;
|
|
5095
|
+
if (params.viewer && params.debugShowBounds) {
|
|
5096
|
+
getter.OnScanUpdate.Subscribe(function (cells) {
|
|
5097
|
+
cells.forEach(function (cell) {
|
|
5098
|
+
var bounds = cell.GetBounds();
|
|
5099
|
+
var id = bounds.east + "_" + bounds.north + "_" + bounds.south + "_" + bounds.west;
|
|
5100
|
+
if (params.viewer.entities.getById(id)) {
|
|
5101
|
+
return;
|
|
5102
|
+
}
|
|
5103
|
+
var rect = new Rectangle(Math$1.toRadians(bounds.west), Math$1.toRadians(bounds.south), Math$1.toRadians(bounds.east), Math$1.toRadians(bounds.north));
|
|
5104
|
+
params.viewer.entities.add(new Entity({
|
|
5105
|
+
id: id,
|
|
5106
|
+
rectangle: {
|
|
5107
|
+
coordinates: rect,
|
|
5108
|
+
fill: true,
|
|
5109
|
+
material: Color.fromRandom().withAlpha(0.3)
|
|
5110
|
+
}
|
|
5111
|
+
}));
|
|
5112
|
+
});
|
|
5113
|
+
});
|
|
5114
|
+
}
|
|
5069
5115
|
}
|
|
5070
5116
|
return getter;
|
|
5071
5117
|
};
|