@colijnit/homedecorator 255.1.2 → 255.1.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/app/core/model/homedecorator-settings-options.d.ts +1 -0
- package/app/core/service/homedecorator-connector-adapter.service.d.ts +2 -2
- package/app/core/service/homedecorator-connector.service.d.ts +2 -2
- package/app/core/service/utils.service.d.ts +1 -0
- package/app/plugins/core3d/components/ar-gui/ar-gui-root/ar-gui-elements/ar-gui-buttons/ar-gui-buttons.component.scss +2 -4
- package/app/plugins/core3d/items/floor-plane-item.d.ts +8 -1
- package/app/plugins/core3d/items/metadata.d.ts +2 -0
- package/app/plugins/core3d/service/ar.service.d.ts +1 -0
- package/app/plugins/core3d/service/floor-pattern.service.d.ts +26 -0
- package/app/plugins/core3d/service/floor-tile-intersection.service.d.ts +25 -0
- package/app/plugins/core3d/service/outline.service.d.ts +1 -2
- package/app/plugins/core3d/service/post-processing.service.d.ts +6 -0
- package/app/plugins/core3d/service/scene.service.d.ts +4 -1
- package/app/plugins/core3d/service/ssr.service.d.ts +19 -0
- package/app/plugins/model-uploader/model-previewer/model-preview.component.d.ts +40 -3
- package/app/plugins/render/service/new-render.service.d.ts +1 -0
- package/app/plugins/threedselector/threedselector/service/build-furniture.service.d.ts +10 -1
- package/app/plugins/threedselector/threedselector/threedselector.component.d.ts +1 -0
- package/app/plugins/toolbar/toolbar.module.d.ts +2 -1
- package/app/shared/pdf-export/pdf-export.component.d.ts +20 -0
- package/app/shared/pdf-export/pdf-export.component.scss +19 -0
- package/app/shared/pdf-export/pdf-export.module.d.ts +11 -0
- package/assets/icons/xmark_regular.svg +1 -0
- package/bundles/colijnit-homedecorator.umd.js +1406 -295
- package/bundles/colijnit-homedecorator.umd.js.map +1 -1
- package/esm2015/app/app.version.js +4 -4
- package/esm2015/app/core/model/homedecorator-settings-options.js +2 -1
- package/esm2015/app/core/model/light-preset.js +11 -7
- package/esm2015/app/core/service/homedecorator-connector-adapter.service.js +6 -8
- package/esm2015/app/core/service/homedecorator-connector.service.js +7 -5
- package/esm2015/app/core/service/utils.service.js +16 -1
- package/esm2015/app/plugins/core3d/components/ar-gui/ar-gui-root/ar-gui-elements/ar-gui-buttons/ar-gui-buttons.component.js +2 -2
- package/esm2015/app/plugins/core3d/components/scene-options/scene-options.component.js +63 -3
- package/esm2015/app/plugins/core3d/items/floor-plane-item.js +25 -2
- package/esm2015/app/plugins/core3d/items/metadata.js +1 -1
- package/esm2015/app/plugins/core3d/service/ar.service.js +14 -1
- package/esm2015/app/plugins/core3d/service/floor-pattern.service.js +156 -0
- package/esm2015/app/plugins/core3d/service/floor-tile-intersection.service.js +122 -0
- package/esm2015/app/plugins/core3d/service/floor.service.js +5 -2
- package/esm2015/app/plugins/core3d/service/outline.service.js +9 -8
- package/esm2015/app/plugins/core3d/service/post-processing.service.js +77 -22
- package/esm2015/app/plugins/core3d/service/scene.service.js +30 -13
- package/esm2015/app/plugins/core3d/service/ssr.service.js +104 -0
- package/esm2015/app/plugins/lite-selector/lite-selector/component/selections-summary/selections-summary.component.js +3 -3
- package/esm2015/app/plugins/model-uploader/model-previewer/model-preview.component.js +339 -79
- package/esm2015/app/plugins/model-uploader/model-uploader/model-uploader.component.js +3 -2
- package/esm2015/app/plugins/product-catalog/product-catalog/product-catalog.component.js +3 -2
- package/esm2015/app/plugins/render/service/new-render.service.js +37 -13
- package/esm2015/app/plugins/room-planner/room-planner/room-planner.component.js +2 -2
- package/esm2015/app/plugins/threedselector/threedselector/service/build-furniture.service.js +135 -5
- package/esm2015/app/plugins/threedselector/threedselector/threedselector.component.js +35 -9
- package/esm2015/app/plugins/toolbar/toolbar/toolbar.component.js +9 -25
- package/esm2015/app/plugins/toolbar/toolbar.module.js +8 -4
- package/esm2015/app/shared/pdf-export/pdf-export.component.js +86 -0
- package/esm2015/app/shared/pdf-export/pdf-export.module.js +38 -0
- package/fesm2015/colijnit-homedecorator.js +1385 -295
- package/fesm2015/colijnit-homedecorator.js.map +1 -1
- package/package.json +3 -3
|
@@ -31,7 +31,7 @@ import { HttpHeaders } from '@angular/common/http';
|
|
|
31
31
|
import axios from 'axios';
|
|
32
32
|
import * as applyPatch from 'textdiff-patch';
|
|
33
33
|
import * as THREE from 'three';
|
|
34
|
-
import { Vector2, Material as Material$1, Object3D, Mesh, Vector3, Scene, EventDispatcher, PerspectiveCamera, Box3, PlaneGeometry, MeshBasicMaterial, DoubleSide, MeshStandardMaterial, CylinderGeometry, RingGeometry, Matrix4, Raycaster, PointLight, Euler, BoxGeometry, WebGLRenderTarget, NearestFilter, RGBAFormat, SRGBColorSpace, AxesHelper, Group, BufferGeometry, Line, DataTexture, LuminanceAlphaFormat, UnsignedByteType, LinearFilter, Shape, SphereGeometry, PCFSoftShadowMap, ShadowMaterial, LightProbe, Texture as Texture$1, DirectionalLight, MeshPhongMaterial, Color, WebGLRenderer, NoToneMapping, TextureLoader, EllipseCurve, ArcCurve, BufferAttribute, MeshPhysicalMaterial, Quaternion, Path, ShapeGeometry, BasicShadowMap, PCFShadowMap, VSMShadowMap, LinearSRGBColorSpace, Float32BufferAttribute, LineBasicMaterial, EquirectangularReflectionMapping, FrontSide, AdditiveBlending, LineSegments, EdgesGeometry, CircleGeometry, MathUtils, ObjectLoader, Light, Camera as Camera$1, RepeatWrapping, UVMapping, CubeReflectionMapping, CubeRefractionMapping, EquirectangularRefractionMapping, CubeUVReflectionMapping, NearestMipmapNearestFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipMapLinearFilter, LinearMipmapNearestFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipMapLinearFilter, AlphaFormat, LuminanceFormat,
|
|
34
|
+
import { Vector2, Material as Material$1, Object3D, Mesh, Vector3, Scene, EventDispatcher, PerspectiveCamera, Box3, PlaneGeometry, MeshBasicMaterial, DoubleSide, MeshStandardMaterial, CylinderGeometry, RingGeometry, Matrix4, Raycaster, PointLight, Euler, BoxGeometry, WebGLRenderTarget, NearestFilter, RGBAFormat, SRGBColorSpace, AxesHelper, Group, BufferGeometry, Line, DataTexture, LuminanceAlphaFormat, UnsignedByteType, LinearFilter, Shape, SphereGeometry, PCFSoftShadowMap, ShadowMaterial, LightProbe, Texture as Texture$1, DirectionalLight, MeshPhongMaterial, DepthTexture, UnsignedIntType, DepthFormat, Color, OrthographicCamera, WebGLRenderer, NoToneMapping, TextureLoader, EllipseCurve, ArcCurve, BufferAttribute, MeshPhysicalMaterial, Quaternion, Path, ShapeGeometry, BasicShadowMap, PCFShadowMap, VSMShadowMap, LinearSRGBColorSpace, Float32BufferAttribute, LineBasicMaterial, EquirectangularReflectionMapping, FrontSide, AdditiveBlending, LineSegments, EdgesGeometry, CircleGeometry, MathUtils, ObjectLoader, Light, Camera as Camera$1, RepeatWrapping, InstancedMesh, UVMapping, CubeReflectionMapping, CubeRefractionMapping, EquirectangularRefractionMapping, CubeUVReflectionMapping, NearestMipmapNearestFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipMapLinearFilter, LinearMipmapNearestFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipMapLinearFilter, AlphaFormat, LuminanceFormat, DepthStencilFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, ByteType, ShortType, UnsignedShortType, IntType, FloatType, HalfFloatType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedInt248Type, ClampToEdgeWrapping, MirroredRepeatWrapping, ZeroFactor, OneFactor, SrcColorFactor, OneMinusSrcColorFactor, SrcAlphaFactor, OneMinusSrcAlphaFactor, DstAlphaFactor, OneMinusDstAlphaFactor, DstColorFactor, OneMinusDstColorFactor, AddEquation, SubtractEquation, ReverseSubtractEquation, MinEquation, MaxEquation, NoBlending, NormalBlending, SubtractiveBlending, MultiplyBlending, CustomBlending, TangentSpaceNormalMap, ObjectSpaceNormalMap, BackSide, ZeroStencilOp, KeepStencilOp, ReplaceStencilOp, IncrementStencilOp, DecrementStencilOp, IncrementWrapStencilOp, DecrementWrapStencilOp, InvertStencilOp, NeverStencilFunc, LessStencilFunc, EqualStencilFunc, LessEqualStencilFunc, GreaterStencilFunc, NotEqualStencilFunc, GreaterEqualStencilFunc, AlwaysStencilFunc, Source, SpotLight, AmbientLight, HemisphereLight, SpotLightHelper, DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, CanvasTexture, Clock, AnimationMixer, AnimationClip, NoColorSpace, ArrowHelper, GridHelper, PMREMGenerator, BoxHelper } from 'three';
|
|
35
35
|
import * as TWEEN from '@tweenjs/tween.js';
|
|
36
36
|
import * as PolygonTools from 'polygon-tools';
|
|
37
37
|
import { WebGLPathTracer } from 'three-gpu-pathtracer';
|
|
@@ -45,11 +45,11 @@ import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer
|
|
|
45
45
|
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass';
|
|
46
46
|
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
|
|
47
47
|
import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader';
|
|
48
|
-
import {
|
|
48
|
+
import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass';
|
|
49
49
|
import * as md5 from 'md5';
|
|
50
50
|
import GUI from 'three/examples/jsm/libs/lil-gui.module.min';
|
|
51
51
|
import { N8AOPass } from 'n8ao';
|
|
52
|
-
import {
|
|
52
|
+
import { TAARenderPass } from 'three/examples/jsm/postprocessing/TAARenderPass';
|
|
53
53
|
import * as i1 from '@angular/platform-browser';
|
|
54
54
|
import * as i2$1 from 'ngx-device-detector';
|
|
55
55
|
import * as i5$1 from '@angular/material/icon';
|
|
@@ -86,6 +86,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|
|
86
86
|
import * as i8 from '@angular/forms';
|
|
87
87
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
88
88
|
import * as BufferGeometryUtils$1 from 'three/examples/jsm/utils/BufferGeometryUtils';
|
|
89
|
+
import { MeshBVH } from 'three-mesh-bvh';
|
|
89
90
|
import { LinearSRGBColorSpace as LinearSRGBColorSpace$1, SrcAlphaSaturateFactor, LinearFilter as LinearFilter$1, LinearToneMapping, FloatType as FloatType$1 } from 'three/src/constants';
|
|
90
91
|
import * as i4 from '@colijnit/corecomponents';
|
|
91
92
|
import { IconModule, CardModule, SlideoutModule, SummaryLineModule, PriceDisplayPipeModule, ButtonModule, HtmlHeaderModule, InputTextModule, InputTextChipsModule } from '@colijnit/corecomponents';
|
|
@@ -138,7 +139,8 @@ import html2canvas from 'html2canvas';
|
|
|
138
139
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
|
139
140
|
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
|
|
140
141
|
import { TDSLoader } from 'three/examples/jsm/loaders/TDSLoader';
|
|
141
|
-
import
|
|
142
|
+
import { STLLoader } from 'three/examples/jsm/loaders/STLLoader';
|
|
143
|
+
import * as i9$1 from '@angular/material/radio';
|
|
142
144
|
import { MatRadioModule } from '@angular/material/radio';
|
|
143
145
|
import * as i19$1 from '@angular/material/toolbar';
|
|
144
146
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
@@ -157,6 +159,8 @@ import * as i1$5 from 'ngx-lightbox';
|
|
|
157
159
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
158
160
|
import * as i10$2 from '@angular/cdk/drag-drop';
|
|
159
161
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
162
|
+
import { jsPDF } from 'jspdf';
|
|
163
|
+
import autoTable from 'jspdf-autotable';
|
|
160
164
|
|
|
161
165
|
var MessageType;
|
|
162
166
|
(function (MessageType) {
|
|
@@ -340,7 +344,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
340
344
|
}]
|
|
341
345
|
}] });
|
|
342
346
|
|
|
343
|
-
var __awaiter$
|
|
347
|
+
var __awaiter$1n = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
344
348
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
345
349
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
346
350
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -391,7 +395,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
391
395
|
}
|
|
392
396
|
}
|
|
393
397
|
initConnector(options, externalSource, forceReload, externalSourceId) {
|
|
394
|
-
return __awaiter$
|
|
398
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
395
399
|
if (externalSource === undefined || externalSource === null) {
|
|
396
400
|
const renewConnector = (this._connector ? this._connector.url !== options.url : false) || forceReload;
|
|
397
401
|
if (!this._connector || renewConnector) {
|
|
@@ -449,7 +453,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
449
453
|
});
|
|
450
454
|
}
|
|
451
455
|
logOut() {
|
|
452
|
-
return __awaiter$
|
|
456
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
453
457
|
yield this.connector.logOut();
|
|
454
458
|
});
|
|
455
459
|
}
|
|
@@ -477,7 +481,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
477
481
|
return 2;
|
|
478
482
|
}
|
|
479
483
|
getWebViewStartupInfo(request) {
|
|
480
|
-
return __awaiter$
|
|
484
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
481
485
|
// @ts-ignore
|
|
482
486
|
const response = yield this.articleApi.getWebviewStartupInfo(request);
|
|
483
487
|
if (response && response.validationResult && response.validationResult.success) {
|
|
@@ -489,7 +493,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
489
493
|
});
|
|
490
494
|
}
|
|
491
495
|
getGoodIdFromArticleNr(sku) {
|
|
492
|
-
return __awaiter$
|
|
496
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
493
497
|
const response = yield this.articleApi.getGoodIdFromArticleNr(sku);
|
|
494
498
|
if (response && response.validationResult && response.validationResult.success) {
|
|
495
499
|
return response.resultObject;
|
|
@@ -509,7 +513,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
509
513
|
return this.connector.copyInstance(instanceId, shouldSaveCurrentInstanceId);
|
|
510
514
|
}
|
|
511
515
|
saveConfigurations() {
|
|
512
|
-
return __awaiter$
|
|
516
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
513
517
|
yield this.connector.saveConfigurations().catch((e) => {
|
|
514
518
|
return false;
|
|
515
519
|
});
|
|
@@ -527,7 +531,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
527
531
|
}
|
|
528
532
|
// @returns The initial article
|
|
529
533
|
getArticle(sku, branch) {
|
|
530
|
-
return __awaiter$
|
|
534
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
531
535
|
const goodId = yield this.getGoodIdFromArticleNr(sku);
|
|
532
536
|
if (goodId) {
|
|
533
537
|
return this.getArticleQuickSel(goodId, branch);
|
|
@@ -536,7 +540,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
536
540
|
});
|
|
537
541
|
}
|
|
538
542
|
getArticleQuickSel(goodId, branch) {
|
|
539
|
-
return __awaiter$
|
|
543
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
540
544
|
const response = yield this.articleApi.getArticleQuickSel(goodId, branch);
|
|
541
545
|
if (response && response.validationResult && response.validationResult.success) {
|
|
542
546
|
return this._boFactory.makeWithRawBackendData(Article, response.resultObject.oArticle[0]);
|
|
@@ -554,7 +558,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
554
558
|
return this.connector.getQuestionAndAnswers();
|
|
555
559
|
}
|
|
556
560
|
getSelectionsAsync() {
|
|
557
|
-
return __awaiter$
|
|
561
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
558
562
|
const response = yield this.connector.getSelections();
|
|
559
563
|
if (response && response.validationResult && response.validationResult.success) {
|
|
560
564
|
return this._boFactory.makeBOArrayFromRawBackendDataArray(Selection, response.resultObjects);
|
|
@@ -563,7 +567,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
563
567
|
});
|
|
564
568
|
}
|
|
565
569
|
getDecosAsync() {
|
|
566
|
-
return __awaiter$
|
|
570
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
567
571
|
const response = yield this.connector.getDecos();
|
|
568
572
|
if (response && response.validationResult && response.validationResult.success) {
|
|
569
573
|
return this._boFactory.makeBOArrayFromRawBackendDataArray(DecoNode, response.resultObjects);
|
|
@@ -572,7 +576,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
572
576
|
});
|
|
573
577
|
}
|
|
574
578
|
getAnswerPrices() {
|
|
575
|
-
return __awaiter$
|
|
579
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
576
580
|
const response = yield this.connector.getAnswersPrices();
|
|
577
581
|
if (response && response.validationResult && response.validationResult.success) {
|
|
578
582
|
return this._boFactory.makeBOArrayFromRawBackendDataArray(AnswerPrice, response.resultObjects);
|
|
@@ -580,14 +584,14 @@ class HomedecoratorConnectorAdapterService {
|
|
|
580
584
|
return [];
|
|
581
585
|
});
|
|
582
586
|
}
|
|
583
|
-
getJsonConfiguredArticles(goodId, goodType, quantity, showLoader = true, instanceId, configuratorStatistics) {
|
|
584
|
-
return this.articleApi.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics);
|
|
587
|
+
getJsonConfiguredArticles(goodId, goodType, quantity, externalSource = false, showLoader = true, instanceId, configuratorStatistics) {
|
|
588
|
+
return this.articleApi.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics);
|
|
585
589
|
}
|
|
586
590
|
// public getJsonMatchTableArticles(): Promise<void> {
|
|
587
591
|
// return this.connector.getJsonMatchTableArticles();
|
|
588
592
|
// }
|
|
589
593
|
setInstanceToConfigure(id) {
|
|
590
|
-
return __awaiter$
|
|
594
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
591
595
|
if (id !== null) {
|
|
592
596
|
return this.connector.setInstanceToConfigure(id);
|
|
593
597
|
}
|
|
@@ -597,7 +601,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
597
601
|
});
|
|
598
602
|
}
|
|
599
603
|
selectAnswer(answer, userInput) {
|
|
600
|
-
return __awaiter$
|
|
604
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
601
605
|
return this.connector.selectAnswer(answer, false, userInput);
|
|
602
606
|
});
|
|
603
607
|
}
|
|
@@ -614,7 +618,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
614
618
|
return this.connector.replaceSelection(selection);
|
|
615
619
|
}
|
|
616
620
|
getImageForAnswerOrSelection(answerOrSelection, publication, thumbNail = true, showLoader = true) {
|
|
617
|
-
return __awaiter$
|
|
621
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
618
622
|
const response = yield this.articleApi.getSingleImage(answerOrSelection.nodeId, publication, true, thumbNail);
|
|
619
623
|
if (response && response.validationResult && response.validationResult.success && response.resultObject) {
|
|
620
624
|
if (response.resultObject.filePath !== null && response.resultObject.filePath !== undefined && response.resultObject.filePath !== '') {
|
|
@@ -630,7 +634,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
630
634
|
});
|
|
631
635
|
}
|
|
632
636
|
getSkipButtonImageAndText(goodId) {
|
|
633
|
-
return __awaiter$
|
|
637
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
634
638
|
const response = yield this.connector.getSkipButtonImageAndText(goodId, false);
|
|
635
639
|
if (response && response.validationResult && response.validationResult.success) {
|
|
636
640
|
return this._boFactory.makeWithRawBackendData(SkipButtonInfo, response.resultObject);
|
|
@@ -642,7 +646,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
642
646
|
return this.getImageForAnswerOrSelection(answerOrSelection, 32);
|
|
643
647
|
}
|
|
644
648
|
getAnswerInfo(answer) {
|
|
645
|
-
return __awaiter$
|
|
649
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
646
650
|
const response = yield this.connector.getAnswerTexts(answer.nodeId, false);
|
|
647
651
|
if (response && response.validationResult && response.validationResult.success) {
|
|
648
652
|
return this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleText, response.resultObject);
|
|
@@ -651,7 +655,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
651
655
|
});
|
|
652
656
|
}
|
|
653
657
|
getInternalParameter(parameter) {
|
|
654
|
-
return __awaiter$
|
|
658
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
655
659
|
const response = yield this.mainApi.getInternalParameterValue(parameter);
|
|
656
660
|
if (response && response.validationResult && response.validationResult.success) {
|
|
657
661
|
return response.resultObject;
|
|
@@ -662,10 +666,8 @@ class HomedecoratorConnectorAdapterService {
|
|
|
662
666
|
});
|
|
663
667
|
}
|
|
664
668
|
store3DModelCDN(filename, fileContents) {
|
|
665
|
-
return __awaiter$
|
|
666
|
-
|
|
667
|
-
const int8Array = new Int8Array(fileContents);
|
|
668
|
-
const response = yield this.mainApi.uploadModelToCDN(filename, int8Array);
|
|
669
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
670
|
+
const response = yield this.mainApi.uploadModelToCDN(filename, fileContents);
|
|
669
671
|
if (response && response.validationResult && response.validationResult.success) {
|
|
670
672
|
return response.resultObject;
|
|
671
673
|
}
|
|
@@ -675,8 +677,8 @@ class HomedecoratorConnectorAdapterService {
|
|
|
675
677
|
});
|
|
676
678
|
}
|
|
677
679
|
getCatalogDefinitionsList() {
|
|
678
|
-
return __awaiter$
|
|
679
|
-
const response = yield this.
|
|
680
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
681
|
+
const response = yield this.articleApi.getCatalogDefinitions().catch(e => {
|
|
680
682
|
return new DataServiceResponseData();
|
|
681
683
|
});
|
|
682
684
|
if (response && response.validationResult && response.validationResult.success) {
|
|
@@ -688,11 +690,11 @@ class HomedecoratorConnectorAdapterService {
|
|
|
688
690
|
});
|
|
689
691
|
}
|
|
690
692
|
getExternalSource(externalSourceId) {
|
|
691
|
-
return __awaiter$
|
|
693
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
692
694
|
if (!externalSourceId) {
|
|
693
695
|
return null;
|
|
694
696
|
}
|
|
695
|
-
const response = yield this.
|
|
697
|
+
const response = yield this.articleApi.getExternalSource(externalSourceId);
|
|
696
698
|
if (response && response.validationResult && response.validationResult.success) {
|
|
697
699
|
if (response.resultObject) {
|
|
698
700
|
return this._boFactory.makeWithRawBackendData(ExternalSource, response.resultObject);
|
|
@@ -707,7 +709,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
707
709
|
});
|
|
708
710
|
}
|
|
709
711
|
getArticleFullObject(goodId) {
|
|
710
|
-
return __awaiter$
|
|
712
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
711
713
|
const result = yield this.articleApi.getArticleFullObject(goodId);
|
|
712
714
|
if (result.validationResult && result.validationResult.success) {
|
|
713
715
|
return this._boFactory.makeWithRawBackendData(ArticleFullObject, result.resultObject);
|
|
@@ -718,7 +720,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
718
720
|
});
|
|
719
721
|
}
|
|
720
722
|
getArticleCategories(publicationCode) {
|
|
721
|
-
return __awaiter$
|
|
723
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
722
724
|
const result = yield this.articleApi.getArticleCategories(publicationCode);
|
|
723
725
|
if (result.validationResult && result.validationResult.success) {
|
|
724
726
|
return this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleCategory, result.resultObjects);
|
|
@@ -730,7 +732,7 @@ class HomedecoratorConnectorAdapterService {
|
|
|
730
732
|
}
|
|
731
733
|
//
|
|
732
734
|
getArticleFlat(sku) {
|
|
733
|
-
return __awaiter$
|
|
735
|
+
return __awaiter$1n(this, void 0, void 0, function* () {
|
|
734
736
|
const result = yield this.articleApi.getArticleFlat(sku);
|
|
735
737
|
if (result.validationResult && result.validationResult.success) {
|
|
736
738
|
return this._boFactory.makeWithRawBackendData(ArticleFlat, result.resultObject);
|
|
@@ -771,7 +773,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
771
773
|
}]
|
|
772
774
|
}], ctorParameters: function () { return [{ type: HomedecoratorAppEventService }]; } });
|
|
773
775
|
|
|
774
|
-
var __awaiter$
|
|
776
|
+
var __awaiter$1m = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
775
777
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
776
778
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
777
779
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -782,8 +784,8 @@ var __awaiter$1l = (this && this.__awaiter) || function (thisArg, _arguments, P,
|
|
|
782
784
|
};
|
|
783
785
|
class JsonUtilsService {
|
|
784
786
|
readJsonFile(filePath, includeBaseUrl = true) {
|
|
785
|
-
return __awaiter$
|
|
786
|
-
return new Promise((resolve, reject) => __awaiter$
|
|
787
|
+
return __awaiter$1m(this, void 0, void 0, function* () {
|
|
788
|
+
return new Promise((resolve, reject) => __awaiter$1m(this, void 0, void 0, function* () {
|
|
787
789
|
try {
|
|
788
790
|
filePath = includeBaseUrl ? this._includeBaseUrl(filePath) : filePath;
|
|
789
791
|
const response = yield fetch(filePath);
|
|
@@ -870,6 +872,7 @@ class HomedecoratorSettingsOptions {
|
|
|
870
872
|
this.useRenderWebsocket = false;
|
|
871
873
|
this.productRenderSceneAssetId = 'scene_studio_eevee';
|
|
872
874
|
this.pathTracer = false;
|
|
875
|
+
this.ssrEnabled = false;
|
|
873
876
|
this.maxRenderSamples = 100;
|
|
874
877
|
}
|
|
875
878
|
}
|
|
@@ -948,7 +951,7 @@ function isEmpty(value) {
|
|
|
948
951
|
return value === null || value === undefined || value === '';
|
|
949
952
|
}
|
|
950
953
|
|
|
951
|
-
var __awaiter$
|
|
954
|
+
var __awaiter$1l = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
952
955
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
953
956
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
954
957
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -979,7 +982,7 @@ class HomedecoratorDictionaryService {
|
|
|
979
982
|
return text ? text : key;
|
|
980
983
|
}
|
|
981
984
|
setDictionary(path, client, languageCode, additionalTranslationFile) {
|
|
982
|
-
return __awaiter$
|
|
985
|
+
return __awaiter$1l(this, void 0, void 0, function* () {
|
|
983
986
|
this._language = languageCode ? languageCode : this._language;
|
|
984
987
|
let dictionaryData;
|
|
985
988
|
if (additionalTranslationFile) {
|
|
@@ -1000,7 +1003,7 @@ class HomedecoratorDictionaryService {
|
|
|
1000
1003
|
});
|
|
1001
1004
|
}
|
|
1002
1005
|
_getDictionaryData(path) {
|
|
1003
|
-
return __awaiter$
|
|
1006
|
+
return __awaiter$1l(this, void 0, void 0, function* () {
|
|
1004
1007
|
return yield this._jsonUtilsService.readJsonFile(path, false)
|
|
1005
1008
|
.catch(() => {
|
|
1006
1009
|
return null;
|
|
@@ -1017,7 +1020,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1017
1020
|
}]
|
|
1018
1021
|
}], ctorParameters: function () { return [{ type: JsonUtilsService }]; } });
|
|
1019
1022
|
|
|
1020
|
-
var __awaiter$
|
|
1023
|
+
var __awaiter$1k = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1021
1024
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1022
1025
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1023
1026
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -1085,7 +1088,7 @@ class HomedecoratorSettingsService {
|
|
|
1085
1088
|
}
|
|
1086
1089
|
}
|
|
1087
1090
|
initializeSettings() {
|
|
1088
|
-
return __awaiter$
|
|
1091
|
+
return __awaiter$1k(this, void 0, void 0, function* () {
|
|
1089
1092
|
if (environment.useSettings) {
|
|
1090
1093
|
// see if there's a json file for application settings
|
|
1091
1094
|
const jsonSettings = yield this._jsonUtilsService.readJsonFile('./settings/ione-connector.json', true);
|
|
@@ -1098,7 +1101,7 @@ class HomedecoratorSettingsService {
|
|
|
1098
1101
|
});
|
|
1099
1102
|
}
|
|
1100
1103
|
initialize(settings) {
|
|
1101
|
-
return __awaiter$
|
|
1104
|
+
return __awaiter$1k(this, void 0, void 0, function* () {
|
|
1102
1105
|
if (settings) {
|
|
1103
1106
|
yield this.createSettingsFromObject(settings);
|
|
1104
1107
|
}
|
|
@@ -1131,7 +1134,7 @@ class HomedecoratorSettingsService {
|
|
|
1131
1134
|
});
|
|
1132
1135
|
}
|
|
1133
1136
|
_checkUrlParameters() {
|
|
1134
|
-
return __awaiter$
|
|
1137
|
+
return __awaiter$1k(this, void 0, void 0, function* () {
|
|
1135
1138
|
const urlParams = new URLSearchParams(window.location.search);
|
|
1136
1139
|
const client = urlParams.get('client');
|
|
1137
1140
|
if (client) {
|
|
@@ -1152,7 +1155,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1152
1155
|
}]
|
|
1153
1156
|
}], ctorParameters: function () { return [{ type: JsonUtilsService }, { type: HomedecoratorDictionaryService }, { type: HomedecoratorConnectorAdapterService }]; } });
|
|
1154
1157
|
|
|
1155
|
-
var __awaiter$
|
|
1158
|
+
var __awaiter$1j = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1156
1159
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1157
1160
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1158
1161
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -1178,7 +1181,7 @@ class SkipButtonInfoService {
|
|
|
1178
1181
|
this._imageBody = value;
|
|
1179
1182
|
}
|
|
1180
1183
|
getSkipButtonImageAndText(goodId) {
|
|
1181
|
-
return __awaiter$
|
|
1184
|
+
return __awaiter$1j(this, void 0, void 0, function* () {
|
|
1182
1185
|
if (!this.text || !this.imageBody) {
|
|
1183
1186
|
const skipButtonInfo = yield this._connector.getSkipButtonImageAndText(goodId);
|
|
1184
1187
|
this.text = skipButtonInfo.oText;
|
|
@@ -1246,7 +1249,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1246
1249
|
}]
|
|
1247
1250
|
}] });
|
|
1248
1251
|
|
|
1249
|
-
var __awaiter$
|
|
1252
|
+
var __awaiter$1i = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1250
1253
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1251
1254
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1252
1255
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -1331,7 +1334,7 @@ class PermanentStoreService {
|
|
|
1331
1334
|
this._registerFormID = value;
|
|
1332
1335
|
}
|
|
1333
1336
|
updateRegisterForm(furniture) {
|
|
1334
|
-
return __awaiter$
|
|
1337
|
+
return __awaiter$1i(this, void 0, void 0, function* () {
|
|
1335
1338
|
const collectiveSheetKey = '13V6FBPWbICfjonrtAEReucHkE61ijWRmau806u5EGZs';
|
|
1336
1339
|
const collectiveSheetScriptURL = 'https://script.google.com/macros/s/AKfycbwtgNNj0PjBPdNiiYgKtYAAUVFu1GwKzMkwMFnEDm7Va-QiYdc/exec';
|
|
1337
1340
|
const customSheetScriptURL = 'https://script.google.com/macros/s/AKfycby-iJ_RdsdeCZ3TJN_qEMiv_DGhetyFMFIeNJGqvi-jQmDA2NBuSWFI-wmF-NtNQDLL/exec';
|
|
@@ -1455,7 +1458,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1455
1458
|
}]
|
|
1456
1459
|
}], ctorParameters: function () { return [{ type: HomedecoratorSettingsService }, { type: PermanentStoreService }]; } });
|
|
1457
1460
|
|
|
1458
|
-
var __awaiter$
|
|
1461
|
+
var __awaiter$1h = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1459
1462
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1460
1463
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1461
1464
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -1552,19 +1555,19 @@ class HomedecoratorConnectorService {
|
|
|
1552
1555
|
this._imageCache.clear();
|
|
1553
1556
|
}
|
|
1554
1557
|
getWebViewStartupInfo(request) {
|
|
1555
|
-
return __awaiter$
|
|
1558
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1556
1559
|
return this._connector.getWebViewStartupInfo(request);
|
|
1557
1560
|
});
|
|
1558
1561
|
}
|
|
1559
1562
|
initNodeInstance(sku) {
|
|
1560
|
-
return __awaiter$
|
|
1563
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1561
1564
|
const goodId = yield this._connector.getGoodIdFromArticleNr(sku);
|
|
1562
1565
|
const response = yield this._connector.initNodeInstance(goodId);
|
|
1563
1566
|
return this._handleInstanceResponse(response);
|
|
1564
1567
|
});
|
|
1565
1568
|
}
|
|
1566
1569
|
changeConnection(instanceId, oldConnection, newConnection) {
|
|
1567
|
-
return __awaiter$
|
|
1570
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1568
1571
|
const response = yield this._connector.changeConnection(instanceId, oldConnection, newConnection);
|
|
1569
1572
|
return response && response.validationResult && response.validationResult.success;
|
|
1570
1573
|
});
|
|
@@ -1591,7 +1594,7 @@ class HomedecoratorConnectorService {
|
|
|
1591
1594
|
this._decoNodes = decoNodes;
|
|
1592
1595
|
}
|
|
1593
1596
|
initConnection(forceReload) {
|
|
1594
|
-
return __awaiter$
|
|
1597
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1595
1598
|
if ((this._initialized || this._initializing) && !forceReload) {
|
|
1596
1599
|
return;
|
|
1597
1600
|
}
|
|
@@ -1617,14 +1620,14 @@ class HomedecoratorConnectorService {
|
|
|
1617
1620
|
getInternalParameter(param) {
|
|
1618
1621
|
return this._connector.getInternalParameter(param);
|
|
1619
1622
|
}
|
|
1620
|
-
getJsonConfiguredArticles(goodId, goodType, quantity, showLoader = true, instanceId, configuratorStatistics) {
|
|
1621
|
-
return this._connector.getJsonConfiguredArticles(goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics);
|
|
1623
|
+
getJsonConfiguredArticles(goodId, goodType, quantity, externalSource = false, showLoader = true, instanceId, configuratorStatistics) {
|
|
1624
|
+
return this._connector.getJsonConfiguredArticles(goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics);
|
|
1622
1625
|
}
|
|
1623
1626
|
// public getJsonMatchTableArticles(): Promise<any> {
|
|
1624
1627
|
// return this._connector.getJsonMatchTableArticles();
|
|
1625
1628
|
// }
|
|
1626
1629
|
setInstance(id) {
|
|
1627
|
-
return __awaiter$
|
|
1630
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1628
1631
|
const response = yield this._connector.setInstanceToConfigure(id).catch(error => {
|
|
1629
1632
|
console.log(error);
|
|
1630
1633
|
return new DataServiceResponseData();
|
|
@@ -1639,7 +1642,7 @@ class HomedecoratorConnectorService {
|
|
|
1639
1642
|
return this._copyInstance(instanceId, false, result);
|
|
1640
1643
|
}
|
|
1641
1644
|
saveConfigurations() {
|
|
1642
|
-
return __awaiter$
|
|
1645
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1643
1646
|
const success = yield this._connector.saveConfigurations();
|
|
1644
1647
|
if (!success) {
|
|
1645
1648
|
console.error('error saving configurations');
|
|
@@ -1647,7 +1650,9 @@ class HomedecoratorConnectorService {
|
|
|
1647
1650
|
});
|
|
1648
1651
|
}
|
|
1649
1652
|
getArticle(sku, branch) {
|
|
1650
|
-
return __awaiter$
|
|
1653
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1654
|
+
this.selections = [];
|
|
1655
|
+
this._decoNodes = [];
|
|
1651
1656
|
const article = yield this._connector.getArticle(sku, branch)
|
|
1652
1657
|
.catch(e => {
|
|
1653
1658
|
return Promise.reject(e);
|
|
@@ -1668,14 +1673,14 @@ class HomedecoratorConnectorService {
|
|
|
1668
1673
|
// this._connector.getQuestionAndAnswers();
|
|
1669
1674
|
// }
|
|
1670
1675
|
getQuestionAndAnswersAsync() {
|
|
1671
|
-
return __awaiter$
|
|
1676
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1672
1677
|
const questionAndAnswers = yield this._connector.getQuestionAndAnswersAsync();
|
|
1673
1678
|
questionAndAnswers.answers = questionAndAnswers.answers.filter(a => this._isAnswerPublished(a));
|
|
1674
1679
|
return questionAndAnswers;
|
|
1675
1680
|
});
|
|
1676
1681
|
}
|
|
1677
1682
|
getSelectionsAsync() {
|
|
1678
|
-
return __awaiter$
|
|
1683
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1679
1684
|
// this.selectionsToDisplay.length = 0;
|
|
1680
1685
|
this.selections.length = 0;
|
|
1681
1686
|
const selections = yield this._connector.getSelectionsAsync()
|
|
@@ -1686,7 +1691,7 @@ class HomedecoratorConnectorService {
|
|
|
1686
1691
|
});
|
|
1687
1692
|
}
|
|
1688
1693
|
getDecosAsync() {
|
|
1689
|
-
return __awaiter$
|
|
1694
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1690
1695
|
this._decoNodes = yield this._connector.getDecosAsync()
|
|
1691
1696
|
.catch(() => {
|
|
1692
1697
|
return [];
|
|
@@ -1711,13 +1716,13 @@ class HomedecoratorConnectorService {
|
|
|
1711
1716
|
return this._connector.replaceSelection(selection);
|
|
1712
1717
|
}
|
|
1713
1718
|
getAnswerInfo(answer) {
|
|
1714
|
-
return __awaiter$
|
|
1719
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1715
1720
|
const articleTexts = yield this._connector.getAnswerInfo(answer);
|
|
1716
1721
|
this._onAnswerInfoReceived({ answer: answer, info: articleTexts });
|
|
1717
1722
|
});
|
|
1718
1723
|
}
|
|
1719
1724
|
extendWithAnswerTextAndImage(answer, showLoader = true) {
|
|
1720
|
-
return __awaiter$
|
|
1725
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1721
1726
|
if (answer.nodeId) {
|
|
1722
1727
|
if (!this._imageCache.has(answer.nodeId)) {
|
|
1723
1728
|
this._connector.getImageForAnswerOrSelection(answer, 4, true, showLoader).then((imageData) => {
|
|
@@ -1738,7 +1743,7 @@ class HomedecoratorConnectorService {
|
|
|
1738
1743
|
});
|
|
1739
1744
|
}
|
|
1740
1745
|
extendWithSelectionImage(selection, showLoader = true) {
|
|
1741
|
-
return __awaiter$
|
|
1746
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1742
1747
|
if (selection.nodeId) {
|
|
1743
1748
|
if (!this._imageCache.has(selection.nodeId)) {
|
|
1744
1749
|
this._connector.getImageForAnswerOrSelection(selection, 4, true, showLoader).then((imageData) => {
|
|
@@ -1854,8 +1859,8 @@ class HomedecoratorConnectorService {
|
|
|
1854
1859
|
}
|
|
1855
1860
|
});
|
|
1856
1861
|
}
|
|
1857
|
-
addToCart(goodId, goodType, quantity, instanceId) {
|
|
1858
|
-
return __awaiter$
|
|
1862
|
+
addToCart(goodId, goodType, quantity, instanceId, externalSource) {
|
|
1863
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1859
1864
|
let json;
|
|
1860
1865
|
const statistics = new ConfiguratorStatisticsEnvironment();
|
|
1861
1866
|
statistics.userType = 'Homedecorator';
|
|
@@ -1864,7 +1869,7 @@ class HomedecoratorConnectorService {
|
|
|
1864
1869
|
statistics.sessionId = this._settingsService.settings.session ? this._settingsService.settings.session.sessionId : 'unknown';
|
|
1865
1870
|
statistics.webHost = window.location.host;
|
|
1866
1871
|
statistics.bundleHost = window.location.host;
|
|
1867
|
-
json = yield this.getJsonConfiguredArticles(goodId, goodType, quantity,
|
|
1872
|
+
json = yield this.getJsonConfiguredArticles(goodId, goodType, quantity, externalSource, true, instanceId, statistics);
|
|
1868
1873
|
const frozenArticle = JSON.parse(json);
|
|
1869
1874
|
this._googleTagManager.sendEvent(GoogleTagManagerEvent.AddToCart, {
|
|
1870
1875
|
'articleNr': frozenArticle.articleNr,
|
|
@@ -1876,7 +1881,7 @@ class HomedecoratorConnectorService {
|
|
|
1876
1881
|
});
|
|
1877
1882
|
}
|
|
1878
1883
|
handleAnswersReceived(answers) {
|
|
1879
|
-
return __awaiter$
|
|
1884
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1880
1885
|
this._activeAnswers = answers;
|
|
1881
1886
|
this.answerCountReceived.next(this._activeAnswers.length);
|
|
1882
1887
|
this._preloadCachedImages(answers);
|
|
@@ -1984,7 +1989,7 @@ class HomedecoratorConnectorService {
|
|
|
1984
1989
|
}
|
|
1985
1990
|
// POSTCONDITION: current activeAnswers have price values.
|
|
1986
1991
|
_loadPricesOfActiveAnswers() {
|
|
1987
|
-
return __awaiter$
|
|
1992
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
1988
1993
|
const answerPrices = yield this._connector.getAnswerPrices();
|
|
1989
1994
|
if (answerPrices) {
|
|
1990
1995
|
// paste price data onto our current answer objects; AnswerPrice.selId corresponds to Answer.node
|
|
@@ -2002,7 +2007,7 @@ class HomedecoratorConnectorService {
|
|
|
2002
2007
|
});
|
|
2003
2008
|
}
|
|
2004
2009
|
_copyInstance(originalInstanceId, shouldSaveCurrentInstanceId, result) {
|
|
2005
|
-
return __awaiter$
|
|
2010
|
+
return __awaiter$1h(this, void 0, void 0, function* () {
|
|
2006
2011
|
const copyInstanceResponse = yield this._connector.copyInstance(originalInstanceId, shouldSaveCurrentInstanceId).catch((e) => {
|
|
2007
2012
|
if (e === 'ECONNABORTED' || e === undefined) {
|
|
2008
2013
|
result.resultType = ResultType.Timeout;
|
|
@@ -2039,7 +2044,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2039
2044
|
}]
|
|
2040
2045
|
}], ctorParameters: function () { return [{ type: HomedecoratorConnectorAdapterService }, { type: JsonUtilsService }, { type: HomedecoratorSettingsService }, { type: SkipButtonInfoService }, { type: MessageBusService }, { type: HomedecoratorAppEventService }, { type: GoogleTagManagerService }]; } });
|
|
2041
2046
|
|
|
2042
|
-
var __awaiter$
|
|
2047
|
+
var __awaiter$1g = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2043
2048
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2044
2049
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2045
2050
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2079,13 +2084,13 @@ class AppStateService {
|
|
|
2079
2084
|
window.history.replaceState(data, title, url);
|
|
2080
2085
|
}
|
|
2081
2086
|
undo() {
|
|
2082
|
-
return __awaiter$
|
|
2087
|
+
return __awaiter$1g(this, void 0, void 0, function* () {
|
|
2083
2088
|
this.currentStateIndex -= 1;
|
|
2084
2089
|
yield this.applyStateFn(this.getValue(this.currentStateIndex));
|
|
2085
2090
|
});
|
|
2086
2091
|
}
|
|
2087
2092
|
redo() {
|
|
2088
|
-
return __awaiter$
|
|
2093
|
+
return __awaiter$1g(this, void 0, void 0, function* () {
|
|
2089
2094
|
this.currentStateIndex += 1;
|
|
2090
2095
|
yield this.applyStateFn(this.getValue(this.currentStateIndex));
|
|
2091
2096
|
});
|
|
@@ -2348,7 +2353,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2348
2353
|
}]
|
|
2349
2354
|
}], ctorParameters: function () { return []; } });
|
|
2350
2355
|
|
|
2351
|
-
var __awaiter$
|
|
2356
|
+
var __awaiter$1f = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2352
2357
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2353
2358
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2354
2359
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2383,7 +2388,7 @@ class LocalStorageService {
|
|
|
2383
2388
|
}
|
|
2384
2389
|
}
|
|
2385
2390
|
getRecoverySaveState() {
|
|
2386
|
-
return __awaiter$
|
|
2391
|
+
return __awaiter$1f(this, void 0, void 0, function* () {
|
|
2387
2392
|
const indexedDBSave = yield this.getIndexedDBSaveState();
|
|
2388
2393
|
const localStorageSave = this._getSaveStateInLocalStorage();
|
|
2389
2394
|
if (indexedDBSave) {
|
|
@@ -2398,13 +2403,13 @@ class LocalStorageService {
|
|
|
2398
2403
|
});
|
|
2399
2404
|
}
|
|
2400
2405
|
getIndexedDBSaveState() {
|
|
2401
|
-
return __awaiter$
|
|
2406
|
+
return __awaiter$1f(this, void 0, void 0, function* () {
|
|
2402
2407
|
const getMessage = yield this._webWorkerService.postMessage(WebWorkerType.IndexedDB, { messageType: WebWorkerMessage.GetRecoverySaveDataFromIndexedDB });
|
|
2403
2408
|
return getMessage.data;
|
|
2404
2409
|
});
|
|
2405
2410
|
}
|
|
2406
2411
|
writeIndexedDBSaveState(saveState) {
|
|
2407
|
-
return __awaiter$
|
|
2412
|
+
return __awaiter$1f(this, void 0, void 0, function* () {
|
|
2408
2413
|
const saveMessage = yield this._webWorkerService.postMessage(WebWorkerType.IndexedDB, { messageType: WebWorkerMessage.WriteCurrentSaveDataToIndexedDB, messageData: saveState });
|
|
2409
2414
|
if (!this.saveStateExists && saveMessage.data) {
|
|
2410
2415
|
this.saveStateExists = true;
|
|
@@ -2414,7 +2419,7 @@ class LocalStorageService {
|
|
|
2414
2419
|
});
|
|
2415
2420
|
}
|
|
2416
2421
|
checkForLocalSave() {
|
|
2417
|
-
return __awaiter$
|
|
2422
|
+
return __awaiter$1f(this, void 0, void 0, function* () {
|
|
2418
2423
|
if (!this.saveStateExists) {
|
|
2419
2424
|
const indexedDBSave = yield this.getIndexedDBSaveState();
|
|
2420
2425
|
if (indexedDBSave || this._getSaveStateInLocalStorage() !== null) {
|
|
@@ -2436,7 +2441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2436
2441
|
}]
|
|
2437
2442
|
}], ctorParameters: function () { return [{ type: WebWorkerService }]; } });
|
|
2438
2443
|
|
|
2439
|
-
var __awaiter$
|
|
2444
|
+
var __awaiter$1e = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2440
2445
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2441
2446
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2442
2447
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2515,7 +2520,7 @@ class FileUtils {
|
|
|
2515
2520
|
}
|
|
2516
2521
|
}
|
|
2517
2522
|
static SaveGLBFile(data, assetPath) {
|
|
2518
|
-
return __awaiter$
|
|
2523
|
+
return __awaiter$1e(this, void 0, void 0, function* () {
|
|
2519
2524
|
return new Promise((resolve, reject) => {
|
|
2520
2525
|
const xhr = new XMLHttpRequest();
|
|
2521
2526
|
xhr.open('POST', `${assetPath}saveGLBFile.php`, true);
|
|
@@ -2670,7 +2675,7 @@ class FileUtils {
|
|
|
2670
2675
|
}
|
|
2671
2676
|
FileUtils._cachedTextureUploads = new Map();
|
|
2672
2677
|
|
|
2673
|
-
var __awaiter$
|
|
2678
|
+
var __awaiter$1d = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2674
2679
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2675
2680
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2676
2681
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2684,7 +2689,7 @@ class FileService {
|
|
|
2684
2689
|
this._settingsService = _settingsService;
|
|
2685
2690
|
}
|
|
2686
2691
|
getTotalDownloadSize(files) {
|
|
2687
|
-
return __awaiter$
|
|
2692
|
+
return __awaiter$1d(this, void 0, void 0, function* () {
|
|
2688
2693
|
const url = `${this._settingsService.settings.assetPath}/fileSize.php`;
|
|
2689
2694
|
const data = {
|
|
2690
2695
|
files: files
|
|
@@ -2711,7 +2716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2711
2716
|
}]
|
|
2712
2717
|
}], ctorParameters: function () { return [{ type: HomedecoratorSettingsService }]; } });
|
|
2713
2718
|
|
|
2714
|
-
var __awaiter$
|
|
2719
|
+
var __awaiter$1c = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2715
2720
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2716
2721
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2717
2722
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2734,7 +2739,7 @@ class ProgressService {
|
|
|
2734
2739
|
return (current / this.total) * 100;
|
|
2735
2740
|
}
|
|
2736
2741
|
prepareDownloads(furniture) {
|
|
2737
|
-
return __awaiter$
|
|
2742
|
+
return __awaiter$1c(this, void 0, void 0, function* () {
|
|
2738
2743
|
this._reset();
|
|
2739
2744
|
const files = [];
|
|
2740
2745
|
if (furniture && furniture.length > 0) {
|
|
@@ -3623,7 +3628,7 @@ class RelativePositionUtils {
|
|
|
3623
3628
|
RelativePositionUtils.appOffsetTop = 0;
|
|
3624
3629
|
RelativePositionUtils.appOffsetLeft = 0;
|
|
3625
3630
|
|
|
3626
|
-
var __awaiter$
|
|
3631
|
+
var __awaiter$1b = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3627
3632
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3628
3633
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3629
3634
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -3822,7 +3827,7 @@ Controls = function (camera, domElement) {
|
|
|
3822
3827
|
scope.pan(new THREE.Vector2(x, y));
|
|
3823
3828
|
};
|
|
3824
3829
|
this.animateCamera = function (type, change) {
|
|
3825
|
-
return __awaiter$
|
|
3830
|
+
return __awaiter$1b(this, void 0, void 0, function* () {
|
|
3826
3831
|
const changing = new THREE.Vector2();
|
|
3827
3832
|
const tween = new TWEEN.Tween(changing).to(new THREE.Vector2(change, 0), 200);
|
|
3828
3833
|
tween.easing(TWEEN.Easing.Quadratic.In);
|
|
@@ -3833,7 +3838,7 @@ Controls = function (camera, domElement) {
|
|
|
3833
3838
|
});
|
|
3834
3839
|
};
|
|
3835
3840
|
this.animateCameraMovement = function (endPosition, endTarget, endDuration) {
|
|
3836
|
-
return __awaiter$
|
|
3841
|
+
return __awaiter$1b(this, void 0, void 0, function* () {
|
|
3837
3842
|
if (!isFinite(endPosition.x) || !isFinite(endPosition.y) || !isFinite(endPosition.z)) {
|
|
3838
3843
|
return;
|
|
3839
3844
|
}
|
|
@@ -3905,7 +3910,7 @@ Controls = function (camera, domElement) {
|
|
|
3905
3910
|
this.updatePositionTarget(this.camera.position, this.target);
|
|
3906
3911
|
};
|
|
3907
3912
|
this.animateMoveTo = function (target) {
|
|
3908
|
-
return __awaiter$
|
|
3913
|
+
return __awaiter$1b(this, void 0, void 0, function* () {
|
|
3909
3914
|
const position = scope.target.clone();
|
|
3910
3915
|
const distance = target.distanceTo(position);
|
|
3911
3916
|
const tween = new TWEEN.Tween(position).to(target, distance);
|
|
@@ -4089,7 +4094,7 @@ Controls = function (camera, domElement) {
|
|
|
4089
4094
|
return event && event.target && event.target === document.body;
|
|
4090
4095
|
}
|
|
4091
4096
|
function onMouseMove(event) {
|
|
4092
|
-
return __awaiter$
|
|
4097
|
+
return __awaiter$1b(this, void 0, void 0, function* () {
|
|
4093
4098
|
if (!isMouseEventAllowed(event)) {
|
|
4094
4099
|
return;
|
|
4095
4100
|
}
|
|
@@ -4438,7 +4443,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
4438
4443
|
}]
|
|
4439
4444
|
}] });
|
|
4440
4445
|
|
|
4441
|
-
var __awaiter$
|
|
4446
|
+
var __awaiter$1a = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4442
4447
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4443
4448
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4444
4449
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4623,7 +4628,7 @@ class CameraService {
|
|
|
4623
4628
|
this.cameraMovementChanged.next();
|
|
4624
4629
|
}
|
|
4625
4630
|
moveCameraToFitObject(object, offset) {
|
|
4626
|
-
return __awaiter$
|
|
4631
|
+
return __awaiter$1a(this, void 0, void 0, function* () {
|
|
4627
4632
|
if (!object) {
|
|
4628
4633
|
return;
|
|
4629
4634
|
}
|
|
@@ -4694,7 +4699,7 @@ class CameraService {
|
|
|
4694
4699
|
return target.clone().add(new Vector3(0, targetDistance, targetDistance));
|
|
4695
4700
|
}
|
|
4696
4701
|
_placeWalkThroughCameraInCorner(viewCorner) {
|
|
4697
|
-
return __awaiter$
|
|
4702
|
+
return __awaiter$1a(this, void 0, void 0, function* () {
|
|
4698
4703
|
const center2d = this._viewCenter;
|
|
4699
4704
|
const center = new Vector3(center2d.x, this.cameraDefaultHeight, center2d.y);
|
|
4700
4705
|
// place in a corner to have a better view
|
|
@@ -4869,7 +4874,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
4869
4874
|
}]
|
|
4870
4875
|
}], ctorParameters: function () { return []; } });
|
|
4871
4876
|
|
|
4872
|
-
var __awaiter$
|
|
4877
|
+
var __awaiter$19 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4873
4878
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4874
4879
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4875
4880
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4885,7 +4890,7 @@ class MessageBoardService {
|
|
|
4885
4890
|
this.messages = [];
|
|
4886
4891
|
}
|
|
4887
4892
|
init(scene) {
|
|
4888
|
-
return __awaiter$
|
|
4893
|
+
return __awaiter$19(this, void 0, void 0, function* () {
|
|
4889
4894
|
this.scene = scene;
|
|
4890
4895
|
if (this._settingsService.settings.options.xrDebug) {
|
|
4891
4896
|
this._createMessageBoard();
|
|
@@ -4923,7 +4928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
4923
4928
|
}]
|
|
4924
4929
|
}], ctorParameters: function () { return [{ type: HomedecoratorSettingsService }, { type: FontService }]; } });
|
|
4925
4930
|
|
|
4926
|
-
var __awaiter$
|
|
4931
|
+
var __awaiter$18 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4927
4932
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4928
4933
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4929
4934
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4953,7 +4958,7 @@ class XrService {
|
|
|
4953
4958
|
this._subs.forEach(s => s.unsubscribe());
|
|
4954
4959
|
}
|
|
4955
4960
|
init(renderer, scene, camera) {
|
|
4956
|
-
return __awaiter$
|
|
4961
|
+
return __awaiter$18(this, void 0, void 0, function* () {
|
|
4957
4962
|
if (!this._settingsService.settings.options.vrEnabled && !this._settingsService.settings.options.arEnabled) {
|
|
4958
4963
|
return;
|
|
4959
4964
|
}
|
|
@@ -5309,7 +5314,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
5309
5314
|
}]
|
|
5310
5315
|
}], ctorParameters: function () { return [{ type: HomedecoratorSettingsService }, { type: DebugService }, { type: MessageBoardService }]; } });
|
|
5311
5316
|
|
|
5312
|
-
var __awaiter$
|
|
5317
|
+
var __awaiter$17 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5313
5318
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5314
5319
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5315
5320
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -5363,7 +5368,7 @@ class Reticle extends Object3D {
|
|
|
5363
5368
|
* @param {XRCoordinateSystem} frameOfRef
|
|
5364
5369
|
*/
|
|
5365
5370
|
update(session, camera, frameOfRef) {
|
|
5366
|
-
return __awaiter$
|
|
5371
|
+
return __awaiter$17(this, void 0, void 0, function* () {
|
|
5367
5372
|
this._rayCaster = this._rayCaster || new Raycaster();
|
|
5368
5373
|
this._rayCaster.setFromCamera(new THREE.Vector2(0, 0), camera);
|
|
5369
5374
|
const ray = this._rayCaster.ray;
|
|
@@ -5958,7 +5963,7 @@ class BaseItem extends Object3D {
|
|
|
5958
5963
|
class ServiceLocator {
|
|
5959
5964
|
}
|
|
5960
5965
|
|
|
5961
|
-
var __awaiter$
|
|
5966
|
+
var __awaiter$16 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5962
5967
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5963
5968
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5964
5969
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -5974,7 +5979,6 @@ class OutlineService {
|
|
|
5974
5979
|
this._hideOutlineTimeout = 10000;
|
|
5975
5980
|
this._animationDuration = 5000;
|
|
5976
5981
|
this._outlinePassAsError = false;
|
|
5977
|
-
this._useMSAA = false;
|
|
5978
5982
|
this._initializing = false;
|
|
5979
5983
|
this._subs = [];
|
|
5980
5984
|
this.needsRender = false;
|
|
@@ -5997,16 +6001,18 @@ class OutlineService {
|
|
|
5997
6001
|
this._composer = new EffectComposer(this._renderer, this._renderTarget);
|
|
5998
6002
|
this._composer.setPixelRatio(window.devicePixelRatio);
|
|
5999
6003
|
const renderPass = new RenderPass(this._scene, this._camera);
|
|
6000
|
-
this.
|
|
6004
|
+
this._outputPass = new OutputPass();
|
|
6001
6005
|
this._outlinePass = new OutlinePass(new Vector2(width, height), this._scene, this._camera);
|
|
6002
|
-
this._composer.addPass(this._outlinePass);
|
|
6003
6006
|
this._fxaaPass = new ShaderPass(FXAAShader);
|
|
6004
6007
|
this._fxaaPass.material.uniforms['resolution'].value.set(1 / width, 1 / height);
|
|
6005
|
-
this._composer.addPass(this._fxaaPass);
|
|
6006
6008
|
// needed for the sRGBEncoding to work
|
|
6007
6009
|
// https://stackoverflow.com/questions/72936071/srgbencoding-in-not-working-in-three-effectcomposer
|
|
6008
|
-
const gammaCorrectionPass = new ShaderPass(GammaCorrectionShader);
|
|
6009
|
-
this._composer.addPass(
|
|
6010
|
+
// const gammaCorrectionPass = new ShaderPass(GammaCorrectionShader);
|
|
6011
|
+
this._composer.addPass(renderPass);
|
|
6012
|
+
this._composer.addPass(this._outlinePass);
|
|
6013
|
+
this._composer.addPass(this._fxaaPass);
|
|
6014
|
+
// this._composer.addPass(gammaCorrectionPass);
|
|
6015
|
+
this._composer.addPass(this._outputPass);
|
|
6010
6016
|
this._setSelectionGlowSettings();
|
|
6011
6017
|
this._composer.setSize(width, height);
|
|
6012
6018
|
}
|
|
@@ -6028,7 +6034,7 @@ class OutlineService {
|
|
|
6028
6034
|
this._outlinePass.selectedObjects = [item];
|
|
6029
6035
|
}
|
|
6030
6036
|
showOutline(item) {
|
|
6031
|
-
return __awaiter$
|
|
6037
|
+
return __awaiter$16(this, void 0, void 0, function* () {
|
|
6032
6038
|
// if (item && (item instanceof FloorPin || item instanceof WallPin)) {
|
|
6033
6039
|
// return;
|
|
6034
6040
|
// }
|
|
@@ -6047,7 +6053,7 @@ class OutlineService {
|
|
|
6047
6053
|
});
|
|
6048
6054
|
}
|
|
6049
6055
|
hideOutline() {
|
|
6050
|
-
return __awaiter$
|
|
6056
|
+
return __awaiter$16(this, void 0, void 0, function* () {
|
|
6051
6057
|
if (this._outlinePass.selectedObjects.length > 0) {
|
|
6052
6058
|
// await this._animatedOutlineStrength(300, 0);
|
|
6053
6059
|
this._outlinePass.selectedObjects = [];
|
|
@@ -6880,7 +6886,7 @@ var TextureType;
|
|
|
6880
6886
|
TextureType[TextureType["PBR"] = 3] = "PBR";
|
|
6881
6887
|
})(TextureType || (TextureType = {}));
|
|
6882
6888
|
|
|
6883
|
-
var __awaiter$
|
|
6889
|
+
var __awaiter$15 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6884
6890
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6885
6891
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6886
6892
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -6937,13 +6943,13 @@ class MaterialUtils {
|
|
|
6937
6943
|
}
|
|
6938
6944
|
// use canvas to create rotated textures
|
|
6939
6945
|
static RotatedCanvasTexture(texture, textureURL, dimensions, adjustScale, repeatX, repeatY) {
|
|
6940
|
-
return __awaiter$
|
|
6946
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
6941
6947
|
const img = yield MaterialUtils.LoadImageCached(textureURL);
|
|
6942
6948
|
return MaterialUtils.CreateTileMap(img, texture, dimensions, adjustScale, repeatX, repeatY);
|
|
6943
6949
|
});
|
|
6944
6950
|
}
|
|
6945
6951
|
static CustomTileMapTexture(texture, dimensions) {
|
|
6946
|
-
return __awaiter$
|
|
6952
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
6947
6953
|
let img = yield MaterialUtils.LoadImageCached(texture.data);
|
|
6948
6954
|
if (MaterialUtils.TextureSourceModified(texture)) {
|
|
6949
6955
|
img = yield MaterialUtils.CreateShiftedDataUrl(img, texture);
|
|
@@ -6976,7 +6982,7 @@ class MaterialUtils {
|
|
|
6976
6982
|
}
|
|
6977
6983
|
// use canvas to create texture from photo
|
|
6978
6984
|
static FromImage(texture /*, dimensions: THREE.Vector2*/) {
|
|
6979
|
-
return __awaiter$
|
|
6985
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
6980
6986
|
const img = yield MaterialUtils.LoadImageCached(texture.data);
|
|
6981
6987
|
const canvas = yield MaterialUtils.GetCanvasFromImageTexture(img, texture, true);
|
|
6982
6988
|
const threeTexture = new THREE.Texture(canvas);
|
|
@@ -6986,7 +6992,7 @@ class MaterialUtils {
|
|
|
6986
6992
|
});
|
|
6987
6993
|
}
|
|
6988
6994
|
static ReadAndResizePhotoAsDataURL(file) {
|
|
6989
|
-
return __awaiter$
|
|
6995
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
6990
6996
|
const imageSrc = yield MaterialUtils.ReadFileAsDataURL(file);
|
|
6991
6997
|
return MaterialUtils.LoadImageCached(imageSrc, false);
|
|
6992
6998
|
// const image = new Image();
|
|
@@ -7056,7 +7062,7 @@ class MaterialUtils {
|
|
|
7056
7062
|
});
|
|
7057
7063
|
}
|
|
7058
7064
|
static GetMaterialMaps(material, texture, dimensions) {
|
|
7059
|
-
return __awaiter$
|
|
7065
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7060
7066
|
if (!texture) {
|
|
7061
7067
|
return;
|
|
7062
7068
|
}
|
|
@@ -7088,7 +7094,7 @@ class MaterialUtils {
|
|
|
7088
7094
|
});
|
|
7089
7095
|
}
|
|
7090
7096
|
static loadMaterializeMaps(material, texture) {
|
|
7091
|
-
return __awaiter$
|
|
7097
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7092
7098
|
material.map = yield MaterialUtils.FromUrl(texture.materializeUrl + '_diffuseOriginal.jpg', texture.stretch, texture.tileSize, texture.repeatX, texture.repeatY, texture.dimensions, texture.tileRotation);
|
|
7093
7099
|
material.normalMap = yield MaterialUtils.FromUrl(texture.materializeUrl + '_normal.jpg', texture.stretch, texture.tileSize, texture.repeatX, texture.repeatY, texture.dimensions, texture.tileRotation);
|
|
7094
7100
|
material.roughnessMap = yield MaterialUtils.FromUrl(texture.materializeUrl + '_smoothness.jpg', texture.stretch, texture.tileSize, texture.repeatX, texture.repeatY, texture.dimensions, texture.tileRotation);
|
|
@@ -7147,7 +7153,7 @@ class MaterialUtils {
|
|
|
7147
7153
|
}
|
|
7148
7154
|
// use canvas to create texture from flipped photo
|
|
7149
7155
|
static FromFlippedImage(texture, dimensions) {
|
|
7150
|
-
return __awaiter$
|
|
7156
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7151
7157
|
const origImg = yield MaterialUtils.LoadImageCached(texture.data);
|
|
7152
7158
|
const canvas = yield MaterialUtils.GetCanvasFromImageTexture(origImg, texture, false, true);
|
|
7153
7159
|
const threeTexture = new THREE.Texture(canvas);
|
|
@@ -7176,21 +7182,21 @@ class MaterialUtils {
|
|
|
7176
7182
|
}
|
|
7177
7183
|
// use canvas to create custom textures
|
|
7178
7184
|
static CustomTileTexture(texture) {
|
|
7179
|
-
return __awaiter$
|
|
7185
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7180
7186
|
const img = yield MaterialUtils.LoadImageCached(texture.data);
|
|
7181
7187
|
const canvas = yield MaterialUtils.GetCanvasFromImageTexture(img, texture, true, true);
|
|
7182
7188
|
return MaterialUtils.CreateTileFromTexture(canvas, texture);
|
|
7183
7189
|
});
|
|
7184
7190
|
}
|
|
7185
7191
|
static RotatedImageTexture(texture, textureURL) {
|
|
7186
|
-
return __awaiter$
|
|
7192
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7187
7193
|
const img = yield MaterialUtils.LoadImageCached(textureURL);
|
|
7188
7194
|
const canvas = yield MaterialUtils.GetCanvasFromImageTexture(img, texture, false, true);
|
|
7189
7195
|
return MaterialUtils.CreateTileFromTexture(canvas, texture);
|
|
7190
7196
|
});
|
|
7191
7197
|
}
|
|
7192
7198
|
static CreateTileDataUrl(img, texture) {
|
|
7193
|
-
return __awaiter$
|
|
7199
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7194
7200
|
if (typeof img === 'string') {
|
|
7195
7201
|
img = yield this.CreateImageElementFromSource(img);
|
|
7196
7202
|
}
|
|
@@ -7204,7 +7210,7 @@ class MaterialUtils {
|
|
|
7204
7210
|
});
|
|
7205
7211
|
}
|
|
7206
7212
|
static CreateTileMap(img, texture, oDimensions, adjustScale, repeatX, repeatY) {
|
|
7207
|
-
return __awaiter$
|
|
7213
|
+
return __awaiter$15(this, void 0, void 0, function* () {
|
|
7208
7214
|
if (typeof img === 'string') {
|
|
7209
7215
|
img = yield this.CreateImageElementFromSource(img);
|
|
7210
7216
|
}
|
|
@@ -7283,7 +7289,7 @@ MaterialUtils.imgElement = undefined;
|
|
|
7283
7289
|
MaterialUtils.imageCache = new Map();
|
|
7284
7290
|
MaterialUtils.textureCache = new Map();
|
|
7285
7291
|
|
|
7286
|
-
var __awaiter$
|
|
7292
|
+
var __awaiter$14 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7287
7293
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7288
7294
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7289
7295
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -7327,7 +7333,7 @@ class ArService {
|
|
|
7327
7333
|
Utils$1.DisposeObject(this._pointRepresentation);
|
|
7328
7334
|
}
|
|
7329
7335
|
resetPlaneDetection() {
|
|
7330
|
-
return __awaiter$
|
|
7336
|
+
return __awaiter$14(this, void 0, void 0, function* () {
|
|
7331
7337
|
this._reticle.visible = false;
|
|
7332
7338
|
this._activeARModel.visible = false;
|
|
7333
7339
|
this._vertexList = [];
|
|
@@ -7345,8 +7351,21 @@ class ArService {
|
|
|
7345
7351
|
endSessionEvent() {
|
|
7346
7352
|
this._session.end();
|
|
7347
7353
|
}
|
|
7354
|
+
arIOSSupported() {
|
|
7355
|
+
return __awaiter$14(this, void 0, void 0, function* () {
|
|
7356
|
+
const isIOS = /iPad|iPhone|iPod/.test(navigator.platform) ||
|
|
7357
|
+
(navigator.userAgent.includes('Mac') && 'ontouchend' in document);
|
|
7358
|
+
if (isIOS) {
|
|
7359
|
+
const anchor = document.createElement('a');
|
|
7360
|
+
return anchor.relList.supports('ar');
|
|
7361
|
+
}
|
|
7362
|
+
else {
|
|
7363
|
+
return false;
|
|
7364
|
+
}
|
|
7365
|
+
});
|
|
7366
|
+
}
|
|
7348
7367
|
arSupported() {
|
|
7349
|
-
return __awaiter$
|
|
7368
|
+
return __awaiter$14(this, void 0, void 0, function* () {
|
|
7350
7369
|
if (navigator.xr) {
|
|
7351
7370
|
return yield navigator.xr.isSessionSupported('immersive-ar');
|
|
7352
7371
|
}
|
|
@@ -7668,7 +7687,7 @@ class ArService {
|
|
|
7668
7687
|
}
|
|
7669
7688
|
}
|
|
7670
7689
|
_createPlaneMaterial() {
|
|
7671
|
-
return __awaiter$
|
|
7690
|
+
return __awaiter$14(this, void 0, void 0, function* () {
|
|
7672
7691
|
const pm = new MeshPhongMaterial({ transparent: true, side: DoubleSide });
|
|
7673
7692
|
pm.map = yield MaterialUtils.FromUrl('assets/textures/Floor/Tiles/ar_floor_texture.png', false, 1, 2, 2);
|
|
7674
7693
|
pm.map.flipY = false;
|
|
@@ -7677,7 +7696,7 @@ class ArService {
|
|
|
7677
7696
|
});
|
|
7678
7697
|
}
|
|
7679
7698
|
_onSessionStarted(session) {
|
|
7680
|
-
return __awaiter$
|
|
7699
|
+
return __awaiter$14(this, void 0, void 0, function* () {
|
|
7681
7700
|
const domOverlay = document.getElementById('ar-root');
|
|
7682
7701
|
session.addEventListener('end', this._onSessionEnded.bind(this));
|
|
7683
7702
|
session.addEventListener('select', () => this._handleTouchEvent());
|
|
@@ -7799,7 +7818,7 @@ class ArService {
|
|
|
7799
7818
|
}
|
|
7800
7819
|
}
|
|
7801
7820
|
_checkIfHoldTouchEvent($event) {
|
|
7802
|
-
return __awaiter$
|
|
7821
|
+
return __awaiter$14(this, void 0, void 0, function* () {
|
|
7803
7822
|
setTimeout(() => {
|
|
7804
7823
|
if (!this.userInSelectionMenu && this._lastEventTimestamp === $event.timeStamp && this._session.inputSources.length === 1) {
|
|
7805
7824
|
this._holdingTouch = true;
|
|
@@ -8113,25 +8132,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
8113
8132
|
class PostProcessingService {
|
|
8114
8133
|
constructor(_configurationService) {
|
|
8115
8134
|
this._configurationService = _configurationService;
|
|
8116
|
-
this._subs = [];
|
|
8117
|
-
this._subs.push(this._configurationService.onChange.subscribe((changed) => {
|
|
8118
|
-
if (ConfigurationKey.ShowPostProcessingSettings in changed) {
|
|
8119
|
-
this._showHideGui(changed[ConfigurationKey.ShowPostProcessingSettings]);
|
|
8120
|
-
}
|
|
8121
|
-
}));
|
|
8122
|
-
}
|
|
8123
|
-
ngOnDestroy() {
|
|
8124
|
-
this._subs.forEach(s => s.unsubscribe());
|
|
8125
|
-
}
|
|
8126
|
-
init(renderer, scene, camera, width, height) {
|
|
8127
|
-
this._renderer = renderer;
|
|
8128
|
-
this._scene = scene;
|
|
8129
|
-
this._camera = camera;
|
|
8130
|
-
this._composer = new EffectComposer(renderer);
|
|
8131
|
-
this._n8aoPass = new N8AOPass(scene, camera, width, height);
|
|
8132
|
-
const smaaPass = new SMAAPass(width, height);
|
|
8133
|
-
this._composer.addPass(this._n8aoPass);
|
|
8134
|
-
this._composer.addPass(smaaPass);
|
|
8135
8135
|
this._effectController = {
|
|
8136
8136
|
aoSamples: 32.0,
|
|
8137
8137
|
denoiseSamples: 8.0,
|
|
@@ -8149,7 +8149,51 @@ class PostProcessingService {
|
|
|
8149
8149
|
stencil: true,
|
|
8150
8150
|
accumulate: false
|
|
8151
8151
|
};
|
|
8152
|
+
this._subs = [];
|
|
8153
|
+
this._subs.push(this._configurationService.onChange.subscribe((changed) => {
|
|
8154
|
+
if (ConfigurationKey.ShowPostProcessingSettings in changed) {
|
|
8155
|
+
this._showHideGui(changed[ConfigurationKey.ShowPostProcessingSettings]);
|
|
8156
|
+
}
|
|
8157
|
+
}));
|
|
8158
|
+
}
|
|
8159
|
+
ngOnDestroy() {
|
|
8160
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
8161
|
+
}
|
|
8162
|
+
init(renderer, scene, camera, width, height) {
|
|
8163
|
+
this._renderer = renderer;
|
|
8164
|
+
this._scene = scene;
|
|
8165
|
+
this._camera = camera;
|
|
8166
|
+
this._renderTarget = new WebGLRenderTarget(width, height, {
|
|
8167
|
+
minFilter: NearestFilter,
|
|
8168
|
+
magFilter: NearestFilter,
|
|
8169
|
+
format: RGBAFormat,
|
|
8170
|
+
colorSpace: SRGBColorSpace
|
|
8171
|
+
});
|
|
8172
|
+
this._renderTarget.samples = 4;
|
|
8173
|
+
this._renderTarget.depthTexture = new DepthTexture(width, height, UnsignedIntType);
|
|
8174
|
+
this._renderTarget.depthTexture.format = DepthFormat;
|
|
8175
|
+
this._composer = new EffectComposer(this._renderer, this._renderTarget);
|
|
8176
|
+
this._n8aoPass = new N8AOPass(scene, camera, width, height);
|
|
8177
|
+
this._n8aoPass.configuration.gammaCorrection = false;
|
|
8178
|
+
this._n8aoPass.debugMode = true;
|
|
8179
|
+
// const smaaPass = new SMAAPass(width, height);
|
|
8180
|
+
// this._composer.addPass(smaaPass);
|
|
8181
|
+
// const fxaaPass = new ShaderPass(FXAAShader);
|
|
8182
|
+
// const pixelRatio = this._renderer.getPixelRatio();
|
|
8183
|
+
// fxaaPass.material.uniforms[ 'resolution' ].value.x = 1 / (width * pixelRatio);
|
|
8184
|
+
// fxaaPass.material.uniforms[ 'resolution' ].value.y = 1 / (height * pixelRatio);
|
|
8185
|
+
this._outputPass = new OutputPass();
|
|
8186
|
+
this._taaRenderPass = new TAARenderPass(this._scene, this._camera, 0x000000, 0);
|
|
8187
|
+
this._taaRenderPass.unbiased = false;
|
|
8188
|
+
this._taaRenderPass.sampleLevel = 4;
|
|
8189
|
+
this._renderPass = new RenderPass(this._scene, this._camera);
|
|
8190
|
+
// this._renderPass.enabled = false;
|
|
8191
|
+
this._composer.addPass(this._renderPass);
|
|
8192
|
+
this._composer.addPass(this._taaRenderPass);
|
|
8193
|
+
this._composer.addPass(this._n8aoPass);
|
|
8194
|
+
this._composer.addPass(this._outputPass);
|
|
8152
8195
|
this._createGui();
|
|
8196
|
+
this._createGuiTaaPass();
|
|
8153
8197
|
}
|
|
8154
8198
|
_updatePass() {
|
|
8155
8199
|
this._n8aoPass.configuration.aoRadius = this._effectController.aoRadius;
|
|
@@ -8169,6 +8213,34 @@ class PostProcessingService {
|
|
|
8169
8213
|
this._n8aoPass.configuration.accumulate = this._effectController.accumulate;
|
|
8170
8214
|
this.render();
|
|
8171
8215
|
}
|
|
8216
|
+
_createGuiTaaPass() {
|
|
8217
|
+
this._taaPassGui = new GUI();
|
|
8218
|
+
this._taaPassGui.hide();
|
|
8219
|
+
const param = { TAAEnabled: '1', TAASampleLevel: 0 };
|
|
8220
|
+
this._taaPassGui.add(param, 'TAAEnabled', {
|
|
8221
|
+
'Disabled': '0',
|
|
8222
|
+
'Enabled': '1'
|
|
8223
|
+
}).onFinishChange(() => {
|
|
8224
|
+
if (this._taaRenderPass) {
|
|
8225
|
+
this._taaRenderPass.enabled = (param.TAAEnabled === '1');
|
|
8226
|
+
}
|
|
8227
|
+
this.render();
|
|
8228
|
+
});
|
|
8229
|
+
this._taaPassGui.add(param, 'TAASampleLevel', {
|
|
8230
|
+
'Level 0: 1 Sample': 0,
|
|
8231
|
+
'Level 1: 2 Samples': 1,
|
|
8232
|
+
'Level 2: 4 Samples': 2,
|
|
8233
|
+
'Level 3: 8 Samples': 3,
|
|
8234
|
+
'Level 4: 16 Samples': 4,
|
|
8235
|
+
'Level 5: 32 Samples': 5
|
|
8236
|
+
}).onFinishChange(() => {
|
|
8237
|
+
if (this._taaRenderPass) {
|
|
8238
|
+
this._taaRenderPass.sampleLevel = param.TAASampleLevel;
|
|
8239
|
+
}
|
|
8240
|
+
this.render();
|
|
8241
|
+
});
|
|
8242
|
+
this._taaPassGui.open();
|
|
8243
|
+
}
|
|
8172
8244
|
setSize(width, height) {
|
|
8173
8245
|
this._composer.setSize(width, height);
|
|
8174
8246
|
}
|
|
@@ -8233,6 +8305,107 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
8233
8305
|
}]
|
|
8234
8306
|
}], ctorParameters: function () { return [{ type: ConfigurationService }]; } });
|
|
8235
8307
|
|
|
8308
|
+
var __awaiter$13 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8309
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8310
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8311
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8312
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8313
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8314
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8315
|
+
});
|
|
8316
|
+
};
|
|
8317
|
+
class SsrService {
|
|
8318
|
+
constructor(_settingsService) {
|
|
8319
|
+
this._settingsService = _settingsService;
|
|
8320
|
+
this._enabled = false;
|
|
8321
|
+
this._subs = [];
|
|
8322
|
+
}
|
|
8323
|
+
set enabled(value) {
|
|
8324
|
+
this._enabled = value;
|
|
8325
|
+
if (this._enabled) {
|
|
8326
|
+
this._prepareWebsocket();
|
|
8327
|
+
}
|
|
8328
|
+
}
|
|
8329
|
+
get enabled() {
|
|
8330
|
+
return this._enabled;
|
|
8331
|
+
}
|
|
8332
|
+
ngOnDestroy() {
|
|
8333
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
8334
|
+
}
|
|
8335
|
+
init() {
|
|
8336
|
+
const socket = new WebSocket('ws://localhost:7005');
|
|
8337
|
+
const peerConnection = new RTCPeerConnection({
|
|
8338
|
+
iceServers: [{ urls: 'stun:stun.1.google.com:19302' }]
|
|
8339
|
+
});
|
|
8340
|
+
peerConnection.onicecandidate = (event) => {
|
|
8341
|
+
if (event.candidate) {
|
|
8342
|
+
socket.send(JSON.stringify({ candidate: event.candidate }));
|
|
8343
|
+
}
|
|
8344
|
+
};
|
|
8345
|
+
peerConnection.ontrack = (event) => {
|
|
8346
|
+
const remoteVideo = document.getElementById('remoteVideo');
|
|
8347
|
+
// @ts-ignore
|
|
8348
|
+
if (remoteVideo.srcObject !== event.streams[0]) {
|
|
8349
|
+
// @ts-ignore
|
|
8350
|
+
remoteVideo.srcObject = event.streams[0];
|
|
8351
|
+
}
|
|
8352
|
+
};
|
|
8353
|
+
socket.onmessage = (message) => __awaiter$13(this, void 0, void 0, function* () {
|
|
8354
|
+
try {
|
|
8355
|
+
const text = yield message.data.text();
|
|
8356
|
+
const data = JSON.parse(text);
|
|
8357
|
+
if (data.offer) {
|
|
8358
|
+
yield peerConnection.setRemoteDescription(new RTCSessionDescription(data.offer));
|
|
8359
|
+
const answer = yield peerConnection.createAnswer();
|
|
8360
|
+
yield peerConnection.setLocalDescription(answer);
|
|
8361
|
+
socket.send(JSON.stringify({ answer: peerConnection.localDescription }));
|
|
8362
|
+
}
|
|
8363
|
+
else if (data.candidate) {
|
|
8364
|
+
try {
|
|
8365
|
+
yield peerConnection.addIceCandidate(new RTCIceCandidate(data.candidate));
|
|
8366
|
+
}
|
|
8367
|
+
catch (e) {
|
|
8368
|
+
console.error('Error adding ICE-Candidate', e);
|
|
8369
|
+
}
|
|
8370
|
+
}
|
|
8371
|
+
}
|
|
8372
|
+
catch (e) {
|
|
8373
|
+
console.error(e);
|
|
8374
|
+
}
|
|
8375
|
+
});
|
|
8376
|
+
}
|
|
8377
|
+
sceneChanged(scene) {
|
|
8378
|
+
if (this._websocket.readyState === WebSocket.OPEN) {
|
|
8379
|
+
const sceneClone = scene.clone(true);
|
|
8380
|
+
this._websocket.send(JSON.stringify(sceneClone));
|
|
8381
|
+
}
|
|
8382
|
+
}
|
|
8383
|
+
_prepareWebsocket() {
|
|
8384
|
+
if (!this._settingsService.settings.newRenderParameters.websocket) {
|
|
8385
|
+
return;
|
|
8386
|
+
}
|
|
8387
|
+
const webSocketConnection = this._settingsService.settings.newRenderParameters.websocket;
|
|
8388
|
+
this._websocket = new WebSocket(webSocketConnection);
|
|
8389
|
+
// webSocket.onopen = () => {
|
|
8390
|
+
// webSocket.send(JSON.stringify(data));
|
|
8391
|
+
// };
|
|
8392
|
+
this._websocket.onmessage = (event) => {
|
|
8393
|
+
const result = JSON.parse(event.data);
|
|
8394
|
+
if (result) {
|
|
8395
|
+
console.log(result);
|
|
8396
|
+
}
|
|
8397
|
+
};
|
|
8398
|
+
}
|
|
8399
|
+
}
|
|
8400
|
+
SsrService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SsrService, deps: [{ token: HomedecoratorSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8401
|
+
SsrService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SsrService, providedIn: 'root' });
|
|
8402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SsrService, decorators: [{
|
|
8403
|
+
type: Injectable,
|
|
8404
|
+
args: [{
|
|
8405
|
+
providedIn: 'root'
|
|
8406
|
+
}]
|
|
8407
|
+
}], ctorParameters: function () { return [{ type: HomedecoratorSettingsService }]; } });
|
|
8408
|
+
|
|
8236
8409
|
var __awaiter$12 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8237
8410
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8238
8411
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8243,7 +8416,7 @@ var __awaiter$12 = (this && this.__awaiter) || function (thisArg, _arguments, P,
|
|
|
8243
8416
|
});
|
|
8244
8417
|
};
|
|
8245
8418
|
class SceneService {
|
|
8246
|
-
constructor(_cameraService, _configurationService, _xrService, _vrService, _arService, _messageBusService, _viewModeService, _outlineService, _settingsService, _postProcessing) {
|
|
8419
|
+
constructor(_cameraService, _configurationService, _xrService, _vrService, _arService, _messageBusService, _viewModeService, _outlineService, _settingsService, _postProcessing, _ssrService) {
|
|
8247
8420
|
this._cameraService = _cameraService;
|
|
8248
8421
|
this._configurationService = _configurationService;
|
|
8249
8422
|
this._xrService = _xrService;
|
|
@@ -8254,6 +8427,7 @@ class SceneService {
|
|
|
8254
8427
|
this._outlineService = _outlineService;
|
|
8255
8428
|
this._settingsService = _settingsService;
|
|
8256
8429
|
this._postProcessing = _postProcessing;
|
|
8430
|
+
this._ssrService = _ssrService;
|
|
8257
8431
|
this.onBeforeRender = new Subject();
|
|
8258
8432
|
this.onAfterRender = new Subject();
|
|
8259
8433
|
this.sceneInitialized = new BehaviorSubject(false);
|
|
@@ -8327,6 +8501,7 @@ class SceneService {
|
|
|
8327
8501
|
if (loaded) {
|
|
8328
8502
|
this._initPathTracer();
|
|
8329
8503
|
this._maxRenderSamples = this._settingsService.settings.options.maxRenderSamples;
|
|
8504
|
+
this._ssrService.enabled = this._settingsService.settings.options.ssrEnabled;
|
|
8330
8505
|
}
|
|
8331
8506
|
})
|
|
8332
8507
|
// this._xrService.sessionStarted.subscribe((mode: XrMode) => {
|
|
@@ -8388,6 +8563,20 @@ class SceneService {
|
|
|
8388
8563
|
});
|
|
8389
8564
|
this.needsRender = true;
|
|
8390
8565
|
}
|
|
8566
|
+
createRenderWithOrthographicCamera() {
|
|
8567
|
+
const aspect = window.innerWidth / window.innerHeight;
|
|
8568
|
+
const frustumSize = 10;
|
|
8569
|
+
const orthographicCamera = new OrthographicCamera(frustumSize * aspect / -2, frustumSize * aspect / 2, frustumSize / 2, frustumSize / -2, 0.1, 100);
|
|
8570
|
+
orthographicCamera.position.set(0, 3, -2);
|
|
8571
|
+
orthographicCamera.lookAt(0, 0, -2);
|
|
8572
|
+
orthographicCamera.name = 'orthographiccamera';
|
|
8573
|
+
this.scene.add(orthographicCamera);
|
|
8574
|
+
this.renderer.render(this.scene, orthographicCamera);
|
|
8575
|
+
const render = this.renderer.domElement.toDataURL('image/jpeg');
|
|
8576
|
+
this.scene.getObjectByName('orthographiccamera').remove();
|
|
8577
|
+
this.renderer.render(this.scene, this._cameraService.camera);
|
|
8578
|
+
return render;
|
|
8579
|
+
}
|
|
8391
8580
|
_initScene() {
|
|
8392
8581
|
this.scene = new Scene();
|
|
8393
8582
|
this._setSceneBackground();
|
|
@@ -8447,13 +8636,13 @@ class SceneService {
|
|
|
8447
8636
|
// logarithmicDepthBuffer: true*/
|
|
8448
8637
|
// });
|
|
8449
8638
|
// this.renderer = new WebGLRenderer({alpha: true, antialias: false, preserveDrawingBuffer: true, premultipliedAlpha: true});
|
|
8450
|
-
this.renderer = new WebGLRenderer({
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
});
|
|
8639
|
+
this.renderer = new WebGLRenderer( /*{
|
|
8640
|
+
precision: 'highp',
|
|
8641
|
+
powerPreference: 'high-performance',
|
|
8642
|
+
antialias: true,
|
|
8643
|
+
stencil: false,
|
|
8644
|
+
depth: false
|
|
8645
|
+
}*/);
|
|
8457
8646
|
this.renderer.outputColorSpace = SRGBColorSpace;
|
|
8458
8647
|
this.renderer.autoClear = false;
|
|
8459
8648
|
this.renderer.setPixelRatio(window.devicePixelRatio);
|
|
@@ -8517,8 +8706,8 @@ class SceneService {
|
|
|
8517
8706
|
this.renderer.render(this.scene, this._cameraService.camera);
|
|
8518
8707
|
}
|
|
8519
8708
|
else {
|
|
8520
|
-
// this._outlineService.render();
|
|
8521
8709
|
this._postProcessing.render();
|
|
8710
|
+
this._outlineService.render();
|
|
8522
8711
|
}
|
|
8523
8712
|
// this.renderer.render(this.scene, this._cameraService.camera);
|
|
8524
8713
|
}
|
|
@@ -8564,14 +8753,14 @@ class SceneService {
|
|
|
8564
8753
|
return this.renderer.domElement.toDataURL('image/jpeg');
|
|
8565
8754
|
}
|
|
8566
8755
|
}
|
|
8567
|
-
SceneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SceneService, deps: [{ token: CameraService }, { token: ConfigurationService }, { token: XrService }, { token: VrService }, { token: ArService }, { token: MessageBusService }, { token: ViewModeService }, { token: OutlineService }, { token: HomedecoratorSettingsService }, { token: PostProcessingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8756
|
+
SceneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SceneService, deps: [{ token: CameraService }, { token: ConfigurationService }, { token: XrService }, { token: VrService }, { token: ArService }, { token: MessageBusService }, { token: ViewModeService }, { token: OutlineService }, { token: HomedecoratorSettingsService }, { token: PostProcessingService }, { token: SsrService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8568
8757
|
SceneService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SceneService, providedIn: 'root' });
|
|
8569
8758
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SceneService, decorators: [{
|
|
8570
8759
|
type: Injectable,
|
|
8571
8760
|
args: [{
|
|
8572
8761
|
providedIn: 'root'
|
|
8573
8762
|
}]
|
|
8574
|
-
}], ctorParameters: function () { return [{ type: CameraService }, { type: ConfigurationService }, { type: XrService }, { type: VrService }, { type: ArService }, { type: MessageBusService }, { type: ViewModeService }, { type: OutlineService }, { type: HomedecoratorSettingsService }, { type: PostProcessingService }]; } });
|
|
8763
|
+
}], ctorParameters: function () { return [{ type: CameraService }, { type: ConfigurationService }, { type: XrService }, { type: VrService }, { type: ArService }, { type: MessageBusService }, { type: ViewModeService }, { type: OutlineService }, { type: HomedecoratorSettingsService }, { type: PostProcessingService }, { type: SsrService }]; } });
|
|
8575
8764
|
|
|
8576
8765
|
var __awaiter$11 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8577
8766
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -11938,12 +12127,16 @@ class LightPreset {
|
|
|
11938
12127
|
model.standalone = modelInterface.standalone;
|
|
11939
12128
|
model.group = modelInterface.group;
|
|
11940
12129
|
model.navigatorType = modelInterface.navigatorType;
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
12130
|
+
if (Array.from(shadowMapTypesMap.entries()).find((key, value) => key[1] === modelInterface.shadowMapType)) {
|
|
12131
|
+
model.shadowMapType = modelInterface.shadowMapType ?
|
|
12132
|
+
Array.from(shadowMapTypesMap.entries()).find((key, value) => key[1] === modelInterface.shadowMapType)[0] :
|
|
12133
|
+
ShadowMapLocalType.PCFSoftShadowMap;
|
|
12134
|
+
}
|
|
12135
|
+
if (Array.from(outputEncodingMap.entries()).find((key, value) => key[1] === modelInterface.outputEncoding)) {
|
|
12136
|
+
model.outputEncoding = modelInterface.outputEncoding ?
|
|
12137
|
+
Array.from(outputEncodingMap.entries()).find((key, value) => key[1] === modelInterface.outputEncoding)[0] :
|
|
12138
|
+
OutputEncoding.SRGBColorSpace;
|
|
12139
|
+
}
|
|
11947
12140
|
model.shadowRadius = modelInterface.shadowRadius;
|
|
11948
12141
|
model.toneMappingExposure = modelInterface.toneMappingExposure ? modelInterface.toneMappingExposure : 1;
|
|
11949
12142
|
model.physicallyCorrectLights = modelInterface.physicallyCorrectLights ? modelInterface.physicallyCorrectLights : false;
|
|
@@ -11973,9 +12166,9 @@ class MediaResource {
|
|
|
11973
12166
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
11974
12167
|
/* tslint:disable */
|
|
11975
12168
|
const VersionInfo = {
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
12169
|
+
application: "Homedecorator",
|
|
12170
|
+
appVersion: "255.1.2",
|
|
12171
|
+
revision: "111849"
|
|
11979
12172
|
};
|
|
11980
12173
|
/* tslint:enable */
|
|
11981
12174
|
|
|
@@ -12364,10 +12557,18 @@ class FloorPlaneItem extends Item {
|
|
|
12364
12557
|
this.floorTexture = texture;
|
|
12365
12558
|
if (object && object instanceof Mesh) {
|
|
12366
12559
|
this._originalFloorMaterial = object.material;
|
|
12560
|
+
this.floorMesh = object;
|
|
12561
|
+
this._volume = new Box3();
|
|
12562
|
+
this._volume.setFromObject(object);
|
|
12367
12563
|
this._originalUvs = object.geometry.attributes.uv.array;
|
|
12368
12564
|
this._originalGeometry = object.geometry;
|
|
12369
12565
|
}
|
|
12370
12566
|
}
|
|
12567
|
+
get size() {
|
|
12568
|
+
const size = new Vector3();
|
|
12569
|
+
this._volume.getSize(size);
|
|
12570
|
+
return size;
|
|
12571
|
+
}
|
|
12371
12572
|
set floorMaterial(mat) {
|
|
12372
12573
|
this.children.forEach(c => {
|
|
12373
12574
|
if (c instanceof Mesh) {
|
|
@@ -12377,6 +12578,20 @@ class FloorPlaneItem extends Item {
|
|
|
12377
12578
|
}
|
|
12378
12579
|
});
|
|
12379
12580
|
}
|
|
12581
|
+
set floorObject(object) {
|
|
12582
|
+
this.children.forEach(c => c.visible = false);
|
|
12583
|
+
this._restoreObjects = this.children;
|
|
12584
|
+
this._configurableFloor = object;
|
|
12585
|
+
this.add(object);
|
|
12586
|
+
}
|
|
12587
|
+
restoreFloorObject() {
|
|
12588
|
+
if (!this._configurableFloor) {
|
|
12589
|
+
return;
|
|
12590
|
+
}
|
|
12591
|
+
this.remove(this._configurableFloor);
|
|
12592
|
+
this._configurableFloor.children.forEach((child) => child.dispose());
|
|
12593
|
+
this._restoreObjects.forEach(c => c.visible = true);
|
|
12594
|
+
}
|
|
12380
12595
|
getTexture() {
|
|
12381
12596
|
return this.floorTexture;
|
|
12382
12597
|
}
|
|
@@ -12387,6 +12602,7 @@ class FloorPlaneItem extends Item {
|
|
|
12387
12602
|
return false;
|
|
12388
12603
|
}
|
|
12389
12604
|
removed() {
|
|
12605
|
+
this.restoreFloorObject();
|
|
12390
12606
|
if (this._originalFloorMaterial) {
|
|
12391
12607
|
this.configurable = false;
|
|
12392
12608
|
this.metadata.ione = false;
|
|
@@ -13161,11 +13377,14 @@ class FloorService {
|
|
|
13161
13377
|
else {
|
|
13162
13378
|
geometry = new ShapeGeometry(shape).center();
|
|
13163
13379
|
}
|
|
13380
|
+
this._sceneService.needsRender = true;
|
|
13381
|
+
// floorMaterial.metalness = 0;
|
|
13382
|
+
geometry.rotateX(Math.PI / 2);
|
|
13164
13383
|
const floorMaterial = yield this._createFloorMaterial(color, texture);
|
|
13165
13384
|
const floorMesh = new ThreeMesh(geometry, floorMaterial);
|
|
13166
13385
|
const floorPlane = new FloorPlaneItem({ itemType: ItemType.FloorDecoration }, floorMesh);
|
|
13167
13386
|
floorPlane.name = 'floor-plane';
|
|
13168
|
-
floorPlane.rotation.set(Math.PI / 2, 0, 0);
|
|
13387
|
+
// floorPlane.rotation.set(Math.PI / 2, 0, 0);
|
|
13169
13388
|
floorPlane.receiveShadow = true;
|
|
13170
13389
|
floorPlane.castShadow = false;
|
|
13171
13390
|
const floorCenter = corners ? this._getFloorCenter(corners) : new Vector3(0, 0, 0);
|
|
@@ -17294,6 +17513,21 @@ class UtilsService {
|
|
|
17294
17513
|
this._ktx2Loader.detectSupport(this._sceneService.renderer);
|
|
17295
17514
|
return this._ktx2Loader;
|
|
17296
17515
|
}
|
|
17516
|
+
downloadUSDZforARIOS(object) {
|
|
17517
|
+
return __awaiter$R(this, void 0, void 0, function* () {
|
|
17518
|
+
const exporter = new USDZExporter();
|
|
17519
|
+
const arraybuffer = yield exporter.parseAsync(object);
|
|
17520
|
+
const blob = new Blob([arraybuffer], { type: 'model/vnd.usdz+zip' });
|
|
17521
|
+
const url = URL.createObjectURL(blob);
|
|
17522
|
+
const element = document.createElement('a');
|
|
17523
|
+
element.style.display = 'none';
|
|
17524
|
+
element.href = url;
|
|
17525
|
+
document.body.appendChild(element);
|
|
17526
|
+
element.click();
|
|
17527
|
+
document.body.removeChild(element);
|
|
17528
|
+
URL.revokeObjectURL(url);
|
|
17529
|
+
});
|
|
17530
|
+
}
|
|
17297
17531
|
_download3DModelAsGLB(object) {
|
|
17298
17532
|
const options = {
|
|
17299
17533
|
trs: false,
|
|
@@ -20601,6 +20835,159 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
20601
20835
|
args: [MAT_DIALOG_DATA]
|
|
20602
20836
|
}] }]; } });
|
|
20603
20837
|
|
|
20838
|
+
var FloorPattern;
|
|
20839
|
+
(function (FloorPattern) {
|
|
20840
|
+
FloorPattern[FloorPattern["NORMAL"] = 0] = "NORMAL";
|
|
20841
|
+
FloorPattern[FloorPattern["HERRINGBONE"] = 1] = "HERRINGBONE";
|
|
20842
|
+
FloorPattern[FloorPattern["HON60"] = 2] = "HON60";
|
|
20843
|
+
FloorPattern[FloorPattern["HON45"] = 3] = "HON45";
|
|
20844
|
+
})(FloorPattern || (FloorPattern = {}));
|
|
20845
|
+
var FloorPatternDirection;
|
|
20846
|
+
(function (FloorPatternDirection) {
|
|
20847
|
+
FloorPatternDirection[FloorPatternDirection["STANDING"] = 0] = "STANDING";
|
|
20848
|
+
FloorPatternDirection[FloorPatternDirection["LYING"] = 1] = "LYING";
|
|
20849
|
+
})(FloorPatternDirection || (FloorPatternDirection = {}));
|
|
20850
|
+
class FloorPatternService {
|
|
20851
|
+
generatePattern(floorPattern, plankSize, floorSize, direction = FloorPatternDirection.LYING) {
|
|
20852
|
+
const floorRotation = direction === FloorPatternDirection.STANDING ? 90 : 0;
|
|
20853
|
+
let floorWidth = floorSize.x;
|
|
20854
|
+
let floorLength = floorSize.z;
|
|
20855
|
+
if (direction === FloorPatternDirection.STANDING) {
|
|
20856
|
+
floorWidth = floorSize.z;
|
|
20857
|
+
floorLength = floorSize.x;
|
|
20858
|
+
}
|
|
20859
|
+
switch (floorPattern) {
|
|
20860
|
+
case FloorPattern.NORMAL:
|
|
20861
|
+
return this._normalPattern(plankSize, floorWidth, floorLength, floorRotation);
|
|
20862
|
+
case FloorPattern.HERRINGBONE:
|
|
20863
|
+
return this._herringBone(plankSize, floorWidth, floorLength, floorRotation);
|
|
20864
|
+
case FloorPattern.HON45:
|
|
20865
|
+
return this._hon(plankSize, floorWidth, floorLength, floorRotation, 45);
|
|
20866
|
+
case FloorPattern.HON60:
|
|
20867
|
+
return this._hon(plankSize, floorWidth, floorLength, floorRotation, 60);
|
|
20868
|
+
}
|
|
20869
|
+
}
|
|
20870
|
+
_rotatePatternOnZAxis(items, floorRotation) {
|
|
20871
|
+
if (floorRotation % 360 > 0) {
|
|
20872
|
+
items.forEach(item => {
|
|
20873
|
+
const radians = MathUtils.degToRad(floorRotation);
|
|
20874
|
+
const x = item.position.x;
|
|
20875
|
+
const z = item.position.z;
|
|
20876
|
+
item.position.x = x * Math.cos(radians) - z * Math.sin(radians);
|
|
20877
|
+
item.position.z = x * Math.sin(radians) + z * Math.cos(radians);
|
|
20878
|
+
});
|
|
20879
|
+
}
|
|
20880
|
+
}
|
|
20881
|
+
_normalPattern(plankSize, floorWidth, floorLength, floorRotation) {
|
|
20882
|
+
const items = [];
|
|
20883
|
+
const stepOffsetAmount = .4;
|
|
20884
|
+
const plankWidth = plankSize.x;
|
|
20885
|
+
const plankLength = plankSize.z;
|
|
20886
|
+
const offsetSteps = plankWidth / stepOffsetAmount;
|
|
20887
|
+
const rows = Math.ceil(floorLength / plankLength);
|
|
20888
|
+
const columns = Math.ceil(floorWidth / plankWidth);
|
|
20889
|
+
const centerOffsetX = (floorWidth / 2 * -1) + (plankWidth / 2);
|
|
20890
|
+
const centerOffsetZ = (floorLength / 2 * -1) + (plankLength / 2);
|
|
20891
|
+
let currentOffsetStep = 0;
|
|
20892
|
+
for (let row = 0; row < rows; row++) {
|
|
20893
|
+
if (currentOffsetStep > offsetSteps) {
|
|
20894
|
+
currentOffsetStep = 0;
|
|
20895
|
+
}
|
|
20896
|
+
const plankPosZ = (plankLength * row);
|
|
20897
|
+
const currentOffsetAmount = stepOffsetAmount * currentOffsetStep;
|
|
20898
|
+
const planks = currentOffsetStep > 0 ? columns + 1 : columns;
|
|
20899
|
+
for (let col = 0; col < planks; col++) {
|
|
20900
|
+
const plankPosX = (plankWidth * col) - currentOffsetAmount;
|
|
20901
|
+
items.push({
|
|
20902
|
+
position: new Vector3(plankPosX + centerOffsetX, 0, plankPosZ + centerOffsetZ),
|
|
20903
|
+
rotation: new Vector3(0, MathUtils.degToRad(floorRotation), 0),
|
|
20904
|
+
isLeft: true
|
|
20905
|
+
});
|
|
20906
|
+
}
|
|
20907
|
+
currentOffsetStep++;
|
|
20908
|
+
}
|
|
20909
|
+
this._rotatePatternOnZAxis(items, floorRotation);
|
|
20910
|
+
return items;
|
|
20911
|
+
}
|
|
20912
|
+
_herringBone(plankSize, floorWidth, floorLength, floorRotation) {
|
|
20913
|
+
const items = [];
|
|
20914
|
+
const herringBoneAngle = 45;
|
|
20915
|
+
const sqrt2 = Math.sqrt(2);
|
|
20916
|
+
const plankWidth = plankSize.x;
|
|
20917
|
+
const plankLength = plankSize.z;
|
|
20918
|
+
const offsetPlankPosX = plankWidth * sqrt2;
|
|
20919
|
+
const offsetPlankPosZ = plankLength * sqrt2;
|
|
20920
|
+
const columns = Math.ceil(floorWidth / (plankWidth * sqrt2));
|
|
20921
|
+
const rows = Math.ceil(floorLength / (plankLength * sqrt2) +
|
|
20922
|
+
// add extra rows so that there isn't a gap
|
|
20923
|
+
offsetPlankPosX * 2);
|
|
20924
|
+
const centerOffsetX = floorWidth / 2 * -1 + offsetPlankPosX / 4 - offsetPlankPosZ / 4;
|
|
20925
|
+
const centerOffsetZ = floorLength / 2 * -1 - offsetPlankPosX / 4;
|
|
20926
|
+
for (let column = 0; column < columns; column++) {
|
|
20927
|
+
const plankPosX = offsetPlankPosX * column;
|
|
20928
|
+
for (let row = 0; row < rows; row++) {
|
|
20929
|
+
const plankPosZ = offsetPlankPosZ * row;
|
|
20930
|
+
const plankLeft = {
|
|
20931
|
+
position: new Vector3(plankPosX + centerOffsetX, 0, plankPosZ + centerOffsetZ),
|
|
20932
|
+
rotation: new Vector3(0, MathUtils.degToRad(floorRotation + herringBoneAngle), 0),
|
|
20933
|
+
isLeft: true
|
|
20934
|
+
};
|
|
20935
|
+
const plankRight = {
|
|
20936
|
+
position: new Vector3(plankPosX + offsetPlankPosX / 2 + centerOffsetX, 0, plankPosZ + offsetPlankPosZ / 2 + centerOffsetZ),
|
|
20937
|
+
rotation: new Vector3(0, MathUtils.degToRad(floorRotation - herringBoneAngle), 0),
|
|
20938
|
+
isLeft: false
|
|
20939
|
+
};
|
|
20940
|
+
items.push(plankLeft, plankRight);
|
|
20941
|
+
}
|
|
20942
|
+
}
|
|
20943
|
+
this._rotatePatternOnZAxis(items, floorRotation);
|
|
20944
|
+
return items;
|
|
20945
|
+
}
|
|
20946
|
+
_hon(plankSize, floorWidth, floorLength, floorRotation, patternAngle) {
|
|
20947
|
+
const items = [];
|
|
20948
|
+
const patternAngleRad = MathUtils.degToRad(patternAngle);
|
|
20949
|
+
const plankWidth = plankSize.x;
|
|
20950
|
+
const plankLength = plankSize.z;
|
|
20951
|
+
const sin = Math.sin(patternAngleRad);
|
|
20952
|
+
const cos = Math.cos(patternAngleRad);
|
|
20953
|
+
const overlapValue = plankLength * cos;
|
|
20954
|
+
const rowExtendValue = plankWidth * cos;
|
|
20955
|
+
const offsetZ = plankLength * cos * 2;
|
|
20956
|
+
const offsetX = plankWidth * sin;
|
|
20957
|
+
const centerOffsetX = (floorWidth - offsetX) / 2 + overlapValue;
|
|
20958
|
+
const centerOffsetZ = (floorLength + rowExtendValue) / 2;
|
|
20959
|
+
const columns = Math.ceil(floorWidth / ((offsetX - overlapValue) * 2));
|
|
20960
|
+
const rows = Math.ceil((floorLength + rowExtendValue) / offsetZ);
|
|
20961
|
+
for (let column = 0; column < columns; column++) {
|
|
20962
|
+
const plankPosX = column * (offsetX - overlapValue) * 2;
|
|
20963
|
+
for (let row = 0; row < rows; row++) {
|
|
20964
|
+
const plankPosZ = row * offsetZ;
|
|
20965
|
+
const plankLeft = {
|
|
20966
|
+
position: new Vector3(plankPosX - centerOffsetX, 0, plankPosZ - centerOffsetZ),
|
|
20967
|
+
rotation: new Vector3(0, MathUtils.degToRad((90 - patternAngle) + floorRotation), 0),
|
|
20968
|
+
isLeft: true
|
|
20969
|
+
};
|
|
20970
|
+
const plankRight = {
|
|
20971
|
+
position: new Vector3(plankPosX + offsetX - overlapValue - centerOffsetX, 0, plankPosZ - centerOffsetZ),
|
|
20972
|
+
rotation: new Vector3(0, MathUtils.degToRad((90 + patternAngle) + floorRotation), 0),
|
|
20973
|
+
isLeft: false
|
|
20974
|
+
};
|
|
20975
|
+
items.push(plankLeft, plankRight);
|
|
20976
|
+
}
|
|
20977
|
+
}
|
|
20978
|
+
this._rotatePatternOnZAxis(items, floorRotation);
|
|
20979
|
+
return items;
|
|
20980
|
+
}
|
|
20981
|
+
}
|
|
20982
|
+
FloorPatternService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FloorPatternService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20983
|
+
FloorPatternService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FloorPatternService, providedIn: 'root' });
|
|
20984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FloorPatternService, decorators: [{
|
|
20985
|
+
type: Injectable,
|
|
20986
|
+
args: [{
|
|
20987
|
+
providedIn: 'root'
|
|
20988
|
+
}]
|
|
20989
|
+
}] });
|
|
20990
|
+
|
|
20604
20991
|
var __awaiter$H = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20605
20992
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
20606
20993
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -21058,6 +21445,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
21058
21445
|
}]
|
|
21059
21446
|
}], ctorParameters: function () { return [{ type: SceneService }]; } });
|
|
21060
21447
|
|
|
21448
|
+
class FloorTileIntersectionService {
|
|
21449
|
+
constructor(_sceneService) {
|
|
21450
|
+
this._sceneService = _sceneService;
|
|
21451
|
+
this._debug = false;
|
|
21452
|
+
this._edgeCollisionMargin = 0.05;
|
|
21453
|
+
}
|
|
21454
|
+
toggleDebug() {
|
|
21455
|
+
this._debug = !this._debug;
|
|
21456
|
+
}
|
|
21457
|
+
countTiles(floorMesh, floorPattern, geometry) {
|
|
21458
|
+
const result = {
|
|
21459
|
+
left: 0,
|
|
21460
|
+
right: 0,
|
|
21461
|
+
edge: 0,
|
|
21462
|
+
total: 0,
|
|
21463
|
+
};
|
|
21464
|
+
console.log(floorMesh.position);
|
|
21465
|
+
const { floorHits, edgeHits } = this._checkIntersection2(floorMesh, floorPattern, geometry);
|
|
21466
|
+
for (const floorHit of floorHits) {
|
|
21467
|
+
if (floorHit.isLeft) {
|
|
21468
|
+
result.left += 1;
|
|
21469
|
+
}
|
|
21470
|
+
else {
|
|
21471
|
+
result.right += 1;
|
|
21472
|
+
}
|
|
21473
|
+
}
|
|
21474
|
+
result.edge = edgeHits.length;
|
|
21475
|
+
result.total = floorHits.length;
|
|
21476
|
+
return result;
|
|
21477
|
+
}
|
|
21478
|
+
_checkIntersection2(floorMesh, floorPattern, geometry) {
|
|
21479
|
+
// const edgeColliders = this._generateEdgeColliders(floorMesh.geometry);
|
|
21480
|
+
const result = {
|
|
21481
|
+
floorHits: new Array(),
|
|
21482
|
+
edgeHits: new Array()
|
|
21483
|
+
};
|
|
21484
|
+
const bvh = new MeshBVH(geometry);
|
|
21485
|
+
const positionReference = new Object3D();
|
|
21486
|
+
for (const floorItem of floorPattern) {
|
|
21487
|
+
const pos = floorItem.position;
|
|
21488
|
+
positionReference.position.set(pos.x, pos.y, pos.z);
|
|
21489
|
+
positionReference.updateMatrixWorld();
|
|
21490
|
+
const floorWorldToBhv = new Matrix4()
|
|
21491
|
+
.copy(positionReference.matrixWorld)
|
|
21492
|
+
.invert()
|
|
21493
|
+
.multiply(floorMesh.matrixWorld);
|
|
21494
|
+
if (bvh.intersectsGeometry(floorMesh.geometry, floorWorldToBhv)) {
|
|
21495
|
+
result.floorHits.push(floorItem);
|
|
21496
|
+
// TODO: find solution for edge detection, this should work as it used the same logic as for the floor.
|
|
21497
|
+
// for (const edgeCollider of edgeColliders) {
|
|
21498
|
+
// const edgeWorldToBhv = new Matrix4()
|
|
21499
|
+
// .copy(positionReference.matrixWorld)
|
|
21500
|
+
// .invert()
|
|
21501
|
+
// .multiply(edgeCollider.matrixWorld);
|
|
21502
|
+
// if (bvh.intersectsGeometry(edgeCollider.geometry, edgeWorldToBhv)) {
|
|
21503
|
+
// result.edgeHits.push(floorItem);
|
|
21504
|
+
// }
|
|
21505
|
+
// }
|
|
21506
|
+
}
|
|
21507
|
+
}
|
|
21508
|
+
return result;
|
|
21509
|
+
}
|
|
21510
|
+
_generateEdgeColliders(floorGeom) {
|
|
21511
|
+
const edgeLinesGeom = new EdgesGeometry(floorGeom);
|
|
21512
|
+
const linePositions = edgeLinesGeom.getAttribute('position').array;
|
|
21513
|
+
const edges = new Array();
|
|
21514
|
+
for (let i = 0; i < linePositions.length; i += 6) {
|
|
21515
|
+
// store vector a and b (1 line pair), because we work in 2D we skip the y-axis which should be zero
|
|
21516
|
+
const vectorA = new Vector2(linePositions[i], linePositions[i + 2]);
|
|
21517
|
+
const vectorB = new Vector2(linePositions[i + 3], linePositions[i + 5]);
|
|
21518
|
+
// calculate center of line
|
|
21519
|
+
const position = new Vector2().lerpVectors(vectorA, vectorB, .5);
|
|
21520
|
+
// calculate length
|
|
21521
|
+
const length = vectorA.distanceTo(vectorB);
|
|
21522
|
+
// create normalised orientation
|
|
21523
|
+
const unitVector = new Vector2().subVectors(vectorB, vectorA).normalize();
|
|
21524
|
+
// rotation in radians
|
|
21525
|
+
const rotation = Math.atan2(unitVector.y, unitVector.x);
|
|
21526
|
+
// create edge line with volume
|
|
21527
|
+
const edgeGeom = new BoxGeometry(length, 0.1, this._edgeCollisionMargin);
|
|
21528
|
+
const edge = new Mesh(edgeGeom);
|
|
21529
|
+
// position edge
|
|
21530
|
+
edge.rotation.y = rotation * -1;
|
|
21531
|
+
edge.position.z = position.y;
|
|
21532
|
+
edge.position.x = position.x;
|
|
21533
|
+
// update bounding box value for correct collision
|
|
21534
|
+
edge.updateMatrixWorld();
|
|
21535
|
+
edge.geometry.computeBoundingBox();
|
|
21536
|
+
edge.geometry.boundingBox.applyMatrix4(edge.matrixWorld);
|
|
21537
|
+
// adds meshes to scene
|
|
21538
|
+
edges.push(edge);
|
|
21539
|
+
}
|
|
21540
|
+
if (this._debug) {
|
|
21541
|
+
const scene = this._sceneService.scene;
|
|
21542
|
+
for (const edge of edges) {
|
|
21543
|
+
edge.material = this._randomColMat();
|
|
21544
|
+
scene.add(edge);
|
|
21545
|
+
}
|
|
21546
|
+
}
|
|
21547
|
+
return edges;
|
|
21548
|
+
}
|
|
21549
|
+
_randomColMat() {
|
|
21550
|
+
const color = new Color(Math.random(), Math.random(), Math.random());
|
|
21551
|
+
return new MeshBasicMaterial({ color: color, wireframe: false, side: DoubleSide });
|
|
21552
|
+
}
|
|
21553
|
+
ngOnDestroy() {
|
|
21554
|
+
}
|
|
21555
|
+
}
|
|
21556
|
+
FloorTileIntersectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FloorTileIntersectionService, deps: [{ token: SceneService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
21557
|
+
FloorTileIntersectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FloorTileIntersectionService, providedIn: 'root' });
|
|
21558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FloorTileIntersectionService, decorators: [{
|
|
21559
|
+
type: Injectable,
|
|
21560
|
+
args: [{
|
|
21561
|
+
providedIn: 'root'
|
|
21562
|
+
}]
|
|
21563
|
+
}], ctorParameters: function () { return [{ type: SceneService }]; } });
|
|
21564
|
+
|
|
21061
21565
|
var __awaiter$G = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21062
21566
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21063
21567
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -21070,7 +21574,7 @@ var __awaiter$G = (this && this.__awaiter) || function (thisArg, _arguments, P,
|
|
|
21070
21574
|
const defaultPosition$1 = new Vector3(4, 0, 1);
|
|
21071
21575
|
const defaultRotation$1 = new Euler(0, Math.PI, 0);
|
|
21072
21576
|
class BuildFurnitureService {
|
|
21073
|
-
constructor(_dialog, _iOne, _threedSelectorService, _collisionManager, _messageBus, _dictionaryService, _hudService, _sceneService, _cameraService, _sceneEventService, _appEventService, _presetService, _itemService, _elementService, _permanentStoreService, _googleTagManager, _settingsService, _utilsService, _variationService, _appStateService, _errorService, _itemGroupService, _variationCacheService, _resizeService, _viewModeService, _floorService) {
|
|
21577
|
+
constructor(_dialog, _iOne, _threedSelectorService, _collisionManager, _messageBus, _dictionaryService, _hudService, _sceneService, _cameraService, _sceneEventService, _appEventService, _presetService, _itemService, _elementService, _permanentStoreService, _googleTagManager, _settingsService, _utilsService, _variationService, _appStateService, _errorService, _itemGroupService, _variationCacheService, _resizeService, _viewModeService, _floorService, _floorPatternService, _floorTileIntersectionService) {
|
|
21074
21578
|
this._dialog = _dialog;
|
|
21075
21579
|
this._iOne = _iOne;
|
|
21076
21580
|
this._threedSelectorService = _threedSelectorService;
|
|
@@ -21097,6 +21601,8 @@ class BuildFurnitureService {
|
|
|
21097
21601
|
this._resizeService = _resizeService;
|
|
21098
21602
|
this._viewModeService = _viewModeService;
|
|
21099
21603
|
this._floorService = _floorService;
|
|
21604
|
+
this._floorPatternService = _floorPatternService;
|
|
21605
|
+
this._floorTileIntersectionService = _floorTileIntersectionService;
|
|
21100
21606
|
this.toggleSelectedElement = new Subject();
|
|
21101
21607
|
this.configureModeChanged = new Subject();
|
|
21102
21608
|
this.buildFinished = new Subject();
|
|
@@ -21377,6 +21883,10 @@ class BuildFurnitureService {
|
|
|
21377
21883
|
const objectToExport = this._currentCustomFloorGroup ? this._currentCustomFloorGroup : this._itemService.items[0];
|
|
21378
21884
|
this._utilsService.showExportDialog(objectToExport);
|
|
21379
21885
|
}
|
|
21886
|
+
downloadUDSZforARIOS() {
|
|
21887
|
+
const objectToExport = this._currentCustomFloorGroup ? this._currentCustomFloorGroup : this._itemService.items[0];
|
|
21888
|
+
this._utilsService.downloadUSDZforARIOS(objectToExport);
|
|
21889
|
+
}
|
|
21380
21890
|
downloadScene() {
|
|
21381
21891
|
const assetPath = this._settingsService.settings.assetPath;
|
|
21382
21892
|
// The ground plane looks odd in renders.
|
|
@@ -21444,6 +21954,7 @@ class BuildFurnitureService {
|
|
|
21444
21954
|
}
|
|
21445
21955
|
this._answerSelected.length = 0;
|
|
21446
21956
|
this._hudService.updateSelectedItemHud();
|
|
21957
|
+
this._generateLayingPattern(item);
|
|
21447
21958
|
this.buildFinished.next(result);
|
|
21448
21959
|
if (result.resultType === ResultType.NoSelections) {
|
|
21449
21960
|
result.resultType = ResultType.ConfigurationFixed;
|
|
@@ -21454,6 +21965,126 @@ class BuildFurnitureService {
|
|
|
21454
21965
|
return result;
|
|
21455
21966
|
});
|
|
21456
21967
|
}
|
|
21968
|
+
_generateLayingPattern(floor) {
|
|
21969
|
+
const floorPatternInfo = this._generateFloorPatternInfo(floor);
|
|
21970
|
+
floor.restoreFloorObject();
|
|
21971
|
+
const meshLeft = this.full3DObjectToUse.children.find(m => m.name === floorPatternInfo.meshIdLeft);
|
|
21972
|
+
this._normalizeMesh(meshLeft);
|
|
21973
|
+
let meshRight = null;
|
|
21974
|
+
if (floorPatternInfo.meshIdRight !== null) {
|
|
21975
|
+
meshRight = this.full3DObjectToUse.children.find(m => m.name === floorPatternInfo.meshIdRight);
|
|
21976
|
+
this._normalizeMesh(meshRight);
|
|
21977
|
+
}
|
|
21978
|
+
const floorSize = floor.size;
|
|
21979
|
+
const plankSize = new Vector3();
|
|
21980
|
+
meshLeft.geometry.boundingBox.getSize(plankSize);
|
|
21981
|
+
const items = this._floorPatternService.generatePattern(floorPatternInfo.floorPattern, plankSize, floorSize, floorPatternInfo.floorPatternDirection);
|
|
21982
|
+
const itemAmount = (meshRight === null) ? items.length : items.length / 2;
|
|
21983
|
+
const material = floor.getMaterial();
|
|
21984
|
+
const planksLeft = new InstancedMesh(meshLeft.geometry, material, itemAmount);
|
|
21985
|
+
let planksRight;
|
|
21986
|
+
if (meshRight) {
|
|
21987
|
+
planksRight = new InstancedMesh(meshRight.geometry, material, itemAmount);
|
|
21988
|
+
}
|
|
21989
|
+
// assign transform to each item in instanced mesh
|
|
21990
|
+
const dummy = new Object3D();
|
|
21991
|
+
let matrixIndex = 0;
|
|
21992
|
+
for (let i = 0; i < items.length; i++) {
|
|
21993
|
+
const item = items[i];
|
|
21994
|
+
const targetPlankMesh = (item.isLeft) ? planksLeft : planksRight;
|
|
21995
|
+
const position = item.position;
|
|
21996
|
+
const rotation = item.rotation;
|
|
21997
|
+
dummy.position.set(position.x, position.y, position.z);
|
|
21998
|
+
dummy.rotation.set(rotation.x, rotation.y, rotation.z);
|
|
21999
|
+
dummy.updateMatrix();
|
|
22000
|
+
targetPlankMesh.setMatrixAt(matrixIndex, dummy.matrix);
|
|
22001
|
+
if (planksRight) {
|
|
22002
|
+
if (i !== 0 && (i % 2 !== 0)) {
|
|
22003
|
+
matrixIndex++;
|
|
22004
|
+
}
|
|
22005
|
+
}
|
|
22006
|
+
else {
|
|
22007
|
+
matrixIndex++;
|
|
22008
|
+
}
|
|
22009
|
+
}
|
|
22010
|
+
const customFloorWrapper = new Object3D();
|
|
22011
|
+
customFloorWrapper.add(planksLeft);
|
|
22012
|
+
if (planksRight)
|
|
22013
|
+
customFloorWrapper.add(planksRight);
|
|
22014
|
+
floor.floorObject = customFloorWrapper;
|
|
22015
|
+
// this._floorTileIntersectionService.toggleDebug();
|
|
22016
|
+
floor.metadata.floorCountResult = this._floorTileIntersectionService.countTiles(floor.floorMesh, items, meshLeft.geometry);
|
|
22017
|
+
}
|
|
22018
|
+
_generateFloorPatternInfo(item) {
|
|
22019
|
+
this._generateSelectedInMetadata(item);
|
|
22020
|
+
const info = {
|
|
22021
|
+
meshIdLeft: null,
|
|
22022
|
+
meshIdRight: null,
|
|
22023
|
+
floorPattern: FloorPattern.NORMAL,
|
|
22024
|
+
floorPatternDirection: FloorPatternDirection.LYING
|
|
22025
|
+
};
|
|
22026
|
+
const selected = item.metadata.selections;
|
|
22027
|
+
const afmeting = selected.find(s => s.question.toLowerCase() === 'plank afmeting');
|
|
22028
|
+
let afmetingString = afmeting.answer.toLowerCase();
|
|
22029
|
+
afmetingString = afmetingString.substr(afmetingString.lastIndexOf(' ') + 1);
|
|
22030
|
+
const legPatroonAnswer = selected.find(s => s.question.toLowerCase() === 'leg patroon').answer.toLowerCase();
|
|
22031
|
+
let legPatroonString = '';
|
|
22032
|
+
switch (true) {
|
|
22033
|
+
case legPatroonAnswer.indexOf('recht') !== -1:
|
|
22034
|
+
legPatroonString = '90';
|
|
22035
|
+
info.floorPattern = FloorPattern.NORMAL;
|
|
22036
|
+
break;
|
|
22037
|
+
case legPatroonAnswer.indexOf('graat') !== -1:
|
|
22038
|
+
legPatroonString = '90';
|
|
22039
|
+
info.floorPattern = FloorPattern.HERRINGBONE;
|
|
22040
|
+
break;
|
|
22041
|
+
case legPatroonAnswer.indexOf('60') !== -1:
|
|
22042
|
+
legPatroonString = '60';
|
|
22043
|
+
info.floorPattern = FloorPattern.HON60;
|
|
22044
|
+
break;
|
|
22045
|
+
case legPatroonAnswer.indexOf('45') !== -1:
|
|
22046
|
+
legPatroonString = '45';
|
|
22047
|
+
info.floorPattern = FloorPattern.HON45;
|
|
22048
|
+
break;
|
|
22049
|
+
}
|
|
22050
|
+
info.meshIdLeft = `${afmetingString}_${legPatroonString}`;
|
|
22051
|
+
if (info.floorPattern === FloorPattern.HON45 || info.floorPattern === FloorPattern.HON60) {
|
|
22052
|
+
info.meshIdRight = `r_${afmetingString}_${legPatroonString}`;
|
|
22053
|
+
}
|
|
22054
|
+
if (info.floorPattern === FloorPattern.HERRINGBONE) {
|
|
22055
|
+
info.meshIdRight = info.meshIdLeft;
|
|
22056
|
+
}
|
|
22057
|
+
const legRichtingAnswer = selected.find(s => s.question.toLowerCase() === 'leg richting').answer.toLowerCase();
|
|
22058
|
+
info.floorPatternDirection = (legRichtingAnswer.indexOf('verticaal') !== -1) ? FloorPatternDirection.STANDING : FloorPatternDirection.LYING;
|
|
22059
|
+
return info;
|
|
22060
|
+
}
|
|
22061
|
+
_generateSelectedInMetadata(item) {
|
|
22062
|
+
const cloneSelections = JSON.parse(JSON.stringify(this.selections));
|
|
22063
|
+
cloneSelections.forEach(s => {
|
|
22064
|
+
s.imageData = undefined;
|
|
22065
|
+
s.imageDataLastAnswer = undefined;
|
|
22066
|
+
if (s.addables) {
|
|
22067
|
+
s.addables.forEach(a => {
|
|
22068
|
+
a.imageData = undefined;
|
|
22069
|
+
});
|
|
22070
|
+
}
|
|
22071
|
+
});
|
|
22072
|
+
item.metadata.decos = Array.from(this._iOne.decoNodes);
|
|
22073
|
+
item.metadata.selections = cloneSelections;
|
|
22074
|
+
}
|
|
22075
|
+
_normalizeMesh(mesh) {
|
|
22076
|
+
const meshSize = new Vector3();
|
|
22077
|
+
mesh.geometry.computeBoundingBox();
|
|
22078
|
+
mesh.geometry.boundingBox.getSize(meshSize);
|
|
22079
|
+
if (meshSize.z > meshSize.x) {
|
|
22080
|
+
mesh.geometry.rotateY(Math.PI / 2);
|
|
22081
|
+
}
|
|
22082
|
+
mesh.geometry.center();
|
|
22083
|
+
mesh.geometry.computeBoundingBox();
|
|
22084
|
+
const center = new Vector3();
|
|
22085
|
+
mesh.geometry.boundingBox.getCenter(center);
|
|
22086
|
+
mesh.position.copy(center);
|
|
22087
|
+
}
|
|
21457
22088
|
_startToBuildFromConfigurator(metadata) {
|
|
21458
22089
|
return this.startToBuild(null, metadata);
|
|
21459
22090
|
}
|
|
@@ -22331,14 +22962,14 @@ class BuildFurnitureService {
|
|
|
22331
22962
|
}
|
|
22332
22963
|
}
|
|
22333
22964
|
}
|
|
22334
|
-
BuildFurnitureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BuildFurnitureService, deps: [{ token: i1$1.MatDialog }, { token: HomedecoratorConnectorService }, { token: ThreedselectorService }, { token: CollisionManagerService }, { token: MessageBusService }, { token: HomedecoratorDictionaryService }, { token: HudService }, { token: SceneService }, { token: CameraService }, { token: SceneEventService }, { token: HomedecoratorAppEventService }, { token: PresetsService }, { token: ItemService }, { token: ElementService }, { token: PermanentStoreService }, { token: GoogleTagManagerService }, { token: HomedecoratorSettingsService }, { token: UtilsService }, { token: VariationService }, { token: AppStateService }, { token: ErrorService }, { token: ItemGroupService }, { token: VariationCacheService }, { token: ResizeService }, { token: ViewModeService }, { token: FloorService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22965
|
+
BuildFurnitureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BuildFurnitureService, deps: [{ token: i1$1.MatDialog }, { token: HomedecoratorConnectorService }, { token: ThreedselectorService }, { token: CollisionManagerService }, { token: MessageBusService }, { token: HomedecoratorDictionaryService }, { token: HudService }, { token: SceneService }, { token: CameraService }, { token: SceneEventService }, { token: HomedecoratorAppEventService }, { token: PresetsService }, { token: ItemService }, { token: ElementService }, { token: PermanentStoreService }, { token: GoogleTagManagerService }, { token: HomedecoratorSettingsService }, { token: UtilsService }, { token: VariationService }, { token: AppStateService }, { token: ErrorService }, { token: ItemGroupService }, { token: VariationCacheService }, { token: ResizeService }, { token: ViewModeService }, { token: FloorService }, { token: FloorPatternService }, { token: FloorTileIntersectionService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22335
22966
|
BuildFurnitureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BuildFurnitureService, providedIn: 'root' });
|
|
22336
22967
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BuildFurnitureService, decorators: [{
|
|
22337
22968
|
type: Injectable,
|
|
22338
22969
|
args: [{
|
|
22339
22970
|
providedIn: 'root'
|
|
22340
22971
|
}]
|
|
22341
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: HomedecoratorConnectorService }, { type: ThreedselectorService }, { type: CollisionManagerService }, { type: MessageBusService }, { type: HomedecoratorDictionaryService }, { type: HudService }, { type: SceneService }, { type: CameraService }, { type: SceneEventService }, { type: HomedecoratorAppEventService }, { type: PresetsService }, { type: ItemService }, { type: ElementService }, { type: PermanentStoreService }, { type: GoogleTagManagerService }, { type: HomedecoratorSettingsService }, { type: UtilsService }, { type: VariationService }, { type: AppStateService }, { type: ErrorService }, { type: ItemGroupService }, { type: VariationCacheService }, { type: ResizeService }, { type: ViewModeService }, { type: FloorService }]; } });
|
|
22972
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: HomedecoratorConnectorService }, { type: ThreedselectorService }, { type: CollisionManagerService }, { type: MessageBusService }, { type: HomedecoratorDictionaryService }, { type: HudService }, { type: SceneService }, { type: CameraService }, { type: SceneEventService }, { type: HomedecoratorAppEventService }, { type: PresetsService }, { type: ItemService }, { type: ElementService }, { type: PermanentStoreService }, { type: GoogleTagManagerService }, { type: HomedecoratorSettingsService }, { type: UtilsService }, { type: VariationService }, { type: AppStateService }, { type: ErrorService }, { type: ItemGroupService }, { type: VariationCacheService }, { type: ResizeService }, { type: ViewModeService }, { type: FloorService }, { type: FloorPatternService }, { type: FloorTileIntersectionService }]; } });
|
|
22342
22973
|
|
|
22343
22974
|
var __awaiter$F = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22344
22975
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -27249,13 +27880,15 @@ class NewRenderService {
|
|
|
27249
27880
|
_getNewRenderImage(force = false) {
|
|
27250
27881
|
return __awaiter$x(this, void 0, void 0, function* () {
|
|
27251
27882
|
if (this._settingsService.settings.blenderRenderService) {
|
|
27252
|
-
this.
|
|
27253
|
-
|
|
27254
|
-
|
|
27255
|
-
|
|
27256
|
-
|
|
27257
|
-
|
|
27258
|
-
|
|
27883
|
+
const data = this._getDataForRender(force);
|
|
27884
|
+
this._handleAjaxBlenderRender(data);
|
|
27885
|
+
// this.messageService.emit(MessageType.ShowLoadingIndicator, {title: 'Rendering...'});
|
|
27886
|
+
// const renderInput = {
|
|
27887
|
+
// 'height': 800,
|
|
27888
|
+
// 'width': 1200,
|
|
27889
|
+
// 'sceneAssetId': this._settingsService.settings.productRenderSceneAssetId
|
|
27890
|
+
// };
|
|
27891
|
+
// await this._utilsService.prepRoomForRender(true, renderInput);
|
|
27259
27892
|
}
|
|
27260
27893
|
else {
|
|
27261
27894
|
const data = this._getDataForRender(force);
|
|
@@ -27268,6 +27901,25 @@ class NewRenderService {
|
|
|
27268
27901
|
}
|
|
27269
27902
|
});
|
|
27270
27903
|
}
|
|
27904
|
+
_handleAjaxBlenderRender(data) {
|
|
27905
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
|
27906
|
+
const result = yield axios({
|
|
27907
|
+
headers: {
|
|
27908
|
+
'Content-Type': 'application/json'
|
|
27909
|
+
},
|
|
27910
|
+
method: 'POST',
|
|
27911
|
+
data: JSON.stringify(data),
|
|
27912
|
+
url: `${this._settingsService.settings.newRenderParameters.host}:${this._settingsService.settings.newRenderParameters.port}/getBlenderRenderFromData`,
|
|
27913
|
+
responseType: 'json'
|
|
27914
|
+
});
|
|
27915
|
+
if (result.status === 200) {
|
|
27916
|
+
// const image = `data:${result.data.fileType};base64,${result.data.image}`;
|
|
27917
|
+
// this._showPreviewImage(result.data.image);
|
|
27918
|
+
// console.log(image);
|
|
27919
|
+
this.renderImageChanged.next(result.data.image);
|
|
27920
|
+
}
|
|
27921
|
+
});
|
|
27922
|
+
}
|
|
27271
27923
|
_handleAjaxRender(data) {
|
|
27272
27924
|
return __awaiter$x(this, void 0, void 0, function* () {
|
|
27273
27925
|
const result = yield axios({
|
|
@@ -27280,10 +27932,10 @@ class NewRenderService {
|
|
|
27280
27932
|
responseType: 'json'
|
|
27281
27933
|
});
|
|
27282
27934
|
if (result.status === 200) {
|
|
27283
|
-
const image = `data:${result.data.fileType};base64,${result.data.image}`;
|
|
27284
|
-
// this._showPreviewImage(image);
|
|
27935
|
+
// const image = `data:${result.data.fileType};base64,${result.data.image}`;
|
|
27936
|
+
// this._showPreviewImage(result.data.image);
|
|
27285
27937
|
// console.log(image);
|
|
27286
|
-
this.renderImageChanged.next(image);
|
|
27938
|
+
this.renderImageChanged.next(result.data.image);
|
|
27287
27939
|
}
|
|
27288
27940
|
});
|
|
27289
27941
|
}
|
|
@@ -27338,21 +27990,24 @@ class NewRenderService {
|
|
|
27338
27990
|
img.style.position = 'fixed';
|
|
27339
27991
|
img.style.top = '0';
|
|
27340
27992
|
img.style.left = '0';
|
|
27341
|
-
img.style.width = '800px';
|
|
27993
|
+
// img.style.width = '800px';
|
|
27342
27994
|
img.style.height = '600px';
|
|
27343
27995
|
img.style.zIndex = '10';
|
|
27344
27996
|
}
|
|
27345
27997
|
img.src = src;
|
|
27346
27998
|
}
|
|
27347
27999
|
_getDataForRender(force = false) {
|
|
28000
|
+
this._cameraService.camera.updateMatrixWorld(true);
|
|
28001
|
+
const camMatrix = Array.from(this._cameraService.camera.matrixWorld.elements);
|
|
27348
28002
|
const options = {
|
|
27349
28003
|
force: force,
|
|
27350
28004
|
width: this._settingsService.settings.newRenderParameters.imageWidth,
|
|
27351
28005
|
height: this._settingsService.settings.newRenderParameters.imageHeight,
|
|
28006
|
+
sceneAssetId: this._settingsService.settings.productRenderSceneAssetId,
|
|
27352
28007
|
max_samples: this._settingsService.settings.newRenderParameters.iterations,
|
|
27353
28008
|
cameraOptions: {
|
|
27354
28009
|
fov: this._cameraService.camera.fov,
|
|
27355
|
-
matrix:
|
|
28010
|
+
matrix: camMatrix
|
|
27356
28011
|
},
|
|
27357
28012
|
environmentOptions: {
|
|
27358
28013
|
hdri: this._settingsService.settings.newRenderParameters.hdri,
|
|
@@ -27862,7 +28517,37 @@ class SceneOptionsComponent {
|
|
|
27862
28517
|
}
|
|
27863
28518
|
}
|
|
27864
28519
|
SceneOptionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SceneOptionsComponent, deps: [{ token: SceneOptionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
27865
|
-
SceneOptionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SceneOptionsComponent, selector: "scene-options", ngImport: i0, template:
|
|
28520
|
+
SceneOptionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SceneOptionsComponent, selector: "scene-options", ngImport: i0, template: `
|
|
28521
|
+
<div class="buttons-wrapper">
|
|
28522
|
+
<div class="button-wrapper" *ngFor="let button of buttons">
|
|
28523
|
+
<div *ngIf="!!button.show">
|
|
28524
|
+
<button mat-raised-button matTooltip="{{(button.active ? button.tooltipActive : button.tooltip) | localize}}"
|
|
28525
|
+
[id]="button.elementId"
|
|
28526
|
+
[ngClass]="button.class"
|
|
28527
|
+
[class.active]="button.active"
|
|
28528
|
+
(click)="handleShowChildren($event, button)">
|
|
28529
|
+
<img *ngIf="button.image" [src]="button.image" />
|
|
28530
|
+
<mat-icon *ngIf="!button.image" class="homedecorator-material-icons" aria-hidden="true">{{ button.label }}</mat-icon>
|
|
28531
|
+
</button>
|
|
28532
|
+
<ng-container *ngIf="button.children">
|
|
28533
|
+
<div class="children-wrapper">
|
|
28534
|
+
<div *ngFor="let childButton of button.children" class="child-button-wrapper">
|
|
28535
|
+
<button [@showHideChild]=childButton.show mat-raised-button matTooltip="{{(childButton.active ? childButton.tooltipActive : childButton.tooltip) | localize}}"
|
|
28536
|
+
[id]="childButton.elementId"
|
|
28537
|
+
[ngClass]="'child-button ' + childButton.class"
|
|
28538
|
+
[class.active]="childButton.active"
|
|
28539
|
+
[class.show]="childButton.show"
|
|
28540
|
+
(click)="handleClick($event, childButton)">
|
|
28541
|
+
<img *ngIf="childButton.image" [src]="childButton.image" />
|
|
28542
|
+
<mat-icon *ngIf="!childButton.image" class="homedecorator-material-icons" aria-hidden="true">{{ childButton.label }}</mat-icon>
|
|
28543
|
+
</button>
|
|
28544
|
+
</div>
|
|
28545
|
+
</div>
|
|
28546
|
+
</ng-container>
|
|
28547
|
+
</div>
|
|
28548
|
+
</div>
|
|
28549
|
+
</div>
|
|
28550
|
+
`, isInline: true, styles: [":host{margin:0 5px}:host .buttons-wrapper{display:flex;flex-direction:row;align-items:center;grid-column-gap:5px;column-gap:5px}:host .button-wrapper{position:relative}:host .children-wrapper{display:flex;flex-direction:column;position:absolute;transform:translateY(calc(-100% - 50px));z-index:999}:host button{z-index:1}:host button img{pointer-events:none;width:100%;height:100%}:host button.active{box-shadow:none}:host button.circle{width:50px;height:50px;border-radius:50%}:host button.circle img{border-radius:50%}\n"], components: [{ type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "localize": LocalizePipe }, animations: [
|
|
27866
28551
|
trigger('showHideChild', [
|
|
27867
28552
|
state('true', style({ 'opacity': '1', 'visibility': 'visible' })),
|
|
27868
28553
|
state('false', style({ 'opacity': '0', 'visibility': 'hidden' })),
|
|
@@ -27873,7 +28558,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
27873
28558
|
type: Component,
|
|
27874
28559
|
args: [{
|
|
27875
28560
|
selector: 'scene-options',
|
|
27876
|
-
|
|
28561
|
+
template: `
|
|
28562
|
+
<div class="buttons-wrapper">
|
|
28563
|
+
<div class="button-wrapper" *ngFor="let button of buttons">
|
|
28564
|
+
<div *ngIf="!!button.show">
|
|
28565
|
+
<button mat-raised-button matTooltip="{{(button.active ? button.tooltipActive : button.tooltip) | localize}}"
|
|
28566
|
+
[id]="button.elementId"
|
|
28567
|
+
[ngClass]="button.class"
|
|
28568
|
+
[class.active]="button.active"
|
|
28569
|
+
(click)="handleShowChildren($event, button)">
|
|
28570
|
+
<img *ngIf="button.image" [src]="button.image" />
|
|
28571
|
+
<mat-icon *ngIf="!button.image" class="homedecorator-material-icons" aria-hidden="true">{{ button.label }}</mat-icon>
|
|
28572
|
+
</button>
|
|
28573
|
+
<ng-container *ngIf="button.children">
|
|
28574
|
+
<div class="children-wrapper">
|
|
28575
|
+
<div *ngFor="let childButton of button.children" class="child-button-wrapper">
|
|
28576
|
+
<button [@showHideChild]=childButton.show mat-raised-button matTooltip="{{(childButton.active ? childButton.tooltipActive : childButton.tooltip) | localize}}"
|
|
28577
|
+
[id]="childButton.elementId"
|
|
28578
|
+
[ngClass]="'child-button ' + childButton.class"
|
|
28579
|
+
[class.active]="childButton.active"
|
|
28580
|
+
[class.show]="childButton.show"
|
|
28581
|
+
(click)="handleClick($event, childButton)">
|
|
28582
|
+
<img *ngIf="childButton.image" [src]="childButton.image" />
|
|
28583
|
+
<mat-icon *ngIf="!childButton.image" class="homedecorator-material-icons" aria-hidden="true">{{ childButton.label }}</mat-icon>
|
|
28584
|
+
</button>
|
|
28585
|
+
</div>
|
|
28586
|
+
</div>
|
|
28587
|
+
</ng-container>
|
|
28588
|
+
</div>
|
|
28589
|
+
</div>
|
|
28590
|
+
</div>
|
|
28591
|
+
`,
|
|
27877
28592
|
styleUrls: [
|
|
27878
28593
|
'./scene-options.component.scss'
|
|
27879
28594
|
],
|
|
@@ -27980,7 +28695,7 @@ class ArGuiButtonsComponent {
|
|
|
27980
28695
|
}
|
|
27981
28696
|
}
|
|
27982
28697
|
ArGuiButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ArGuiButtonsComponent, deps: [{ token: HomedecoratorIconCacheService }, { token: ArService }], target: i0.ɵɵFactoryTarget.Component });
|
|
27983
|
-
ArGuiButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ArGuiButtonsComponent, selector: "ar-gui-buttons", ngImport: i0, template: "<div class=\"buttons-container\">\r\n <div class=\"button-container\" xmlns=\"http://www.w3.org/1999/html\">\r\n <button mat-mini-fab class=\"button-icon back\" (click)=\"endSession()\">\r\n <co-icon class=\"icon rotated\" [iconData]=\"iconService.getIcon(icon.
|
|
28698
|
+
ArGuiButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ArGuiButtonsComponent, selector: "ar-gui-buttons", ngImport: i0, template: "<div class=\"buttons-container\">\r\n <div class=\"button-container\" xmlns=\"http://www.w3.org/1999/html\">\r\n <button mat-mini-fab class=\"button-icon back\" (click)=\"endSession()\">\r\n <co-icon class=\"icon rotated\" [iconData]=\"iconService.getIcon(icon.Cross)\"></co-icon>\r\n </button>\r\n </div>\r\n\r\n <!--div class=\"button-container\" xmlns=\"http://www.w3.org/1999/html\">\r\n <button class=\"button-icon\" mat-mini-fab (click)=\"showConfigurator()\">\r\n <co-icon class=\"icon\" [iconData]=\"iconService.getIcon(icon.MagicWand)\"></co-icon>\r\n </button>\r\n </div-->\r\n</div>\r\n", styles: [".buttons-container{position:absolute;display:flex;right:15px;top:15px}.button-container{padding:20px}.button-icon{text-align:-webkit-center}.back{padding-right:3px}.icon{width:65%;height:65%;fill:#fff}.rotated{transform:rotate(90deg)}\n"], components: [{ type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.IconComponent, selector: "co-icon", inputs: ["icon", "iconData"] }] });
|
|
27984
28699
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ArGuiButtonsComponent, decorators: [{
|
|
27985
28700
|
type: Component,
|
|
27986
28701
|
args: [{
|
|
@@ -28492,7 +29207,7 @@ SelectionsSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
28492
29207
|
<mat-icon class="homedecorator-material-icons" aria-hidden="true">close</mat-icon>
|
|
28493
29208
|
</button>
|
|
28494
29209
|
</header>
|
|
28495
|
-
<div class="selections-content small-scrollbar">
|
|
29210
|
+
<div class="selections-content small-scrollbar" *ngIf="selections && selections.length > 0">
|
|
28496
29211
|
<ng-container *ngFor="let sel of selections; let index = index">
|
|
28497
29212
|
<rp-selections-summary-line
|
|
28498
29213
|
[selection]="sel"
|
|
@@ -28531,7 +29246,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
28531
29246
|
<mat-icon class="homedecorator-material-icons" aria-hidden="true">close</mat-icon>
|
|
28532
29247
|
</button>
|
|
28533
29248
|
</header>
|
|
28534
|
-
<div class="selections-content small-scrollbar">
|
|
29249
|
+
<div class="selections-content small-scrollbar" *ngIf="selections && selections.length > 0">
|
|
28535
29250
|
<ng-container *ngFor="let sel of selections; let index = index">
|
|
28536
29251
|
<rp-selections-summary-line
|
|
28537
29252
|
[selection]="sel"
|
|
@@ -35320,7 +36035,7 @@ class RoomPlannerComponent {
|
|
|
35320
36035
|
if (object.metadata) {
|
|
35321
36036
|
this.showContextMenu = false;
|
|
35322
36037
|
yield this._connectorAdapterService.initConnector(object.metadata.externalSettings ? object.metadata.externalSettings.settings : this.settingsService.settings, object.metadata.externalSettings ? object.metadata.externalSettings.name : undefined, false, object.metadata.externalSettings && object.metadata.externalSettings.externalSource ? object.metadata.externalSettings.externalSource.sourceId : null);
|
|
35323
|
-
const json = yield this._connectorService.addToCart(+object.metadata.goodId, object.metadata.goodType, 1, +object.metadata.itemId);
|
|
36038
|
+
const json = yield this._connectorService.addToCart(+object.metadata.goodId, object.metadata.goodType, 1, +object.metadata.itemId, !!(object.metadata.externalSettings && object.metadata.externalSettings.externalSource));
|
|
35324
36039
|
if (object.metadata.externalSettings) {
|
|
35325
36040
|
const externalSource = {
|
|
35326
36041
|
article: json,
|
|
@@ -38881,7 +39596,20 @@ class ThreedselectorComponent {
|
|
|
38881
39596
|
}
|
|
38882
39597
|
}
|
|
38883
39598
|
};
|
|
39599
|
+
const arIOSButton = {
|
|
39600
|
+
id: 3,
|
|
39601
|
+
elementId: 'standalone_ar_session',
|
|
39602
|
+
tooltip: 'START_AR_SESSION',
|
|
39603
|
+
order: 10,
|
|
39604
|
+
image: this._iconCacheService.getIconAsBase64(IconEnum.ArCircle),
|
|
39605
|
+
toggle: false,
|
|
39606
|
+
show: (yield this._arService.arIOSSupported()) &&
|
|
39607
|
+
this._settingsService.settings.options.showStandaloneARButton &&
|
|
39608
|
+
this._settingsService.settings.options.arEnabled,
|
|
39609
|
+
click: () => this._buildFurnitureService.downloadUDSZforARIOS()
|
|
39610
|
+
};
|
|
38884
39611
|
this._sceneOptionsService.addSceneOptionButton(arButton);
|
|
39612
|
+
this._sceneOptionsService.addSceneOptionButton(arIOSButton);
|
|
38885
39613
|
}
|
|
38886
39614
|
});
|
|
38887
39615
|
}
|
|
@@ -39046,7 +39774,7 @@ class ThreedselectorComponent {
|
|
|
39046
39774
|
}
|
|
39047
39775
|
_handleFirstBuildStandalone(item) {
|
|
39048
39776
|
return __awaiter$c(this, void 0, void 0, function* () {
|
|
39049
|
-
this._cameraService.moveCameraToFitObject(item);
|
|
39777
|
+
yield this._cameraService.moveCameraToFitObject(item);
|
|
39050
39778
|
if (this._settingsService.settings.options.cameraPositionFixed) {
|
|
39051
39779
|
this._rotationService.enableRotationFor(item);
|
|
39052
39780
|
}
|
|
@@ -39232,10 +39960,7 @@ class ThreedselectorComponent {
|
|
|
39232
39960
|
// }
|
|
39233
39961
|
const len = selection.decoNode ? selection.decoNode.connectors.length : 0;
|
|
39234
39962
|
for (let i = 0; i < len; i++) {
|
|
39235
|
-
|
|
39236
|
-
if (!conObject && this._selectedElementObject.parent) {
|
|
39237
|
-
conObject = this._selectedElementObject.parent.getObjectByName(selection.decoNode.connectors[i].connector);
|
|
39238
|
-
}
|
|
39963
|
+
const conObject = this._getConnectorObject(this._selectedElementObject, selection.decoNode.connectors[i].connector);
|
|
39239
39964
|
if (conObject && this._canShowAddButton(selection.decoNode.connectors[i], conObject)) {
|
|
39240
39965
|
this.editAddButtons.push(new CustomButton('', () => {
|
|
39241
39966
|
this._handleAddButtonClick(selection, selection.decoNode.connectors[i], this._selectedElementObject);
|
|
@@ -39258,6 +39983,23 @@ class ThreedselectorComponent {
|
|
|
39258
39983
|
});
|
|
39259
39984
|
}
|
|
39260
39985
|
}
|
|
39986
|
+
_getConnectorObject(obj, connector) {
|
|
39987
|
+
if (!obj) {
|
|
39988
|
+
return null;
|
|
39989
|
+
}
|
|
39990
|
+
const objFound = obj.getObjectByName(connector);
|
|
39991
|
+
if (objFound) {
|
|
39992
|
+
return objFound;
|
|
39993
|
+
}
|
|
39994
|
+
else {
|
|
39995
|
+
if (obj.parent) {
|
|
39996
|
+
return this._getConnectorObject(obj.parent, connector);
|
|
39997
|
+
}
|
|
39998
|
+
else {
|
|
39999
|
+
return null;
|
|
40000
|
+
}
|
|
40001
|
+
}
|
|
40002
|
+
}
|
|
39261
40003
|
_getOppositeConnectorParts(connector) {
|
|
39262
40004
|
const connectorPartsArr = connector.split('_');
|
|
39263
40005
|
connectorPartsArr.pop(); // remove number
|
|
@@ -40813,7 +41555,7 @@ var __awaiter$4 = (this && this.__awaiter) || function (thisArg, _arguments, P,
|
|
|
40813
41555
|
});
|
|
40814
41556
|
};
|
|
40815
41557
|
class ModelPreviewComponent {
|
|
40816
|
-
constructor(data, settingsService, _dialogRef, _thirdPartyModelService, _messageService, _dialog, _adapterService) {
|
|
41558
|
+
constructor(data, settingsService, _dialogRef, _thirdPartyModelService, _messageService, _dialog, _adapterService, _lightPresetsService, _dictionaryService, _fontService) {
|
|
40817
41559
|
this.data = data;
|
|
40818
41560
|
this.settingsService = settingsService;
|
|
40819
41561
|
this._dialogRef = _dialogRef;
|
|
@@ -40821,8 +41563,21 @@ class ModelPreviewComponent {
|
|
|
40821
41563
|
this._messageService = _messageService;
|
|
40822
41564
|
this._dialog = _dialog;
|
|
40823
41565
|
this._adapterService = _adapterService;
|
|
41566
|
+
this._lightPresetsService = _lightPresetsService;
|
|
41567
|
+
this._dictionaryService = _dictionaryService;
|
|
41568
|
+
this._fontService = _fontService;
|
|
40824
41569
|
this.unitsOfMeasurement = 'cm';
|
|
40825
41570
|
this.mathPi = Math.PI;
|
|
41571
|
+
this.showReferenceModel = true;
|
|
41572
|
+
this.floorSizeHeight = 10;
|
|
41573
|
+
this.floorSizeWidth = 10;
|
|
41574
|
+
this.gridSize = 10;
|
|
41575
|
+
this.gridDivision = 10;
|
|
41576
|
+
this.distanceStep = 1;
|
|
41577
|
+
this.stackable = false;
|
|
41578
|
+
this.heightAdjustable = false;
|
|
41579
|
+
this._measurements = [];
|
|
41580
|
+
this.font = this._fontService.hudFont;
|
|
40826
41581
|
}
|
|
40827
41582
|
ngOnInit() {
|
|
40828
41583
|
this.initScene();
|
|
@@ -40856,44 +41611,50 @@ class ModelPreviewComponent {
|
|
|
40856
41611
|
this.rendererPreview.domElement.setAttribute('id', 'threed');
|
|
40857
41612
|
this.rendererPreview.setSize(window.innerWidth / 2, window.innerHeight / 2, true);
|
|
40858
41613
|
// init camera
|
|
40859
|
-
this.cameraPreview = new PerspectiveCamera(45, 1, 0.01,
|
|
41614
|
+
this.cameraPreview = new PerspectiveCamera(45, 1, 0.01, 100000000);
|
|
40860
41615
|
this.cameraPreview.position.set(0, 2, 10);
|
|
40861
41616
|
this.cameraPreview.aspect = window.innerWidth / window.innerHeight;
|
|
40862
41617
|
this.cameraPreview.updateProjectionMatrix();
|
|
40863
41618
|
this.controls = new OrbitControls(this.cameraPreview, this.rendererPreview.domElement);
|
|
40864
41619
|
this.controls.update();
|
|
40865
|
-
|
|
40866
|
-
|
|
40867
|
-
|
|
40868
|
-
|
|
40869
|
-
|
|
40870
|
-
|
|
40871
|
-
this.
|
|
40872
|
-
|
|
40873
|
-
|
|
41620
|
+
this.loadFloorPlane();
|
|
41621
|
+
this.loadReferenceModel();
|
|
41622
|
+
this.loadLights();
|
|
41623
|
+
const gridHelper = new GridHelper(this.gridSize, this.gridDivision);
|
|
41624
|
+
gridHelper.name = 'GridHelper';
|
|
41625
|
+
this.scenePreview.add(gridHelper);
|
|
41626
|
+
this._animate();
|
|
41627
|
+
}
|
|
41628
|
+
loadFloorPlane() {
|
|
41629
|
+
const planeGeometry = new PlaneGeometry(this.floorSizeWidth, this.floorSizeHeight);
|
|
41630
|
+
const planeMaterial = new MeshBasicMaterial({ color: 0x899499, side: THREE.DoubleSide });
|
|
40874
41631
|
const plane = new Mesh(planeGeometry, planeMaterial);
|
|
40875
41632
|
plane.rotation.x = -Math.PI / 2;
|
|
40876
41633
|
plane.position.y = 0;
|
|
40877
41634
|
plane.name = 'floor_plane';
|
|
40878
41635
|
this.scenePreview.add(plane);
|
|
40879
|
-
|
|
40880
|
-
|
|
40881
|
-
this.
|
|
40882
|
-
const
|
|
40883
|
-
|
|
40884
|
-
|
|
40885
|
-
|
|
40886
|
-
|
|
40887
|
-
|
|
40888
|
-
|
|
40889
|
-
|
|
40890
|
-
|
|
40891
|
-
|
|
40892
|
-
|
|
40893
|
-
|
|
40894
|
-
|
|
40895
|
-
|
|
40896
|
-
|
|
41636
|
+
}
|
|
41637
|
+
loadLights() {
|
|
41638
|
+
const listOfLightPresets = this._lightPresetsService.loadedLightPresets;
|
|
41639
|
+
const lightPreset = this._lightPresetsService.activeLightPreset;
|
|
41640
|
+
for (const lightProperties of lightPreset.lights) {
|
|
41641
|
+
this._createLightFromProperties(lightProperties);
|
|
41642
|
+
}
|
|
41643
|
+
}
|
|
41644
|
+
loadReferenceModel() {
|
|
41645
|
+
let referenceModelPath = '';
|
|
41646
|
+
const referenceModel = 'reference_pop.glb';
|
|
41647
|
+
if (this.settingsService.settings.threeDAssetPath) {
|
|
41648
|
+
referenceModelPath = this.settingsService.settings.threeDAssetPath + 'assets/';
|
|
41649
|
+
}
|
|
41650
|
+
const loader = new GLTFLoader();
|
|
41651
|
+
loader.load(referenceModelPath + referenceModel, (gltf) => __awaiter$4(this, void 0, void 0, function* () {
|
|
41652
|
+
gltf.scene.position.set(3, 0, 3);
|
|
41653
|
+
gltf.scene.castShadow = true;
|
|
41654
|
+
gltf.scene.receiveShadow = true;
|
|
41655
|
+
gltf.scene.name = 'Reference_model';
|
|
41656
|
+
this.scenePreview.add(gltf.scene);
|
|
41657
|
+
}));
|
|
40897
41658
|
}
|
|
40898
41659
|
loadModel(input) {
|
|
40899
41660
|
this.modelName = this._setModelName(input.file.file.name);
|
|
@@ -40910,6 +41671,9 @@ class ModelPreviewComponent {
|
|
|
40910
41671
|
else if (fileType === '3ds') {
|
|
40911
41672
|
this._tdsLoader(input);
|
|
40912
41673
|
}
|
|
41674
|
+
else if (fileType === 'stl') {
|
|
41675
|
+
this._stlLoader(input);
|
|
41676
|
+
}
|
|
40913
41677
|
}
|
|
40914
41678
|
loadHDRI(path) {
|
|
40915
41679
|
return new Promise((resolve, reject) => {
|
|
@@ -40929,11 +41693,10 @@ class ModelPreviewComponent {
|
|
|
40929
41693
|
// add timestamp
|
|
40930
41694
|
const timestamp = new Date().getTime();
|
|
40931
41695
|
const exportFileName = this._setModelName(this.glbExportName.nativeElement.value) + '_' + timestamp;
|
|
40932
|
-
const elementsToRemove = ['Reference_model', 'floor_plane'];
|
|
41696
|
+
const elementsToRemove = ['modelBoxhelper', 'Reference_model', 'floor_plane', 'GridHelper', 'Ambient', 'Directional front-left', 'spot back (anti-sun)', 'boxHeight', 'boxWidth', 'boxDepth'];
|
|
40933
41697
|
const gltfExporter = new GLTFExporter();
|
|
40934
41698
|
let scene;
|
|
40935
41699
|
scene = this.scenePreview.clone();
|
|
40936
|
-
scene.environment.dispose();
|
|
40937
41700
|
scene.children.forEach(c => {
|
|
40938
41701
|
if (c instanceof Light) {
|
|
40939
41702
|
scene.remove(c);
|
|
@@ -40958,7 +41721,8 @@ class ModelPreviewComponent {
|
|
|
40958
41721
|
else {
|
|
40959
41722
|
this._downloadModel(`${exportFileName}.glb`, file);
|
|
40960
41723
|
}
|
|
40961
|
-
}, () => {
|
|
41724
|
+
}, (e) => {
|
|
41725
|
+
console.log(e);
|
|
40962
41726
|
}, options);
|
|
40963
41727
|
}
|
|
40964
41728
|
scaleArticle() {
|
|
@@ -40987,9 +41751,33 @@ class ModelPreviewComponent {
|
|
|
40987
41751
|
}
|
|
40988
41752
|
this._getBoundingBox(model);
|
|
40989
41753
|
}
|
|
41754
|
+
moveModel(axis, amount) {
|
|
41755
|
+
const model = this.scenePreview.getObjectByName(this.modelName);
|
|
41756
|
+
if (axis === 'x') {
|
|
41757
|
+
model.position.x += amount;
|
|
41758
|
+
}
|
|
41759
|
+
else if (axis === 'y') {
|
|
41760
|
+
model.position.y += amount;
|
|
41761
|
+
}
|
|
41762
|
+
else if (axis === 'z') {
|
|
41763
|
+
model.position.z += amount;
|
|
41764
|
+
}
|
|
41765
|
+
this._getBoundingBox(model);
|
|
41766
|
+
}
|
|
40990
41767
|
setUnit(event) {
|
|
40991
41768
|
this.unitsOfMeasurement = event.value;
|
|
40992
41769
|
}
|
|
41770
|
+
toggleShowReferenceModel() {
|
|
41771
|
+
const model = this.scenePreview.getObjectByName('Reference_model');
|
|
41772
|
+
model.visible = !this.showReferenceModel;
|
|
41773
|
+
this.showReferenceModel = !this.showReferenceModel;
|
|
41774
|
+
}
|
|
41775
|
+
setStackable(event) {
|
|
41776
|
+
this.stackable = event.value;
|
|
41777
|
+
}
|
|
41778
|
+
setHeightAdjustable(event) {
|
|
41779
|
+
this.heightAdjustable = event.value;
|
|
41780
|
+
}
|
|
40993
41781
|
_animate() {
|
|
40994
41782
|
setTimeout(() => {
|
|
40995
41783
|
this.rendererPreview.setAnimationLoop((timestamp, frame) => this._render(timestamp, frame));
|
|
@@ -41011,21 +41799,29 @@ class ModelPreviewComponent {
|
|
|
41011
41799
|
}
|
|
41012
41800
|
_sendModelToCDN(fileName, blob) {
|
|
41013
41801
|
return __awaiter$4(this, void 0, void 0, function* () {
|
|
41014
|
-
|
|
41015
|
-
|
|
41016
|
-
|
|
41802
|
+
const reader = new FileReader();
|
|
41803
|
+
reader.readAsDataURL(blob);
|
|
41804
|
+
reader.onloadend = (event) => __awaiter$4(this, void 0, void 0, function* () {
|
|
41805
|
+
const fileAsString = FileUtils.StripMimeStringFromDataUri(event.target.result);
|
|
41806
|
+
this._adapterService.store3DModelCDN(fileName, fileAsString).then(filePath => {
|
|
41807
|
+
if (filePath) {
|
|
41808
|
+
this._blobToArrayBuffer(blob).then(file => {
|
|
41809
|
+
const hash = fileName;
|
|
41810
|
+
const modelUrl = filePath; // Set url from the CDN
|
|
41811
|
+
const configurationData = {};
|
|
41812
|
+
const priceData = {};
|
|
41813
|
+
const metaData = this._thirdPartyModelService.setMetadata(hash, modelUrl, configurationData);
|
|
41814
|
+
metaData.canElevate = this.heightAdjustable;
|
|
41815
|
+
metaData.thirdPartyModel = true;
|
|
41816
|
+
// We also can set the metadata here and pas it as the last argument for parseModelToGLB.
|
|
41817
|
+
this._thirdPartyModelService.parseModelToGLB(file, hash, modelUrl, configurationData, priceData, metaData).then(result => {
|
|
41818
|
+
this._dialog.closeAll();
|
|
41819
|
+
this._messageService.emit(MessageType.HideProductCatalog);
|
|
41820
|
+
});
|
|
41821
|
+
});
|
|
41822
|
+
}
|
|
41017
41823
|
});
|
|
41018
41824
|
});
|
|
41019
|
-
// const hash: string = fileName;
|
|
41020
|
-
// const modelUrl: string = ''; // Set url from the CDN
|
|
41021
|
-
// const configurationData: any = {};
|
|
41022
|
-
// const priceData: any = {};
|
|
41023
|
-
// // const metaData: Metadata = new Metadata();
|
|
41024
|
-
// // We also can set the metadata here and pas it as the last argument for parseModelToGLB.
|
|
41025
|
-
//
|
|
41026
|
-
// await this._thirdPartyModelService.parseModelToGLB(file, hash, modelUrl, configurationData, priceData);
|
|
41027
|
-
// this._dialog.closeAll();
|
|
41028
|
-
// this._messageService.emit(MessageType.HideProductCatalog);
|
|
41029
41825
|
});
|
|
41030
41826
|
}
|
|
41031
41827
|
_setModelName(name) {
|
|
@@ -41035,12 +41831,7 @@ class ModelPreviewComponent {
|
|
|
41035
41831
|
_glbLoader(input) {
|
|
41036
41832
|
const loader = new GLTFLoader();
|
|
41037
41833
|
loader.parse(input.file.fileContents, '', (object) => __awaiter$4(this, void 0, void 0, function* () {
|
|
41038
|
-
object.scene
|
|
41039
|
-
object.scene.position.set(0, 0, 0);
|
|
41040
|
-
object.scene.scale.set(1, 1, 1);
|
|
41041
|
-
this.scenePreview.add(object.scene);
|
|
41042
|
-
this.loadedModel = object.scene;
|
|
41043
|
-
this._getBoundingBox(object.scene);
|
|
41834
|
+
this._prepModelForScene(object.scene);
|
|
41044
41835
|
}), error => {
|
|
41045
41836
|
console.log('Parsing error');
|
|
41046
41837
|
});
|
|
@@ -41048,12 +41839,7 @@ class ModelPreviewComponent {
|
|
|
41048
41839
|
_fbxLoader(input) {
|
|
41049
41840
|
const fbxLoader = new FBXLoader();
|
|
41050
41841
|
const object = fbxLoader.parse(input.file.fileContents, '');
|
|
41051
|
-
|
|
41052
|
-
object.position.set(0, 0, 0);
|
|
41053
|
-
object.scale.set(1, 1, 1);
|
|
41054
|
-
this.scenePreview.add(object);
|
|
41055
|
-
this.loadedModel = object;
|
|
41056
|
-
this._getBoundingBox(object);
|
|
41842
|
+
this._prepModelForScene(object);
|
|
41057
41843
|
}
|
|
41058
41844
|
_objLoader(input) {
|
|
41059
41845
|
const objLoader = new OBJLoader();
|
|
@@ -41062,26 +41848,109 @@ class ModelPreviewComponent {
|
|
|
41062
41848
|
const decoder = new TextDecoder();
|
|
41063
41849
|
const str = decoder.decode(buf);
|
|
41064
41850
|
const object = objLoader.parse(str);
|
|
41065
|
-
|
|
41066
|
-
object.position.set(0, 0, 0);
|
|
41067
|
-
object.scale.set(1, 1, 1);
|
|
41068
|
-
this.scenePreview.add(object);
|
|
41069
|
-
this.loadedModel = object;
|
|
41070
|
-
this._getBoundingBox(object);
|
|
41851
|
+
this._prepModelForScene(object);
|
|
41071
41852
|
}
|
|
41072
41853
|
_tdsLoader(input) {
|
|
41073
41854
|
const tdsLoader = new TDSLoader();
|
|
41074
41855
|
const object = tdsLoader.parse(input.file.fileContents, '');
|
|
41856
|
+
object.traverse(element => {
|
|
41857
|
+
console.log(element);
|
|
41858
|
+
});
|
|
41859
|
+
this._prepModelForScene(object);
|
|
41860
|
+
}
|
|
41861
|
+
_stlLoader(input) {
|
|
41862
|
+
const stlLoader = new STLLoader();
|
|
41863
|
+
const object = stlLoader.parse(input.file.fileContents);
|
|
41864
|
+
this._addFromGeometry(object);
|
|
41865
|
+
}
|
|
41866
|
+
_addFromGeometry(geometry) {
|
|
41867
|
+
const material = new MeshPhongMaterial({ transparent: true, opacity: geometry.alpha });
|
|
41868
|
+
const model = new Mesh(geometry, material);
|
|
41869
|
+
this._prepModelForScene(model);
|
|
41870
|
+
}
|
|
41871
|
+
_prepModelForScene(object) {
|
|
41075
41872
|
object.name = this.modelName;
|
|
41076
41873
|
object.position.set(0, 0, 0);
|
|
41077
41874
|
object.scale.set(1, 1, 1);
|
|
41875
|
+
// Remove lights from the children
|
|
41876
|
+
object.children.forEach(c => {
|
|
41877
|
+
if (c instanceof Light) {
|
|
41878
|
+
object.remove(c);
|
|
41879
|
+
}
|
|
41880
|
+
});
|
|
41078
41881
|
this.scenePreview.add(object);
|
|
41079
41882
|
this.loadedModel = object;
|
|
41080
41883
|
this._getBoundingBox(object);
|
|
41081
41884
|
}
|
|
41082
41885
|
_getBoundingBox(object) {
|
|
41083
|
-
const boundingBox = new
|
|
41886
|
+
const boundingBox = new Box3().setFromObject(object);
|
|
41084
41887
|
this.boundingBoxSize = boundingBox.getSize(new Vector3());
|
|
41888
|
+
this._setMeasurements(this.boundingBoxSize);
|
|
41889
|
+
this._showMeasurements();
|
|
41890
|
+
const boxHelper = new BoxHelper(object);
|
|
41891
|
+
boxHelper.material.color.set(0xFF00FF);
|
|
41892
|
+
boxHelper.name = 'modelBoxhelper';
|
|
41893
|
+
this.scenePreview.add(boxHelper);
|
|
41894
|
+
}
|
|
41895
|
+
_showMeasurements() {
|
|
41896
|
+
const measurementsMeshes = this._measurements.map(value => value.textMesh);
|
|
41897
|
+
measurementsMeshes.forEach(object => this.scenePreview.add(object));
|
|
41898
|
+
}
|
|
41899
|
+
_setMeasurements(boundingBox) {
|
|
41900
|
+
const setHeight = this._createHeightMeasurement(boundingBox.y);
|
|
41901
|
+
this._measurements.push(setHeight);
|
|
41902
|
+
const setWidth = this._createWidthMeasurement(boundingBox.x);
|
|
41903
|
+
this._measurements.push(setWidth);
|
|
41904
|
+
const setDepth = this._createDepthMeasurement(boundingBox.z);
|
|
41905
|
+
this._measurements.push(setDepth);
|
|
41906
|
+
}
|
|
41907
|
+
_createHeightMeasurement(heightInput) {
|
|
41908
|
+
const height = new BoxMeasurement();
|
|
41909
|
+
const heightString = MeasurementUtils.makeText(heightInput, this.unitsOfMeasurement, this.distanceStep);
|
|
41910
|
+
const text = this._dictionaryService.get('LABEL_HEIGHT');
|
|
41911
|
+
height.textMesh = makeTextMesh(heightString, this.font, 0xFF00FF, 0.08, false, false, text);
|
|
41912
|
+
height.positions = this._calculateHeightPositions();
|
|
41913
|
+
height.textMesh.name = 'boxHeight';
|
|
41914
|
+
return height;
|
|
41915
|
+
}
|
|
41916
|
+
_createWidthMeasurement(widthInput) {
|
|
41917
|
+
const width = new BoxMeasurement();
|
|
41918
|
+
const widthString = MeasurementUtils.makeText(widthInput, this.unitsOfMeasurement, this.distanceStep);
|
|
41919
|
+
const text = this._dictionaryService.get('LABEL_WIDTH');
|
|
41920
|
+
width.textMesh = makeTextMesh(widthString, this.font, 0xFF00FF, 0.08, false, false, text);
|
|
41921
|
+
width.positions = this._calculateWidthPositions();
|
|
41922
|
+
width.textMesh.name = 'boxWidth';
|
|
41923
|
+
return width;
|
|
41924
|
+
}
|
|
41925
|
+
_createDepthMeasurement(depthInput) {
|
|
41926
|
+
const depth = new BoxMeasurement();
|
|
41927
|
+
const depthString = MeasurementUtils.makeText(depthInput, this.unitsOfMeasurement, this.distanceStep);
|
|
41928
|
+
const text = this._dictionaryService.get('LABEL_DEPTH');
|
|
41929
|
+
depth.textMesh = makeTextMesh(depthString, this.font, 0xFF00FF, 0.08, false, false, text);
|
|
41930
|
+
depth.positions = this._calculateDepthPositions();
|
|
41931
|
+
depth.textMesh.name = 'boxDepth';
|
|
41932
|
+
return depth;
|
|
41933
|
+
}
|
|
41934
|
+
_calculateHeightPositions() {
|
|
41935
|
+
return positioningFactors.map(([j, k]) => {
|
|
41936
|
+
return new THREE.Vector3()
|
|
41937
|
+
.addScaledVector(xDirection, j / 2 * this.boundingBoxSize.x)
|
|
41938
|
+
.addScaledVector(zDirection, k / 2 * this.boundingBoxSize.z);
|
|
41939
|
+
});
|
|
41940
|
+
}
|
|
41941
|
+
_calculateWidthPositions() {
|
|
41942
|
+
return positioningFactors.map(([j, k]) => {
|
|
41943
|
+
return new THREE.Vector3()
|
|
41944
|
+
.addScaledVector(yDirection, j / 2 * this.boundingBoxSize.y)
|
|
41945
|
+
.addScaledVector(zDirection, k / 2 * this.boundingBoxSize.z);
|
|
41946
|
+
});
|
|
41947
|
+
}
|
|
41948
|
+
_calculateDepthPositions() {
|
|
41949
|
+
return positioningFactors.map(([j, k]) => {
|
|
41950
|
+
return new THREE.Vector3()
|
|
41951
|
+
.addScaledVector(yDirection, j / 2 * this.boundingBoxSize.y)
|
|
41952
|
+
.addScaledVector(xDirection, k / 2 * this.boundingBoxSize.x);
|
|
41953
|
+
});
|
|
41085
41954
|
}
|
|
41086
41955
|
_blobToArrayBuffer(blob) {
|
|
41087
41956
|
return new Promise((resolve, reject) => {
|
|
@@ -41100,8 +41969,47 @@ class ModelPreviewComponent {
|
|
|
41100
41969
|
reader.readAsArrayBuffer(blob);
|
|
41101
41970
|
});
|
|
41102
41971
|
}
|
|
41972
|
+
_createLightFromProperties(lightProperties) {
|
|
41973
|
+
const lightType = lightProperties.type;
|
|
41974
|
+
const getLights = new LightCreateService();
|
|
41975
|
+
const light = getLights.createNewLight(lightType);
|
|
41976
|
+
light.userData.wallOffset = lightProperties.wallOffset;
|
|
41977
|
+
light.userData.rotationOffset = lightProperties.rotationOffset;
|
|
41978
|
+
light.userData.topDownDirectional = lightProperties.topDownDirectional;
|
|
41979
|
+
for (const property in lightProperties) {
|
|
41980
|
+
if (!light.hasOwnProperty(property)) {
|
|
41981
|
+
continue;
|
|
41982
|
+
}
|
|
41983
|
+
if (property === 'position') {
|
|
41984
|
+
light.position.y = lightProperties.position.y;
|
|
41985
|
+
}
|
|
41986
|
+
else if (property === 'color') {
|
|
41987
|
+
light.color = new Color(lightProperties.color);
|
|
41988
|
+
}
|
|
41989
|
+
else if (property === 'groundColor') {
|
|
41990
|
+
light.groundColor = new Color(lightProperties.groundColor);
|
|
41991
|
+
}
|
|
41992
|
+
else {
|
|
41993
|
+
this._setObjectProperties(light, property, lightProperties[property]);
|
|
41994
|
+
}
|
|
41995
|
+
}
|
|
41996
|
+
this.scenePreview.add(light);
|
|
41997
|
+
}
|
|
41998
|
+
_setObjectProperties(object, property, value) {
|
|
41999
|
+
if (property === 'shadow') {
|
|
42000
|
+
for (const prop in value) {
|
|
42001
|
+
if (!object[property].hasOwnProperty(prop)) {
|
|
42002
|
+
continue;
|
|
42003
|
+
}
|
|
42004
|
+
object[property][prop] = value[prop];
|
|
42005
|
+
}
|
|
42006
|
+
}
|
|
42007
|
+
else {
|
|
42008
|
+
object[property] = value;
|
|
42009
|
+
}
|
|
42010
|
+
}
|
|
41103
42011
|
}
|
|
41104
|
-
ModelPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ModelPreviewComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: HomedecoratorSettingsService }, { token: i1$1.MatDialogRef }, { token: ThirdPartyModelService }, { token: MessageBusService }, { token: i1$1.MatDialog }, { token: HomedecoratorConnectorAdapterService }], target: i0.ɵɵFactoryTarget.Component });
|
|
42012
|
+
ModelPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ModelPreviewComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: HomedecoratorSettingsService }, { token: i1$1.MatDialogRef }, { token: ThirdPartyModelService }, { token: MessageBusService }, { token: i1$1.MatDialog }, { token: HomedecoratorConnectorAdapterService }, { token: LightPresetsService }, { token: HomedecoratorDictionaryService }, { token: FontService }], target: i0.ɵɵFactoryTarget.Component });
|
|
41105
42013
|
ModelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ModelPreviewComponent, selector: "rp-model-preview", viewQueries: [{ propertyName: "glbExportName", first: true, predicate: ["fileName"], descendants: true }, { propertyName: "heightArticle", first: true, predicate: ["heightArticle"], descendants: true }], ngImport: i0, template: `
|
|
41106
42014
|
<div class="model-preview">
|
|
41107
42015
|
<div class="model-preview-container" id="canvasContainer">
|
|
@@ -41121,6 +42029,10 @@ ModelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
41121
42029
|
</div>
|
|
41122
42030
|
</div>
|
|
41123
42031
|
|
|
42032
|
+
<div>
|
|
42033
|
+
<button (click)="toggleShowReferenceModel()">Show Reference model</button>
|
|
42034
|
+
</div>
|
|
42035
|
+
|
|
41124
42036
|
<div class="rotation-button-container">
|
|
41125
42037
|
<p>Rotation</p>
|
|
41126
42038
|
<div class="rotation-x-buttons">
|
|
@@ -41137,6 +42049,23 @@ ModelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
41137
42049
|
</div>
|
|
41138
42050
|
</div>
|
|
41139
42051
|
|
|
42052
|
+
|
|
42053
|
+
<div class="rotation-button-container">
|
|
42054
|
+
<p>Positie</p>
|
|
42055
|
+
<div class="rotation-x-buttons">
|
|
42056
|
+
<button (click)="moveModel('x', 0.01)">x-as + 0.01</button>
|
|
42057
|
+
<button (click)="moveModel('x', -0.01)">x-as -0.01</button>
|
|
42058
|
+
</div>
|
|
42059
|
+
<div class="rotation-y-buttons">
|
|
42060
|
+
<button (click)="moveModel('y', 0.01)">y-as + 0.01</button>
|
|
42061
|
+
<button (click)="moveModel('y', -0.01)">y-as - 0.01</button>
|
|
42062
|
+
</div>
|
|
42063
|
+
<div class="rotation-z-buttons">
|
|
42064
|
+
<button (click)="moveModel('z', 0.01)">z-as + 0.01</button>
|
|
42065
|
+
<button (click)="moveModel('z', -0.01)">z-as -0.01</button>
|
|
42066
|
+
</div>
|
|
42067
|
+
</div>
|
|
42068
|
+
|
|
41140
42069
|
<div class="model-preview-info" *ngIf="this.data">
|
|
41141
42070
|
<div class="model-preview-info-container">
|
|
41142
42071
|
<div class="model-preview-info-left">
|
|
@@ -41146,14 +42075,35 @@ ModelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
41146
42075
|
<input type="text" id="fileName" #fileName value="{{ this.data.file.file.name }}">
|
|
41147
42076
|
</div>
|
|
41148
42077
|
</div>
|
|
42078
|
+
|
|
42079
|
+
<div class="model-preview-info-container">
|
|
42080
|
+
<div class="model-preview-info-left">
|
|
42081
|
+
<label>Stackable</label>
|
|
42082
|
+
</div>
|
|
42083
|
+
<div class="model-preview-info-right">
|
|
42084
|
+
<div class="mat-radio-wrapper">
|
|
42085
|
+
<mat-radio-group aria-label="Select an unit" (change)="setStackable($event)">
|
|
42086
|
+
<mat-radio-button [checked]="true" value="false">No</mat-radio-button>
|
|
42087
|
+
<mat-radio-button value="true">Yes</mat-radio-button>
|
|
42088
|
+
</mat-radio-group>
|
|
42089
|
+
</div>
|
|
42090
|
+
</div>
|
|
42091
|
+
</div>
|
|
42092
|
+
|
|
41149
42093
|
<div class="model-preview-info-container">
|
|
41150
42094
|
<div class="model-preview-info-left">
|
|
41151
|
-
<label>
|
|
42095
|
+
<label>Height adjustable</label>
|
|
41152
42096
|
</div>
|
|
41153
42097
|
<div class="model-preview-info-right">
|
|
41154
|
-
<
|
|
42098
|
+
<div class="mat-radio-wrapper">
|
|
42099
|
+
<mat-radio-group aria-label="Select an unit" (change)="setHeightAdjustable($event)">
|
|
42100
|
+
<mat-radio-button [checked]="true" value="false">No</mat-radio-button>
|
|
42101
|
+
<mat-radio-button value="true">Yes</mat-radio-button>
|
|
42102
|
+
</mat-radio-group>
|
|
42103
|
+
</div>
|
|
41155
42104
|
</div>
|
|
41156
42105
|
</div>
|
|
42106
|
+
|
|
41157
42107
|
<div class="model-preview-info-container">
|
|
41158
42108
|
<div class="model-preview-info-left">
|
|
41159
42109
|
<label>Extension</label>
|
|
@@ -41162,13 +42112,13 @@ ModelPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
41162
42112
|
<label>{{ this.data.file.fileType }}</label>
|
|
41163
42113
|
</div>
|
|
41164
42114
|
</div>
|
|
41165
|
-
<button class="exportButton" (click)="exportSceneAsGLB('upload')">
|
|
42115
|
+
<button class="exportButton" (click)="exportSceneAsGLB('upload')">Upload to CDN and add to scene</button>
|
|
41166
42116
|
<p></p>
|
|
41167
|
-
<button class="exportButton" (click)="exportSceneAsGLB('download')">Download</button>
|
|
42117
|
+
<button class="exportButton" (click)="exportSceneAsGLB('download')">Download model</button>
|
|
41168
42118
|
</div>
|
|
41169
42119
|
</div>
|
|
41170
42120
|
</div>
|
|
41171
|
-
`, isInline: true, styles: [".model-preview{display:flex;flex-direction:row}.model-preview .model-preview-actions{min-width:240px;box-sizing:border-box;padding:10px 20px;border-left:1px solid #5b6875}.model-preview .model-preview-actions .model-preview-info-container{margin-bottom:10px}.model-preview .model-preview-actions .model-preview-info-container .model-preview-info-left{font-weight:bolder}.model-preview .exportButton{cursor:pointer;color:#fff;background:#dda73f;border:1px solid #dda73f;border-radius:3px;box-sizing:border-box;padding:5px;display:flex;align-items:center}.model-preview .exportButton:hover{background:#dda73f;color:#fff}input{border:1px solid #5b6875;box-sizing:border-box;padding:3px 10px;border-radius:3px}.mat-radio-wrapper{margin:10px 0}mat-radio-group mat-radio-button{display:block}.rotation-button-container div{display:flex;justify-content:space-between;margin-bottom:10px}.rotation-button-container div button{cursor:pointer;color:#fff;background:#dda73f;border:1px solid #dda73f;border-radius:3px;box-sizing:border-box;padding:5px}.rotation-button-container div button:hover{background:#dda73f;color:#fff}\n"], components: [{ type:
|
|
42121
|
+
`, isInline: true, styles: [".model-preview{display:flex;flex-direction:row}.model-preview .model-preview-actions{min-width:240px;box-sizing:border-box;padding:10px 20px;border-left:1px solid #5b6875}.model-preview .model-preview-actions .model-preview-info-container{margin-bottom:10px}.model-preview .model-preview-actions .model-preview-info-container .model-preview-info-left{font-weight:bolder}.model-preview .exportButton{cursor:pointer;color:#fff;background:#dda73f;border:1px solid #dda73f;border-radius:3px;box-sizing:border-box;padding:5px;display:flex;align-items:center}.model-preview .exportButton:hover{background:#dda73f;color:#fff}input{border:1px solid #5b6875;box-sizing:border-box;padding:3px 10px;border-radius:3px}.mat-radio-wrapper{margin:10px 0}mat-radio-group mat-radio-button{display:block}.rotation-button-container div{display:flex;justify-content:space-between;margin-bottom:10px}.rotation-button-container div button{cursor:pointer;color:#fff;background:#dda73f;border:1px solid #dda73f;border-radius:3px;box-sizing:border-box;padding:5px}.rotation-button-container div button:hover{background:#dda73f;color:#fff}\n"], components: [{ type: i9$1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i9$1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
41172
42122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ModelPreviewComponent, decorators: [{
|
|
41173
42123
|
type: Component,
|
|
41174
42124
|
args: [{
|
|
@@ -41192,6 +42142,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
41192
42142
|
</div>
|
|
41193
42143
|
</div>
|
|
41194
42144
|
|
|
42145
|
+
<div>
|
|
42146
|
+
<button (click)="toggleShowReferenceModel()">Show Reference model</button>
|
|
42147
|
+
</div>
|
|
42148
|
+
|
|
41195
42149
|
<div class="rotation-button-container">
|
|
41196
42150
|
<p>Rotation</p>
|
|
41197
42151
|
<div class="rotation-x-buttons">
|
|
@@ -41208,6 +42162,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
41208
42162
|
</div>
|
|
41209
42163
|
</div>
|
|
41210
42164
|
|
|
42165
|
+
|
|
42166
|
+
<div class="rotation-button-container">
|
|
42167
|
+
<p>Positie</p>
|
|
42168
|
+
<div class="rotation-x-buttons">
|
|
42169
|
+
<button (click)="moveModel('x', 0.01)">x-as + 0.01</button>
|
|
42170
|
+
<button (click)="moveModel('x', -0.01)">x-as -0.01</button>
|
|
42171
|
+
</div>
|
|
42172
|
+
<div class="rotation-y-buttons">
|
|
42173
|
+
<button (click)="moveModel('y', 0.01)">y-as + 0.01</button>
|
|
42174
|
+
<button (click)="moveModel('y', -0.01)">y-as - 0.01</button>
|
|
42175
|
+
</div>
|
|
42176
|
+
<div class="rotation-z-buttons">
|
|
42177
|
+
<button (click)="moveModel('z', 0.01)">z-as + 0.01</button>
|
|
42178
|
+
<button (click)="moveModel('z', -0.01)">z-as -0.01</button>
|
|
42179
|
+
</div>
|
|
42180
|
+
</div>
|
|
42181
|
+
|
|
41211
42182
|
<div class="model-preview-info" *ngIf="this.data">
|
|
41212
42183
|
<div class="model-preview-info-container">
|
|
41213
42184
|
<div class="model-preview-info-left">
|
|
@@ -41217,14 +42188,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
41217
42188
|
<input type="text" id="fileName" #fileName value="{{ this.data.file.file.name }}">
|
|
41218
42189
|
</div>
|
|
41219
42190
|
</div>
|
|
42191
|
+
|
|
42192
|
+
<div class="model-preview-info-container">
|
|
42193
|
+
<div class="model-preview-info-left">
|
|
42194
|
+
<label>Stackable</label>
|
|
42195
|
+
</div>
|
|
42196
|
+
<div class="model-preview-info-right">
|
|
42197
|
+
<div class="mat-radio-wrapper">
|
|
42198
|
+
<mat-radio-group aria-label="Select an unit" (change)="setStackable($event)">
|
|
42199
|
+
<mat-radio-button [checked]="true" value="false">No</mat-radio-button>
|
|
42200
|
+
<mat-radio-button value="true">Yes</mat-radio-button>
|
|
42201
|
+
</mat-radio-group>
|
|
42202
|
+
</div>
|
|
42203
|
+
</div>
|
|
42204
|
+
</div>
|
|
42205
|
+
|
|
41220
42206
|
<div class="model-preview-info-container">
|
|
41221
42207
|
<div class="model-preview-info-left">
|
|
41222
|
-
<label>
|
|
42208
|
+
<label>Height adjustable</label>
|
|
41223
42209
|
</div>
|
|
41224
42210
|
<div class="model-preview-info-right">
|
|
41225
|
-
<
|
|
42211
|
+
<div class="mat-radio-wrapper">
|
|
42212
|
+
<mat-radio-group aria-label="Select an unit" (change)="setHeightAdjustable($event)">
|
|
42213
|
+
<mat-radio-button [checked]="true" value="false">No</mat-radio-button>
|
|
42214
|
+
<mat-radio-button value="true">Yes</mat-radio-button>
|
|
42215
|
+
</mat-radio-group>
|
|
42216
|
+
</div>
|
|
41226
42217
|
</div>
|
|
41227
42218
|
</div>
|
|
42219
|
+
|
|
41228
42220
|
<div class="model-preview-info-container">
|
|
41229
42221
|
<div class="model-preview-info-left">
|
|
41230
42222
|
<label>Extension</label>
|
|
@@ -41233,9 +42225,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
41233
42225
|
<label>{{ this.data.file.fileType }}</label>
|
|
41234
42226
|
</div>
|
|
41235
42227
|
</div>
|
|
41236
|
-
<button class="exportButton" (click)="exportSceneAsGLB('upload')">
|
|
42228
|
+
<button class="exportButton" (click)="exportSceneAsGLB('upload')">Upload to CDN and add to scene</button>
|
|
41237
42229
|
<p></p>
|
|
41238
|
-
<button class="exportButton" (click)="exportSceneAsGLB('download')">Download</button>
|
|
42230
|
+
<button class="exportButton" (click)="exportSceneAsGLB('download')">Download model</button>
|
|
41239
42231
|
</div>
|
|
41240
42232
|
</div>
|
|
41241
42233
|
</div>
|
|
@@ -41245,7 +42237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
41245
42237
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
41246
42238
|
type: Inject,
|
|
41247
42239
|
args: [MAT_DIALOG_DATA]
|
|
41248
|
-
}] }, { type: HomedecoratorSettingsService }, { type: i1$1.MatDialogRef }, { type: ThirdPartyModelService }, { type: MessageBusService }, { type: i1$1.MatDialog }, { type: HomedecoratorConnectorAdapterService }]; }, propDecorators: { glbExportName: [{
|
|
42240
|
+
}] }, { type: HomedecoratorSettingsService }, { type: i1$1.MatDialogRef }, { type: ThirdPartyModelService }, { type: MessageBusService }, { type: i1$1.MatDialog }, { type: HomedecoratorConnectorAdapterService }, { type: LightPresetsService }, { type: HomedecoratorDictionaryService }, { type: FontService }]; }, propDecorators: { glbExportName: [{
|
|
41249
42241
|
type: ViewChild,
|
|
41250
42242
|
args: ['fileName']
|
|
41251
42243
|
}], heightArticle: [{
|
|
@@ -41605,20 +42597,12 @@ ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
41605
42597
|
<mat-icon class="homedecorator-material-icons" matTooltip="{{'DOWNLOAD_ROOM_AS_GLB' | localize}}">cloud_download</mat-icon>
|
|
41606
42598
|
</button>
|
|
41607
42599
|
</ng-container>
|
|
42600
|
+
<div class="hd-toolbar-spacer"></div>
|
|
41608
42601
|
|
|
41609
|
-
|
|
41610
|
-
|
|
41611
|
-
|
|
41612
|
-
<!-- </button>-->
|
|
41613
|
-
<!-- </ng-container>-->
|
|
41614
|
-
|
|
41615
|
-
<!-- <ng-container>-->
|
|
41616
|
-
<!-- <button mat-icon-button (click)="testRender()">-->
|
|
41617
|
-
<!-- TEST-->
|
|
41618
|
-
<!-- </button>-->
|
|
41619
|
-
<!-- </ng-container>-->
|
|
42602
|
+
<!-- <ng-container>-->
|
|
42603
|
+
<!-- <rp-pdf-export></rp-pdf-export>-->
|
|
42604
|
+
<!-- </ng-container>-->
|
|
41620
42605
|
|
|
41621
|
-
<div class="hd-toolbar-spacer"></div>
|
|
41622
42606
|
<mat-nav-list class="toolbar__nav" role="list">
|
|
41623
42607
|
<div matTooltip="{{'NEW_ROOM' | localize}}">
|
|
41624
42608
|
<mat-list-item role="listitem" (click)="newRoom()">{{ 'NEW' | localize }}</mat-list-item>
|
|
@@ -41769,20 +42753,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
41769
42753
|
<mat-icon class="homedecorator-material-icons" matTooltip="{{'DOWNLOAD_ROOM_AS_GLB' | localize}}">cloud_download</mat-icon>
|
|
41770
42754
|
</button>
|
|
41771
42755
|
</ng-container>
|
|
42756
|
+
<div class="hd-toolbar-spacer"></div>
|
|
41772
42757
|
|
|
41773
|
-
|
|
41774
|
-
|
|
41775
|
-
|
|
41776
|
-
<!-- </button>-->
|
|
41777
|
-
<!-- </ng-container>-->
|
|
41778
|
-
|
|
41779
|
-
<!-- <ng-container>-->
|
|
41780
|
-
<!-- <button mat-icon-button (click)="testRender()">-->
|
|
41781
|
-
<!-- TEST-->
|
|
41782
|
-
<!-- </button>-->
|
|
41783
|
-
<!-- </ng-container>-->
|
|
42758
|
+
<!-- <ng-container>-->
|
|
42759
|
+
<!-- <rp-pdf-export></rp-pdf-export>-->
|
|
42760
|
+
<!-- </ng-container>-->
|
|
41784
42761
|
|
|
41785
|
-
<div class="hd-toolbar-spacer"></div>
|
|
41786
42762
|
<mat-nav-list class="toolbar__nav" role="list">
|
|
41787
42763
|
<div matTooltip="{{'NEW_ROOM' | localize}}">
|
|
41788
42764
|
<mat-list-item role="listitem" (click)="newRoom()">{{ 'NEW' | localize }}</mat-list-item>
|
|
@@ -42027,13 +43003,14 @@ class ModelUploaderComponent {
|
|
|
42027
43003
|
this.file = null;
|
|
42028
43004
|
this.fileMaxSize = 30; // file size in mb
|
|
42029
43005
|
this._maxFileSize = this.fileMaxSize * 1024 * 1024; // fileMaxSize to kb
|
|
42030
|
-
this._allowedFiles = ['glb', 'obj', 'fbx', '3ds', 'gltf'];
|
|
43006
|
+
this._allowedFiles = ['glb', 'obj', 'fbx', '3ds', 'gltf', 'stl'];
|
|
42031
43007
|
}
|
|
42032
43008
|
ngOnInit() {
|
|
42033
43009
|
}
|
|
42034
43010
|
ngOnDestroy() {
|
|
42035
43011
|
}
|
|
42036
43012
|
onChange(event) {
|
|
43013
|
+
this.showUploadError = false;
|
|
42037
43014
|
const file = event.target.files[0];
|
|
42038
43015
|
if (file) {
|
|
42039
43016
|
this.file = file;
|
|
@@ -42261,7 +43238,8 @@ class ProductCatalogComponent {
|
|
|
42261
43238
|
if (jsonString) {
|
|
42262
43239
|
const jsonObj = JSON.parse(jsonString);
|
|
42263
43240
|
if (jsonObj['hash'] !== undefined) {
|
|
42264
|
-
const customerName =
|
|
43241
|
+
const customerName = this.catalogInfo.username;
|
|
43242
|
+
// const customerName: string = 'Linteloo';
|
|
42265
43243
|
// three main api urls
|
|
42266
43244
|
const modelUrl = this.catalogInfo.externalSource.domain + '/models/' + jsonObj['hash'] + '/glb';
|
|
42267
43245
|
const configurationUrl = this.catalogInfo.externalSource.domain + '/configurationData/' + jsonObj['hash'];
|
|
@@ -44812,6 +45790,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
44812
45790
|
}]
|
|
44813
45791
|
}] });
|
|
44814
45792
|
|
|
45793
|
+
class ExportPdfComponent {
|
|
45794
|
+
constructor(_sceneService, _floorService, _messageBusService) {
|
|
45795
|
+
this._sceneService = _sceneService;
|
|
45796
|
+
this._floorService = _floorService;
|
|
45797
|
+
this._messageBusService = _messageBusService;
|
|
45798
|
+
this._subs = [];
|
|
45799
|
+
this._diagramBackground = '';
|
|
45800
|
+
this._subs.push(this._messageBusService.subscribe(MessageType.LoadScaledDiagram, (input) => this.setDiagramBackground(input)));
|
|
45801
|
+
}
|
|
45802
|
+
ngOnDestroy() {
|
|
45803
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
45804
|
+
}
|
|
45805
|
+
getFloor() {
|
|
45806
|
+
const activeFloor = this._floorService.floorToConfigure.metadata;
|
|
45807
|
+
const output = [];
|
|
45808
|
+
if (activeFloor) {
|
|
45809
|
+
const floorCountResult = activeFloor.floorCountResult;
|
|
45810
|
+
output.push(['Planken links', floorCountResult.left.toString()]);
|
|
45811
|
+
output.push(['Planken rechts', floorCountResult.right.toString()]);
|
|
45812
|
+
output.push(['Hoek', floorCountResult.edge.toString()]);
|
|
45813
|
+
output.push(['Totaal aantal planken', floorCountResult.total.toString()]);
|
|
45814
|
+
const selectedSelections = activeFloor.selections;
|
|
45815
|
+
for (const selectedSelection of selectedSelections) {
|
|
45816
|
+
if (selectedSelection.commercialAnswer !== undefined) {
|
|
45817
|
+
output.push([selectedSelection.commercialQuestion, selectedSelection.commercialAnswer]);
|
|
45818
|
+
}
|
|
45819
|
+
}
|
|
45820
|
+
console.log(output);
|
|
45821
|
+
}
|
|
45822
|
+
return output;
|
|
45823
|
+
}
|
|
45824
|
+
generatePdf() {
|
|
45825
|
+
// get all data
|
|
45826
|
+
const sceneImage = this._createSceneScreenshot();
|
|
45827
|
+
const doc = new jsPDF();
|
|
45828
|
+
const dataList = this.getFloor();
|
|
45829
|
+
const dataListLength = dataList.length;
|
|
45830
|
+
autoTable(doc, {
|
|
45831
|
+
head: [['Header', 'Value']],
|
|
45832
|
+
body: dataList,
|
|
45833
|
+
bodyStyles: { minCellHeight: 10 }
|
|
45834
|
+
});
|
|
45835
|
+
doc.addPage();
|
|
45836
|
+
doc.addImage(sceneImage, 'JPEG', 0, 0, 210, 117); // size is in mm not pixels!
|
|
45837
|
+
if (this._diagramBackground !== '') {
|
|
45838
|
+
doc.addPage();
|
|
45839
|
+
const offsetYImageTwo = 30 + 125 + (dataListLength * 10);
|
|
45840
|
+
doc.addImage(this._diagramBackground, 'JPEG', 0, 0, 210, 117); // size is in mm not pixels!
|
|
45841
|
+
}
|
|
45842
|
+
doc.save('sample.pdf');
|
|
45843
|
+
}
|
|
45844
|
+
setDiagramBackground(input) {
|
|
45845
|
+
this._diagramBackground = input.background.src;
|
|
45846
|
+
}
|
|
45847
|
+
_createSceneScreenshot() {
|
|
45848
|
+
return this._sceneService.createRenderWithOrthographicCamera();
|
|
45849
|
+
// return this._sceneService.getSceneCanvasImage();
|
|
45850
|
+
}
|
|
45851
|
+
}
|
|
45852
|
+
ExportPdfComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ExportPdfComponent, deps: [{ token: SceneService }, { token: FloorService }, { token: MessageBusService }], target: i0.ɵɵFactoryTarget.Component });
|
|
45853
|
+
ExportPdfComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ExportPdfComponent, selector: "rp-pdf-export", ngImport: i0, template: `
|
|
45854
|
+
<div>
|
|
45855
|
+
<button (click)="generatePdf()">Generate PDF</button>
|
|
45856
|
+
</div>
|
|
45857
|
+
`, isInline: true, styles: [":host .mat-dialog-content{margin:0;padding:0;overflow:hidden}:host .mat-nav-list{display:flex;flex-direction:column}.mat-dialog-actions{margin-bottom:0}.item-description{white-space:inherit!important}\n"] });
|
|
45858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ExportPdfComponent, decorators: [{
|
|
45859
|
+
type: Component,
|
|
45860
|
+
args: [{
|
|
45861
|
+
selector: 'rp-pdf-export',
|
|
45862
|
+
template: `
|
|
45863
|
+
<div>
|
|
45864
|
+
<button (click)="generatePdf()">Generate PDF</button>
|
|
45865
|
+
</div>
|
|
45866
|
+
`,
|
|
45867
|
+
styleUrls: ['./pdf-export.component.scss']
|
|
45868
|
+
}]
|
|
45869
|
+
}], ctorParameters: function () { return [{ type: SceneService }, { type: FloorService }, { type: MessageBusService }]; } });
|
|
45870
|
+
|
|
45871
|
+
class ExportPdfModule {
|
|
45872
|
+
}
|
|
45873
|
+
ExportPdfModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ExportPdfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
45874
|
+
ExportPdfModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ExportPdfModule, declarations: [ExportPdfComponent], imports: [CoreModule,
|
|
45875
|
+
CommonModule,
|
|
45876
|
+
MatDialogModule,
|
|
45877
|
+
MatListModule], exports: [ExportPdfComponent] });
|
|
45878
|
+
ExportPdfModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ExportPdfModule, imports: [[
|
|
45879
|
+
CoreModule,
|
|
45880
|
+
CommonModule,
|
|
45881
|
+
MatDialogModule,
|
|
45882
|
+
MatListModule
|
|
45883
|
+
]] });
|
|
45884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ExportPdfModule, decorators: [{
|
|
45885
|
+
type: NgModule,
|
|
45886
|
+
args: [{
|
|
45887
|
+
imports: [
|
|
45888
|
+
CoreModule,
|
|
45889
|
+
CommonModule,
|
|
45890
|
+
MatDialogModule,
|
|
45891
|
+
MatListModule
|
|
45892
|
+
],
|
|
45893
|
+
exports: [
|
|
45894
|
+
ExportPdfComponent
|
|
45895
|
+
],
|
|
45896
|
+
declarations: [
|
|
45897
|
+
ExportPdfComponent
|
|
45898
|
+
]
|
|
45899
|
+
}]
|
|
45900
|
+
}] });
|
|
45901
|
+
|
|
44815
45902
|
class ToolbarModule {
|
|
44816
45903
|
}
|
|
44817
45904
|
ToolbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -44853,7 +45940,8 @@ ToolbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
44853
45940
|
IconModule,
|
|
44854
45941
|
MatBadgeModule,
|
|
44855
45942
|
ThreedInPhotoModule,
|
|
44856
|
-
PdfViewerModule
|
|
45943
|
+
PdfViewerModule,
|
|
45944
|
+
ExportPdfModule], exports: [ToolbarComponent] });
|
|
44857
45945
|
ToolbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ToolbarModule, imports: [[
|
|
44858
45946
|
CoreModule,
|
|
44859
45947
|
CommonModule,
|
|
@@ -44882,7 +45970,8 @@ ToolbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
44882
45970
|
IconModule,
|
|
44883
45971
|
MatBadgeModule,
|
|
44884
45972
|
ThreedInPhotoModule,
|
|
44885
|
-
PdfViewerModule
|
|
45973
|
+
PdfViewerModule,
|
|
45974
|
+
ExportPdfModule
|
|
44886
45975
|
]] });
|
|
44887
45976
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ToolbarModule, decorators: [{
|
|
44888
45977
|
type: NgModule,
|
|
@@ -44915,7 +46004,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
44915
46004
|
IconModule,
|
|
44916
46005
|
MatBadgeModule,
|
|
44917
46006
|
ThreedInPhotoModule,
|
|
44918
|
-
PdfViewerModule
|
|
46007
|
+
PdfViewerModule,
|
|
46008
|
+
ExportPdfModule
|
|
44919
46009
|
],
|
|
44920
46010
|
entryComponents: [
|
|
44921
46011
|
LoadFromCloudDialogComponent,
|