bruce-models 0.0.3 → 0.0.5

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.
@@ -3083,72 +3083,75 @@
3083
3083
 
3084
3084
  var MAX_AREA_IN_DEGREES$1 = 90;
3085
3085
  var GETTER_DELAY = 50;
3086
- var EntityLoadedGetter = /** @class */ (function () {
3087
- function EntityLoadedGetter(entities, viewPort, batchSize) {
3088
- var _this = this;
3089
- this.viewPortRemoval = null;
3090
- this.viewRect = null;
3091
- this.viewCenter = null;
3092
- this.onUpdate = null;
3093
- this.entities = entities;
3094
- this.viewPort = viewPort;
3095
- this.batchSize = batchSize;
3096
- this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
3097
- _this.updateBounds();
3098
- _this.startGetterLoop();
3086
+ (function (BatchedDataGetter) {
3087
+ var Getter = /** @class */ (function () {
3088
+ function Getter(data, viewPort, batchSize) {
3089
+ var _this = this;
3090
+ this.viewPortRemoval = null;
3091
+ this.viewRect = null;
3092
+ this.viewCenter = null;
3093
+ this.onUpdate = null;
3094
+ this.data = data;
3095
+ this.viewPort = viewPort;
3096
+ this.batchSize = batchSize;
3097
+ this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
3098
+ _this.updateBounds();
3099
+ _this.startGetterLoop();
3100
+ });
3101
+ }
3102
+ Object.defineProperty(Getter.prototype, "OnUpdate", {
3103
+ get: function () {
3104
+ if (!this.onUpdate) {
3105
+ this.onUpdate = new BruceEvent();
3106
+ }
3107
+ return this.onUpdate;
3108
+ },
3109
+ enumerable: false,
3110
+ configurable: true
3099
3111
  });
3100
- }
3101
- Object.defineProperty(EntityLoadedGetter.prototype, "OnUpdate", {
3102
- get: function () {
3103
- if (!this.onUpdate) {
3104
- this.onUpdate = new BruceEvent();
3105
- }
3106
- return this.onUpdate;
3107
- },
3108
- enumerable: false,
3109
- configurable: true
3110
- });
3111
- EntityLoadedGetter.prototype.Dispose = function () {
3112
- var _a;
3113
- (_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
3114
- };
3115
- EntityLoadedGetter.prototype.updateBounds = function () {
3116
- var viewRect = this.viewPort.GetBounds();
3117
- var poi = this.viewPort.GetTarget();
3118
- if (viewRect && poi) {
3119
- if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES$1) {
3120
- return;
3112
+ Getter.prototype.Dispose = function () {
3113
+ var _a;
3114
+ (_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
3115
+ };
3116
+ Getter.prototype.updateBounds = function () {
3117
+ var viewRect = this.viewPort.GetBounds();
3118
+ var poi = this.viewPort.GetTarget();
3119
+ if (viewRect && poi) {
3120
+ if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES$1) {
3121
+ return;
3122
+ }
3123
+ if (Math.abs(viewRect.south - viewRect.north) > MAX_AREA_IN_DEGREES$1) {
3124
+ return;
3125
+ }
3126
+ this.viewRect = viewRect;
3127
+ this.viewCenter = poi;
3121
3128
  }
3122
- if (Math.abs(viewRect.south - viewRect.north) > MAX_AREA_IN_DEGREES$1) {
3129
+ };
3130
+ Getter.prototype.startGetterLoop = function () {
3131
+ var _this = this;
3132
+ clearInterval(this.getterInterval);
3133
+ if (!this.viewRect || !this.viewCenter) {
3123
3134
  return;
3124
3135
  }
3125
- this.viewRect = viewRect;
3126
- this.viewCenter = poi;
3127
- }
3128
- };
3129
- EntityLoadedGetter.prototype.startGetterLoop = function () {
3130
- var _this = this;
3131
- clearInterval(this.getterInterval);
3132
- if (!this.viewRect || !this.viewCenter) {
3133
- return;
3134
- }
3135
- var index = 0;
3136
- this.getterInterval = setInterval(function () {
3137
- _this.processBatch(_this.entities.slice(index, index + _this.batchSize));
3138
- index += _this.batchSize;
3139
- if (index >= _this.entities.length) {
3140
- clearInterval(_this.getterInterval);
3136
+ var index = 0;
3137
+ this.getterInterval = setInterval(function () {
3138
+ _this.processBatch(_this.data.slice(index, index + _this.batchSize));
3139
+ index += _this.batchSize;
3140
+ if (index >= _this.data.length) {
3141
+ clearInterval(_this.getterInterval);
3142
+ }
3143
+ }, GETTER_DELAY);
3144
+ };
3145
+ Getter.prototype.processBatch = function (batch) {
3146
+ var _a;
3147
+ if (batch.length > 0) {
3148
+ (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
3141
3149
  }
3142
- }, GETTER_DELAY);
3143
- };
3144
- EntityLoadedGetter.prototype.processBatch = function (batch) {
3145
- var _a;
3146
- if (batch.length > 0) {
3147
- (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
3148
- }
3149
- };
3150
- return EntityLoadedGetter;
3151
- }());
3150
+ };
3151
+ return Getter;
3152
+ }());
3153
+ BatchedDataGetter.Getter = Getter;
3154
+ })(exports.BatchedDataGetter || (exports.BatchedDataGetter = {}));
3152
3155
 
3153
3156
  (function (ClientFile) {
3154
3157
  function GetCacheKey(fileId) {
@@ -3711,20 +3714,20 @@
3711
3714
  var EType;
3712
3715
  (function (EType) {
3713
3716
  EType["None"] = "NONE";
3714
- EType["BruceEntities"] = "BruceEntity";
3715
- EType["BruceEntity"] = "SingleEntity";
3717
+ EType["Entities"] = "BruceEntity";
3718
+ EType["Entity"] = "SingleEntity";
3716
3719
  EType["Osm"] = "OSMBuildingsTileset";
3717
3720
  EType["CadTileset"] = "ModelTileset";
3718
3721
  EType["ArbTileset"] = "Cesium3DTileset";
3719
3722
  EType["Kml"] = "StaticKML";
3720
- EType["EntitiesTileset"] = "EntitiesTileset";
3721
- EType["EntitiesRaster"] = "RasterEntitiesTileset";
3723
+ EType["EntityTileset"] = "EntitiesTileset";
3724
+ EType["EntityRaster"] = "RasterEntitiesTileset";
3722
3725
  EType["PointCloud"] = "PointCloudTileset";
3723
3726
  })(EType = MenuItem.EType || (MenuItem.EType = {}));
3724
3727
  function CreateFromEntityId(entityId, typeId, styleId) {
3725
3728
  return {
3726
3729
  id: exports.ObjectUtils.UId(),
3727
- Type: EType.BruceEntity,
3730
+ Type: EType.Entity,
3728
3731
  Caption: "Generated Entity Menu Item",
3729
3732
  BruceEntity: {
3730
3733
  "EntityType.ID": typeId,
@@ -3744,7 +3747,7 @@
3744
3747
  function CreateFromTypeId(typeId, styleId) {
3745
3748
  return {
3746
3749
  id: exports.ObjectUtils.UId(),
3747
- Type: EType.BruceEntities,
3750
+ Type: EType.Entities,
3748
3751
  Caption: "Generated Entity Type Menu Item",
3749
3752
  BruceEntity: {
3750
3753
  "EntityType.ID": typeId
@@ -3775,7 +3778,7 @@
3775
3778
  else if (type == exports.Tileset.EType.EntitiesSet) {
3776
3779
  return {
3777
3780
  id: exports.ObjectUtils.UId(),
3778
- Type: EType.EntitiesTileset,
3781
+ Type: EType.EntityTileset,
3779
3782
  Caption: "Generated Entities Menu Item",
3780
3783
  FlyTo: false,
3781
3784
  tileset: {
@@ -3797,7 +3800,7 @@
3797
3800
  else if (type == exports.Tileset.EType.EntitiesMap) {
3798
3801
  return {
3799
3802
  id: exports.ObjectUtils.UId(),
3800
- Type: EType.EntitiesRaster,
3803
+ Type: EType.EntityRaster,
3801
3804
  Caption: "Generated Entities Menu Item",
3802
3805
  tileset: {
3803
3806
  TilesetID: tilesetId
@@ -4751,7 +4754,6 @@
4751
4754
  exports.BruceEvent = BruceEvent;
4752
4755
  exports.CacheControl = CacheControl;
4753
4756
  exports.DelayQueue = DelayQueue;
4754
- exports.EntityLoadedGetter = EntityLoadedGetter;
4755
4757
 
4756
4758
  Object.defineProperty(exports, '__esModule', { value: true });
4757
4759