@thatopen/components 3.2.2 → 3.2.4

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/index.mjs CHANGED
@@ -3309,6 +3309,10 @@ const _FragmentsManager = class _FragmentsManager extends Component {
3309
3309
  const model = this.list.get(modelId);
3310
3310
  if (!model)
3311
3311
  continue;
3312
+ if (localIds.size === 0) {
3313
+ result[modelId] = [];
3314
+ continue;
3315
+ }
3312
3316
  const data = await model.getItemsData([...localIds], config);
3313
3317
  result[modelId] = data;
3314
3318
  }
@@ -3480,6 +3484,10 @@ const _IfcLoader = class _IfcLoader extends Component {
3480
3484
  * An event triggered when the IFC file starts loading.
3481
3485
  */
3482
3486
  __publicField(this, "onIfcStartedLoading", new Event());
3487
+ /**
3488
+ * An event triggered when the IFC importer is initialized.
3489
+ */
3490
+ __publicField(this, "onIfcImporterInitialized", new Event());
3483
3491
  /**
3484
3492
  * An event triggered when the setup process is completed.
3485
3493
  */
@@ -3557,6 +3565,7 @@ const _IfcLoader = class _IfcLoader extends Component {
3557
3565
  serializer.wasm.path = this.settings.wasm.path;
3558
3566
  serializer.wasm.absolute = this.settings.wasm.absolute;
3559
3567
  serializer.webIfcSettings = this.settings.webIfc;
3568
+ this.onIfcImporterInitialized.trigger(serializer);
3560
3569
  if (config == null ? void 0 : config.instanceCallback)
3561
3570
  config.instanceCallback(serializer);
3562
3571
  const bytes = await serializer.process({
@@ -5101,6 +5110,11 @@ class SimpleScene extends BaseScene {
5101
5110
  configs.list.delete(this.config.uuid);
5102
5111
  }
5103
5112
  }
5113
+ var RendererMode = /* @__PURE__ */ ((RendererMode2) => {
5114
+ RendererMode2[RendererMode2["MANUAL"] = 0] = "MANUAL";
5115
+ RendererMode2[RendererMode2["AUTO"] = 1] = "AUTO";
5116
+ return RendererMode2;
5117
+ })(RendererMode || {});
5104
5118
  class SimpleRenderer extends BaseRenderer {
5105
5119
  /**
5106
5120
  * Constructor for the SimpleRenderer class.
@@ -5124,6 +5138,14 @@ class SimpleRenderer extends BaseRenderer {
5124
5138
  * The THREE.js WebGLRenderer instance.
5125
5139
  */
5126
5140
  __publicField(this, "three");
5141
+ /**
5142
+ * The mode of the renderer. If MANUAL, the renderer will be updated manually. If AUTO, the renderer will render on every update tick.
5143
+ */
5144
+ __publicField(this, "mode", 1);
5145
+ /**
5146
+ * Whether the renderer needs to be updated. If true, the renderer will be updated on the next frame.
5147
+ */
5148
+ __publicField(this, "needsUpdate", false);
5127
5149
  __publicField(this, "_canvas");
5128
5150
  __publicField(this, "_parameters");
5129
5151
  __publicField(this, "_resizeObserver", null);
@@ -5180,6 +5202,10 @@ class SimpleRenderer extends BaseRenderer {
5180
5202
  update() {
5181
5203
  if (!this.enabled || !this.currentWorld)
5182
5204
  return;
5205
+ if (this.mode === 0 && !this.needsUpdate) {
5206
+ return;
5207
+ }
5208
+ this.needsUpdate = false;
5183
5209
  this.onBeforeUpdate.trigger(this);
5184
5210
  const scene = this.currentWorld.scene.three;
5185
5211
  const camera = this.currentWorld.camera.three;
@@ -21563,6 +21589,7 @@ export {
21563
21589
  PlanMode,
21564
21590
  ProjectionManager,
21565
21591
  Raycasters,
21592
+ RendererMode,
21566
21593
  ShadowedScene,
21567
21594
  SimpleCamera,
21568
21595
  SimpleGrid,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thatopen/components",
3
3
  "description": "Collection of core functionalities to author BIM apps.",
4
- "version": "3.2.2",
4
+ "version": "3.2.4",
5
5
  "author": "That Open Company",
6
6
  "contributors": [
7
7
  "Antonio Gonzalez Viegas (https://github.com/agviegas)",