@smarterplan/ngx-smarterplan-core 1.2.34 → 1.2.36

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.
@@ -3743,9 +3743,9 @@ class MatterportService {
3743
3743
  var node = sceneObject.addNode();
3744
3744
  // TODO change this 🤮
3745
3745
  node.addComponent('mp.lights');
3746
- node.addComponent('mp.lights');
3747
- node.addComponent('mp.lights');
3748
- node.addComponent('mp.lights');
3746
+ //node.addComponent('mp.lights');
3747
+ /*node.addComponent('mp.lights');
3748
+ node.addComponent('mp.lights');*/
3749
3749
  node.start();
3750
3750
  const nodeControl = sceneObject.addNode();
3751
3751
  this.objectControl = nodeControl.addComponent('mp.transformControls');
@@ -3816,6 +3816,16 @@ class MatterportService {
3816
3816
  console.log('Format not supported');
3817
3817
  break;
3818
3818
  }
3819
+ //cache system (i'll try to make it work later ...)
3820
+ /*let objContentsJSON = JSON.stringify(modelNode);
3821
+ console.log(modelNode);
3822
+ console.log(objContentsJSON);
3823
+ console.log(JSON.stringify(modelNode));
3824
+ localStorage.setItem(`testObj_${obj.object}`, objContentsJSON);
3825
+ console.log("stored ?!");
3826
+ console.log(typeof modelNode);*/
3827
+ //let dataS = serialijse.serialize(modelNode);
3828
+ //console.log(dataS);
3819
3829
  // Use 3 ?! Ambient lightings
3820
3830
  if (this.noLightForObjects) {
3821
3831
  const lightsNode = sceneObject.addNode();
@@ -3849,8 +3859,8 @@ class MatterportService {
3849
3859
  }
3850
3860
  this.lastObject3D = modelNode.obj3D;
3851
3861
  // Store this in memory Map dictionnary
3852
- console.log("Adding object: ");
3853
- console.log(modelNode);
3862
+ //console.log("Adding object: ");
3863
+ //console.log(modelNode);
3854
3864
  this.dictionnaryObjects3D.set(modelNode.obj3D.uuid, modelNode);
3855
3865
  this.dictionnarySceneObjects3D.set(modelNode.obj3D.uuid, sceneObject);
3856
3866
  /*this.sdk.Camera.pose.subscribe(
@@ -3946,6 +3956,26 @@ class MatterportService {
3946
3956
  obj.obj3D.visible = !obj.obj3D.visible;
3947
3957
  //return obj.obj3D.visible;
3948
3958
  }
3959
+ async pointCameraTo3DObject(objectId) {
3960
+ let obj = this.dictionnaryObjects3D.get(objectId);
3961
+ //We create a temporary Tag
3962
+ const poiObject = {
3963
+ coordinate: JSON.stringify(obj.obj3D.position),
3964
+ type: PoiType.OBJECT3D,
3965
+ elementID: objectId, //todo: be careful with this
3966
+ };
3967
+ const objectDb = { id: objectId };
3968
+ try {
3969
+ await this.createMattertagFromPOI(PoiType.OBJECT3D, objectDb, poiObject);
3970
+ }
3971
+ catch (err) { }
3972
+ //Not really necessary anymore since the tag will disappear quick
3973
+ //this.sdk.Tag.editOpacity(mattertagID, 0.0);//opacity);
3974
+ //this.sdk.Tag.allowAction(mattertagID, {}); //disables every action
3975
+ let result = this.getTagFromElementId(objectId);
3976
+ await this.goToTag(result.tag);
3977
+ this.deleteLastMattertag();
3978
+ }
3949
3979
  getSceneNodeFromObject3DId(uuid) {
3950
3980
  return this.dictionnarySceneObjects3D.get(uuid);
3951
3981
  }