@smarterplan/ngx-smarterplan-core 1.2.38 → 1.2.39

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.
@@ -3344,8 +3344,9 @@ class MatterportService {
3344
3344
  //might break things or fix everything ..?
3345
3345
  if (obj.obj3D.uuid != uuid) {
3346
3346
  console.log("we have THE problem");
3347
- obj.obj3D.uuid = uuid;
3347
+ obj.obj3D.uuid = uuid; //not enugh to fix the pb
3348
3348
  }
3349
+ return obj;
3349
3350
  }
3350
3351
  /**
3351
3352
  * Creates MattertagData and start repositioning (creates temporary mattertag that follows the cursor)
@@ -3857,7 +3858,7 @@ class MatterportService {
3857
3858
  // By defaut, during creation, object has translation gizmo
3858
3859
  // => User has to click on lateral panel, and save its position after playing with it!
3859
3860
  if (mode && !isNestThermostat) {
3860
- this.attachGizmoControlTo3DObject(modelNode, sceneObject, mode, true).catch((e) => console.log(e));
3861
+ this.attachGizmoControlTo3DObject(modelNode, sceneObject, mode, true, true).catch((e) => console.log(e));
3861
3862
  }
3862
3863
  if (this.lastObject3D && typeof this.lastObject3D.id === 'string') {
3863
3864
  // prompt ThreeJS UUID to match our last generated object if new (not from Db)
@@ -3996,7 +3997,7 @@ class MatterportService {
3996
3997
  this.azimuthalCrown.obj3D.position.set(this.poseCamera.position.x, this.poseCamera.position.y, this.poseCamera.position.z);
3997
3998
  }
3998
3999
  }
3999
- async attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible) {
4000
+ async attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible, isNewObject) {
4000
4001
  // Create a scene node with a transform control component.
4001
4002
  let node = null;
4002
4003
  node = sceneObject.addNode();
@@ -4016,13 +4017,21 @@ class MatterportService {
4016
4017
  // // set 'translate' mode to position the selection.
4017
4018
  myControl.inputs.mode = mode;
4018
4019
  modelNode.obj3D.controls = myControl; // store gizmoCtrl inside object
4019
- if (!this.lastObject3D || !this.lastObject3D.controls) {
4020
- try {
4021
- modelNode.obj3D.uuid = this.lastObject3D.uuid || this.lastObject3D.id;
4022
- }
4023
- catch (e) {
4024
- console.log(`id obj in Scene was not assigned to id from DB since`);
4020
+ if (isNewObject) { //i keep the current solution for new objects
4021
+ if (!this.lastObject3D || !this.lastObject3D.controls) {
4022
+ try {
4023
+ modelNode.obj3D.uuid = this.lastObject3D.uuid || this.lastObject3D.id;
4024
+ }
4025
+ catch (e) {
4026
+ console.log(`id obj in Scene was not assigned to id from DB since`);
4027
+ }
4028
+ this.lastObject3D = modelNode.obj3D;
4025
4029
  }
4030
+ }
4031
+ else { //objects already in place have to become the "lastObject" (i think?)
4032
+ console.log("in my solution !");
4033
+ console.log(modelNode);
4034
+ console.log(modelNode.obj3D.uuid);
4026
4035
  this.lastObject3D = modelNode.obj3D;
4027
4036
  }
4028
4037
  return modelNode;