@colijnit/configurator 1.0.20 → 1.0.21
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/.idea/Configurator.iml +12 -0
- package/.idea/codeStyles/Project.xml +21 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +9 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/angular.json +193 -0
- package/configurator.iml +11 -0
- package/dist/configurator/index.html +14 -0
- package/dist/configurator/main-es2015.js +3129 -0
- package/dist/configurator/main-es2015.js.map +1 -0
- package/dist/configurator/main-es5.js +5482 -0
- package/dist/configurator/main-es5.js.map +1 -0
- package/dist/configurator/polyfills-es2015.js +4520 -0
- package/dist/configurator/polyfills-es2015.js.map +1 -0
- package/dist/configurator/polyfills-es5.js +18375 -0
- package/dist/configurator/polyfills-es5.js.map +1 -0
- package/dist/configurator/runtime-es2015.js +155 -0
- package/dist/configurator/runtime-es2015.js.map +1 -0
- package/dist/configurator/runtime-es5.js +155 -0
- package/dist/configurator/runtime-es5.js.map +1 -0
- package/dist/configurator/styles-es2015.js +450 -0
- package/dist/configurator/styles-es2015.js.map +1 -0
- package/dist/configurator/styles-es5.js +432 -0
- package/dist/configurator/styles-es5.js.map +1 -0
- package/dist/configurator/vendor-es2015.js +155551 -0
- package/dist/configurator/vendor-es2015.js.map +1 -0
- package/dist/configurator/vendor-es5.js +183588 -0
- package/dist/configurator/vendor-es5.js.map +1 -0
- package/ng-package.json +9 -0
- package/package.json +47 -14
- package/src/app/app.component.ts +222 -0
- package/src/app/app.module.ts +34 -0
- package/src/app/builder.ts +480 -0
- package/src/app/components/answers/answer/answer.component.ts +61 -0
- package/src/app/components/answers/answers.component.ts +41 -0
- package/src/app/components/answers/answers.module.ts +26 -0
- package/src/app/components/selections/selections.component.ts +131 -0
- package/src/app/components/selections/selections.module.ts +20 -0
- package/src/app/components/shared/loader/loader.component.scss +33 -0
- package/src/app/components/shared/loader/loader.component.ts +20 -0
- package/src/app/components/shared/shared.module.ts +16 -0
- package/src/app/directives/visibility-observer-master.directive.ts +71 -0
- package/src/app/directives/visibility-observer.directive.ts +74 -0
- package/src/app/services/configurator.service.ts +86 -0
- package/src/app/services/image-cache.service.ts +56 -0
- package/src/app/services/locator.service.ts +6 -0
- package/src/environments/environment.prod.ts +3 -0
- package/src/environments/environment.ts +8 -0
- package/src/helper/variation-helper.ts +220 -0
- package/src/index.html +14 -0
- package/src/main.ts +11 -0
- package/src/model/material.ts +22 -0
- package/src/model/variation-settings.ts +14 -0
- package/src/model/variation.ts +11 -0
- package/src/polyfills.ts +73 -0
- package/{public_api.d.ts → src/public_api.ts} +6 -6
- package/src/style/shared.scss +173 -0
- package/src/style/styles.scss +45 -0
- package/src/tsconfig.app.json +16 -0
- package/src/tsconfig.spec.json +19 -0
- package/src/utils/asset.utils.ts +88 -0
- package/src/utils/file.utils.ts +156 -0
- package/src/utils/file.utils.unit.test.ts +8 -0
- package/src/utils/image.utils.ts +54 -0
- package/src/utils/object.utils.ts +52 -0
- package/src/utils/scene-utils.ts +119 -0
- package/src/utils/threed.utils.ts +219 -0
- package/src/utils/variation-utils.ts +216 -0
- package/tsconfig.json +23 -0
- package/tslint.json +132 -0
- package/app/builder.d.ts +0 -53
- package/app/components/answers/answer/answer.component.d.ts +0 -11
- package/app/components/answers/answers.component.d.ts +0 -8
- package/app/components/answers/answers.module.d.ts +0 -2
- package/app/components/selections/selections.component.d.ts +0 -22
- package/app/components/selections/selections.module.d.ts +0 -2
- package/app/components/shared/loader/loader.component.d.ts +0 -2
- package/app/components/shared/shared.module.d.ts +0 -2
- package/app/directives/visibility-observer-master.directive.d.ts +0 -9
- package/app/directives/visibility-observer.directive.d.ts +0 -13
- package/app/services/configurator.service.d.ts +0 -22
- package/app/services/image-cache.service.d.ts +0 -10
- package/app/services/locator.service.d.ts +0 -4
- package/bundles/colijnit-configurator.umd.js +0 -2745
- package/bundles/colijnit-configurator.umd.js.map +0 -1
- package/bundles/colijnit-configurator.umd.min.js +0 -17
- package/bundles/colijnit-configurator.umd.min.js.map +0 -1
- package/colijnit-configurator.d.ts +0 -10
- package/colijnit-configurator.metadata.json +0 -1
- package/esm2015/app/builder.js +0 -477
- package/esm2015/app/components/answers/answer/answer.component.js +0 -69
- package/esm2015/app/components/answers/answers.component.js +0 -43
- package/esm2015/app/components/answers/answers.module.js +0 -29
- package/esm2015/app/components/selections/selections.component.js +0 -134
- package/esm2015/app/components/selections/selections.module.js +0 -23
- package/esm2015/app/components/shared/loader/loader.component.js +0 -24
- package/esm2015/app/components/shared/shared.module.js +0 -21
- package/esm2015/app/directives/visibility-observer-master.directive.js +0 -51
- package/esm2015/app/directives/visibility-observer.directive.js +0 -57
- package/esm2015/app/services/configurator.service.js +0 -94
- package/esm2015/app/services/image-cache.service.js +0 -66
- package/esm2015/app/services/locator.service.js +0 -10
- package/esm2015/colijnit-configurator.js +0 -11
- package/esm2015/helper/variation-helper.js +0 -216
- package/esm2015/model/material.js +0 -11
- package/esm2015/model/variation-settings.js +0 -6
- package/esm2015/model/variation.js +0 -3
- package/esm2015/public_api.js +0 -7
- package/esm2015/utils/asset.utils.js +0 -74
- package/esm2015/utils/file.utils.js +0 -139
- package/esm2015/utils/image.utils.js +0 -52
- package/esm2015/utils/object.utils.js +0 -49
- package/esm2015/utils/scene-utils.js +0 -94
- package/esm2015/utils/threed.utils.js +0 -222
- package/esm2015/utils/variation-utils.js +0 -224
- package/esm5/app/builder.js +0 -591
- package/esm5/app/components/answers/answer/answer.component.js +0 -64
- package/esm5/app/components/answers/answers.component.js +0 -27
- package/esm5/app/components/answers/answers.module.js +0 -32
- package/esm5/app/components/selections/selections.component.js +0 -104
- package/esm5/app/components/selections/selections.module.js +0 -26
- package/esm5/app/components/shared/loader/loader.component.js +0 -16
- package/esm5/app/components/shared/shared.module.js +0 -24
- package/esm5/app/directives/visibility-observer-master.directive.js +0 -64
- package/esm5/app/directives/visibility-observer.directive.js +0 -59
- package/esm5/app/services/configurator.service.js +0 -160
- package/esm5/app/services/image-cache.service.js +0 -69
- package/esm5/app/services/locator.service.js +0 -13
- package/esm5/colijnit-configurator.js +0 -11
- package/esm5/helper/variation-helper.js +0 -268
- package/esm5/model/material.js +0 -13
- package/esm5/model/variation-settings.js +0 -8
- package/esm5/model/variation.js +0 -7
- package/esm5/public_api.js +0 -7
- package/esm5/utils/asset.utils.js +0 -106
- package/esm5/utils/file.utils.js +0 -151
- package/esm5/utils/image.utils.js +0 -56
- package/esm5/utils/object.utils.js +0 -56
- package/esm5/utils/scene-utils.js +0 -98
- package/esm5/utils/threed.utils.js +0 -279
- package/esm5/utils/variation-utils.js +0 -327
- package/fesm2015/colijnit-configurator.js +0 -2109
- package/fesm2015/colijnit-configurator.js.map +0 -1
- package/fesm5/colijnit-configurator.js +0 -2527
- package/fesm5/colijnit-configurator.js.map +0 -1
- package/helper/variation-helper.d.ts +0 -14
- package/model/material.d.ts +0 -17
- package/model/variation-settings.d.ts +0 -14
- package/model/variation.d.ts +0 -10
- package/utils/asset.utils.d.ts +0 -13
- package/utils/file.utils.d.ts +0 -27
- package/utils/image.utils.d.ts +0 -8
- package/utils/object.utils.d.ts +0 -7
- package/utils/scene-utils.d.ts +0 -7
- package/utils/threed.utils.d.ts +0 -16
- package/utils/variation-utils.d.ts +0 -12
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {DecoNodeType} from "@colijnit/configuratorapi/build/enum/deco-node-type.enum";
|
|
2
|
+
import {VariationSettings} from "../model/variation-settings";
|
|
3
|
+
import {AssetUtils} from "../utils/asset.utils";
|
|
4
|
+
import {DecoNode} from "@colijnit/configuratorapi/build/model/deco-node";
|
|
5
|
+
import {Variation} from "../model/variation";
|
|
6
|
+
import * as THREE from "three";
|
|
7
|
+
import {VariationUtils} from "../utils/variation-utils";
|
|
8
|
+
|
|
9
|
+
export class VariationHelper {
|
|
10
|
+
|
|
11
|
+
public assetPath: string;
|
|
12
|
+
|
|
13
|
+
private _lastKnownVariations: Map<string, Map<string, Variation[]>> = new Map();
|
|
14
|
+
|
|
15
|
+
public clearCache(): void {
|
|
16
|
+
const valueMap: Map<string, Variation[]>[] = Array.from(this._lastKnownVariations.values());
|
|
17
|
+
for (let i = 0; i < valueMap.length; i++) {
|
|
18
|
+
const values = Array.from(valueMap[i].values());
|
|
19
|
+
values.forEach((variations) => {
|
|
20
|
+
variations.forEach((variation) => {
|
|
21
|
+
variation.material.texture.dispose();
|
|
22
|
+
variation.material.normal.dispose();
|
|
23
|
+
variation.material.metalness.dispose();
|
|
24
|
+
variation.material.roughness.dispose();
|
|
25
|
+
variation.material.ao.dispose();
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async loadPart(obj: THREE.Object3D, parts: any[], usePbr: boolean = false): Promise<void> {
|
|
32
|
+
try {
|
|
33
|
+
const len: number = parts.length;
|
|
34
|
+
for (let i = 0; i < len; i++) {
|
|
35
|
+
if (parts[i].decoNode && parts[i].decoNode.gameObjectName && parts[i].decoNode.type === DecoNodeType.Part) {
|
|
36
|
+
const partSettings: VariationSettings =
|
|
37
|
+
await VariationUtils.LoadVariation(this.assetPath, parts[i].decoNode.gameObjectName || parts[i].decoId);
|
|
38
|
+
if (partSettings) {
|
|
39
|
+
const partVariation: Variation = new Variation();
|
|
40
|
+
partVariation.decoId = parseFloat(parts[i].decoNode.id);
|
|
41
|
+
partVariation.brandId = parts[i].decoNode.brandId;
|
|
42
|
+
partVariation.gameObjectName = parts[i].decoNode.gameObjectName;
|
|
43
|
+
partVariation.material = await AssetUtils.CreateMaterialFromAsset(partSettings);
|
|
44
|
+
// parts[i].variation = partVariation;
|
|
45
|
+
this._applyMaterialPart(obj, partVariation, parts[i].node, usePbr);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} catch (e) {
|
|
50
|
+
console.error(e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public async loadVariation(instanceId: string, obj: THREE.Object3D, parts: any[], usePbr: boolean = false): Promise<void> {
|
|
55
|
+
try {
|
|
56
|
+
const len: number = parts.length;
|
|
57
|
+
for (let i = 0; i < len; i++) {
|
|
58
|
+
const variations: DecoNode[] = parts[i].variations;
|
|
59
|
+
if (!variations || variations.length === 0) {
|
|
60
|
+
if (this._getLastKnownVariations(instanceId, parts[i].nodeId)) {
|
|
61
|
+
parts[i].variations = this._getLastKnownVariations(instanceId, parts[i].nodeId);
|
|
62
|
+
this._applyVariations(obj, parts[i], usePbr);
|
|
63
|
+
continue;
|
|
64
|
+
} else {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const lastKnownVariations: Variation[] = [];
|
|
69
|
+
for (let j = 0; j < variations.length; j++) {
|
|
70
|
+
const variationSettings: VariationSettings =
|
|
71
|
+
await VariationUtils.LoadVariation(this.assetPath, variations[j].gameObjectName || parts[i].decoId);
|
|
72
|
+
const newVariation: Variation = new Variation();
|
|
73
|
+
newVariation.decoId = parseFloat(variations[j].id);
|
|
74
|
+
newVariation.brandId = variations[j].brandId;
|
|
75
|
+
newVariation.gameObjectName = variations[j].gameObjectName;
|
|
76
|
+
newVariation.supplierArticleNr = (variations[j] as any).supplierArticleNr;
|
|
77
|
+
newVariation.materialId = (variations[j] as any).materialId;
|
|
78
|
+
newVariation.material = await AssetUtils.CreateMaterialFromAsset(variationSettings);
|
|
79
|
+
lastKnownVariations.push(newVariation);
|
|
80
|
+
}
|
|
81
|
+
this._setLastKnownVariations(instanceId, parts[i].nodeId, lastKnownVariations);
|
|
82
|
+
parts[i].variations = lastKnownVariations;
|
|
83
|
+
this._applyVariations(obj, parts[i], usePbr);
|
|
84
|
+
}
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error(e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private _getChildrenFilterByProp(obj: THREE.Object3D, userDataObjectProp: string, prop: string, value: any): THREE.Object3D[] {
|
|
91
|
+
return obj.children.filter((child) => {
|
|
92
|
+
return child.userData &&
|
|
93
|
+
child.userData.hasOwnProperty(userDataObjectProp) &&
|
|
94
|
+
child.userData[userDataObjectProp].hasOwnProperty(prop) &&
|
|
95
|
+
child.userData[userDataObjectProp][prop] === value;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private _applyMaterialPart(obj: THREE.Object3D, partMaterial: any, nodeId: any, usePbr: boolean = false): void {
|
|
100
|
+
const children = this._getChildrenFilterByProp(obj, 'selection', 'node', nodeId);
|
|
101
|
+
const len: number = children.length;
|
|
102
|
+
for (let i: number = 0; i < len; i++) {
|
|
103
|
+
const child = children[i];
|
|
104
|
+
if (child !== null && child !== undefined) {
|
|
105
|
+
child.traverse((mesh) => {
|
|
106
|
+
if (mesh instanceof THREE.Mesh && partMaterial) {
|
|
107
|
+
if (Array.isArray(mesh.material)) { // multimaterial support
|
|
108
|
+
for (let j = 0, jlen: number = mesh.material.length; j < jlen; j++) {
|
|
109
|
+
if (mesh.material[j].name.toLowerCase().indexOf('fixed_frame') !== -1) {
|
|
110
|
+
mesh.material[j] = this._setMeshMaterialFromVariation(mesh.material[j].name, partMaterial, usePbr);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
if (mesh.material.name.toLowerCase().indexOf('fixed_frame') !== -1) {
|
|
115
|
+
mesh.material = this._setMeshMaterialFromVariation(mesh.material.name, partMaterial, usePbr);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private _applyVariations(obj: THREE.Object3D, part: any, usePbr: boolean = false): void {
|
|
125
|
+
const children = this._getChildrenFilterByProp(obj, 'selection', 'node', part.node);
|
|
126
|
+
const len: number = children.length;
|
|
127
|
+
for (let i: number = 0; i < len; i++) {
|
|
128
|
+
const child = children[i];
|
|
129
|
+
if (child !== null && child !== undefined) {
|
|
130
|
+
child.traverse((mesh) => {
|
|
131
|
+
if (mesh instanceof THREE.Mesh && part.variations && part.variations.length > 0 && mesh.name.toLowerCase().indexOf('c_')) {
|
|
132
|
+
for (let j = 0; j < part.variations.length; j++) {
|
|
133
|
+
const variation: Variation = part.variations[j];
|
|
134
|
+
if (variation.material) {
|
|
135
|
+
const materialToSearch: string = !!variation.materialId ? variation.materialId.toLowerCase() : 'default';
|
|
136
|
+
if (Array.isArray(mesh.material)) { // multimaterial support
|
|
137
|
+
for (let m = 0, mlen: number = mesh.material.length; m < mlen; m++) {
|
|
138
|
+
if (mesh.material[m].name.toLowerCase().indexOf(materialToSearch) !== -1) {
|
|
139
|
+
mesh.material[m] = this._setMeshMaterialFromVariation(mesh.material[m].name, variation, usePbr);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
if (mesh.material.name.toLowerCase().indexOf(materialToSearch) !== -1) {
|
|
144
|
+
mesh.material = this._setMeshMaterialFromVariation(mesh.material.name, variation, usePbr);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private _setMeshMaterialFromVariation(name: string, variation: Variation, usePbr: boolean = false): THREE.Material {
|
|
156
|
+
if (variation.material.texture) {
|
|
157
|
+
variation.material.texture.needsUpdate = true;
|
|
158
|
+
}
|
|
159
|
+
if (!usePbr) {
|
|
160
|
+
const material: THREE.MeshPhongMaterial = new THREE.MeshPhongMaterial({
|
|
161
|
+
name: name,
|
|
162
|
+
shininess: variation.material.shininess,
|
|
163
|
+
specular: variation.material.specular,
|
|
164
|
+
map: variation.material.texture,
|
|
165
|
+
normalMap: variation.material.normal
|
|
166
|
+
});
|
|
167
|
+
// material.color.setRGB(0.8, 0.8, 0.8);
|
|
168
|
+
material.needsUpdate = true;
|
|
169
|
+
return material;
|
|
170
|
+
} else {
|
|
171
|
+
const params: THREE.MeshStandardMaterialParameters = {
|
|
172
|
+
// side: DoubleSide,
|
|
173
|
+
name: name,
|
|
174
|
+
roughness: variation.material.roughnessValue ? variation.material.roughnessValue : 1,
|
|
175
|
+
metalness: variation.material.metalnessValue ? variation.material.metalnessValue : 0,
|
|
176
|
+
// wireframe: true
|
|
177
|
+
};
|
|
178
|
+
if (variation.material.texture) {
|
|
179
|
+
params.map = variation.material.texture;
|
|
180
|
+
}
|
|
181
|
+
if (variation.material.ao) {
|
|
182
|
+
params.aoMap = variation.material.ao;
|
|
183
|
+
}
|
|
184
|
+
if (variation.material.roughness) {
|
|
185
|
+
params.roughnessMap = variation.material.roughness;
|
|
186
|
+
}
|
|
187
|
+
if (variation.material.metalness) {
|
|
188
|
+
params.metalnessMap = variation.material.metalness;
|
|
189
|
+
}
|
|
190
|
+
if (variation.material.normal) {
|
|
191
|
+
params.normalMap = variation.material.normal;
|
|
192
|
+
}
|
|
193
|
+
const material: THREE.MeshStandardMaterial = new THREE.MeshStandardMaterial(params);
|
|
194
|
+
material.color.setRGB(1, 1, 1);
|
|
195
|
+
material.needsUpdate = true;
|
|
196
|
+
return material;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
private _setLastKnownVariations(instanceId: string, id: string, variation: Variation[]): void {
|
|
201
|
+
if (this._lastKnownVariations.has(instanceId)) {
|
|
202
|
+
const variations = this._lastKnownVariations.get(instanceId);
|
|
203
|
+
variations.set(id, variation);
|
|
204
|
+
} else {
|
|
205
|
+
const variations: Map<string, Variation[]> = new Map();
|
|
206
|
+
this._lastKnownVariations.set(instanceId, variations.set(id, variation));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private _getLastKnownVariations(instanceId: string, id: string): Variation[] {
|
|
211
|
+
if (this._lastKnownVariations.has(instanceId)) {
|
|
212
|
+
const variations = this._lastKnownVariations.get(instanceId);
|
|
213
|
+
if (variations.has(id)) {
|
|
214
|
+
return variations.get(id);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
}
|
package/src/index.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Configurator</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<app-root></app-root>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { enableProdMode } from '@angular/core';
|
|
2
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
+
|
|
4
|
+
import { environment } from './environments/environment';
|
|
5
|
+
import {AppModule} from "./app/app.module";
|
|
6
|
+
|
|
7
|
+
if (environment.production) {
|
|
8
|
+
enableProdMode();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
export class Material {
|
|
4
|
+
|
|
5
|
+
public name: string;
|
|
6
|
+
public schema: string;
|
|
7
|
+
public specular: THREE.Color = new THREE.Color(0.3, 0.3, 0.3);
|
|
8
|
+
public shininess = 0;
|
|
9
|
+
// public roughness = 1;
|
|
10
|
+
// public metalness = 0.5;
|
|
11
|
+
public normal: THREE.Texture;
|
|
12
|
+
public texture: THREE.Texture;
|
|
13
|
+
public ao: THREE.Texture;
|
|
14
|
+
public metalness: THREE.Texture;
|
|
15
|
+
public roughness: THREE.Texture;
|
|
16
|
+
public repeatX = 4;
|
|
17
|
+
public repeatY = 4;
|
|
18
|
+
public loaded = false;
|
|
19
|
+
public metalnessValue: number;
|
|
20
|
+
public roughnessValue: number;
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class VariationSettings {
|
|
2
|
+
public id: string;
|
|
3
|
+
public settings: any = {};
|
|
4
|
+
public texture: string;
|
|
5
|
+
public textureFilename: string;
|
|
6
|
+
public normal: string;
|
|
7
|
+
public normalFilename: string;
|
|
8
|
+
public ao: string;
|
|
9
|
+
public aoFilename: string;
|
|
10
|
+
public metalness: string;
|
|
11
|
+
public metalnessFilename: string;
|
|
12
|
+
public roughness: string;
|
|
13
|
+
public roughnessFilename: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {Material} from './material';
|
|
2
|
+
|
|
3
|
+
export class Variation {
|
|
4
|
+
public decoId: number;
|
|
5
|
+
public brandId: string;
|
|
6
|
+
public gameObjectName: string;
|
|
7
|
+
public node: any;
|
|
8
|
+
public supplierArticleNr: string;
|
|
9
|
+
public materialId: string;
|
|
10
|
+
public material: Material;
|
|
11
|
+
}
|
package/src/polyfills.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
3
|
+
* You can add your own extra polyfills to this file.
|
|
4
|
+
*
|
|
5
|
+
* This file is divided into 2 sections:
|
|
6
|
+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
7
|
+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
8
|
+
* file.
|
|
9
|
+
*
|
|
10
|
+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
11
|
+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
|
12
|
+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
|
13
|
+
*
|
|
14
|
+
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/***************************************************************************************************
|
|
18
|
+
* BROWSER POLYFILLS
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
|
|
22
|
+
// import 'core-js/es6/symbol';
|
|
23
|
+
// import 'core-js/es6/object';
|
|
24
|
+
// import 'core-js/es6/function';
|
|
25
|
+
// import 'core-js/es6/parse-int';
|
|
26
|
+
// import 'core-js/es6/parse-float';
|
|
27
|
+
// import 'core-js/es6/number';
|
|
28
|
+
// import 'core-js/es6/math';
|
|
29
|
+
// import 'core-js/es6/string';
|
|
30
|
+
// import 'core-js/es6/date';
|
|
31
|
+
// import 'core-js/es6/array';
|
|
32
|
+
// import 'core-js/es6/regexp';
|
|
33
|
+
// import 'core-js/es6/map';
|
|
34
|
+
// import 'core-js/es6/weak-map';
|
|
35
|
+
// import 'core-js/es6/set';
|
|
36
|
+
|
|
37
|
+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
|
38
|
+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
39
|
+
|
|
40
|
+
/** IE10 and IE11 requires the following to support `@angular/animation`. */
|
|
41
|
+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/** Evergreen browsers require these. **/
|
|
45
|
+
import 'core-js/es6/reflect';
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
|
|
50
|
+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/***************************************************************************************************
|
|
55
|
+
* Zone JS is required by Angular itself.
|
|
56
|
+
*/
|
|
57
|
+
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/***************************************************************************************************
|
|
62
|
+
* APPLICATION IMPORTS
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Date, currency, decimal and percent pipes.
|
|
67
|
+
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
|
68
|
+
*/
|
|
69
|
+
// import 'intl'; // Run `npm install --save intl`.
|
|
70
|
+
/**
|
|
71
|
+
* Need to import at least one locale-data with intl.
|
|
72
|
+
*/
|
|
73
|
+
// import 'intl/locale-data/jsonp/en';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './app/builder';
|
|
2
|
-
export * from './app/services/configurator.service';
|
|
3
|
-
export * from './app/components/answers/answers.module';
|
|
4
|
-
export * from './app/components/answers/answers.component';
|
|
5
|
-
export * from './app/components/selections/selections.module';
|
|
6
|
-
export * from './app/components/selections/selections.component';
|
|
1
|
+
export * from './app/builder';
|
|
2
|
+
export * from './app/services/configurator.service';
|
|
3
|
+
export * from './app/components/answers/answers.module';
|
|
4
|
+
export * from './app/components/answers/answers.component';
|
|
5
|
+
export * from './app/components/selections/selections.module';
|
|
6
|
+
export * from './app/components/selections/selections.component';
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
.ione-configurator {
|
|
2
|
+
.rp-answers-slideout{
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
width: 400px;
|
|
7
|
+
height: fit-content;
|
|
8
|
+
}
|
|
9
|
+
.answers-title {
|
|
10
|
+
margin-left: 10px;
|
|
11
|
+
color: #1a1a1a;
|
|
12
|
+
}
|
|
13
|
+
.answers-container {
|
|
14
|
+
height: 100vh;
|
|
15
|
+
overflow-y: scroll;
|
|
16
|
+
}
|
|
17
|
+
.answer-content {
|
|
18
|
+
position: relative;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
border: 1px solid lightgray;
|
|
23
|
+
padding: 10px;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
border-radius: 3px;
|
|
27
|
+
margin-bottom: 3px;
|
|
28
|
+
box-shadow: 2px 1px rgba(211, 211, 211, 0.5);
|
|
29
|
+
background: white;
|
|
30
|
+
}
|
|
31
|
+
.thumbnail {
|
|
32
|
+
width: 54px;
|
|
33
|
+
min-width: 54px;
|
|
34
|
+
height: 54px;
|
|
35
|
+
min-height: 54px;
|
|
36
|
+
border: 1px solid #d3d3d3;
|
|
37
|
+
border-radius: 5px;
|
|
38
|
+
}
|
|
39
|
+
.img-size {
|
|
40
|
+
width: 54px;
|
|
41
|
+
min-width: 54px;
|
|
42
|
+
height: 54px;
|
|
43
|
+
min-height: 54px;
|
|
44
|
+
border-radius: 5px;
|
|
45
|
+
}
|
|
46
|
+
.unloaded {
|
|
47
|
+
background-color: lightgrey;
|
|
48
|
+
}
|
|
49
|
+
.answer-wrapper {
|
|
50
|
+
display: block;
|
|
51
|
+
}
|
|
52
|
+
.answer-title {
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
position: relative;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
.question {
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
color: #1a1a1a;
|
|
61
|
+
}
|
|
62
|
+
.answer {
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
font-style: italic;
|
|
65
|
+
margin-top: 3px;
|
|
66
|
+
}
|
|
67
|
+
.collapse-wrapper {
|
|
68
|
+
display: block;
|
|
69
|
+
}
|
|
70
|
+
.collapse-content {
|
|
71
|
+
display: block;
|
|
72
|
+
}
|
|
73
|
+
.collapse-handle {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 10px;
|
|
76
|
+
right: 12px;
|
|
77
|
+
border: solid black;
|
|
78
|
+
border-width: 0 3px 3px 0;
|
|
79
|
+
display: inline-block;
|
|
80
|
+
padding: 3px;
|
|
81
|
+
transform: rotate(45deg);
|
|
82
|
+
-webkit-transform: rotate(45deg);
|
|
83
|
+
&.expanded {
|
|
84
|
+
transform: rotate(-135deg);
|
|
85
|
+
-webkit-transform: rotate(-135deg);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
.child-selection {
|
|
89
|
+
margin-left: 10px;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
margin-top: 5px;
|
|
93
|
+
}
|
|
94
|
+
.mat-title {
|
|
95
|
+
margin-left: 10px;
|
|
96
|
+
color: #1a1a1a;
|
|
97
|
+
}
|
|
98
|
+
.drawer__header {
|
|
99
|
+
height: 48px;
|
|
100
|
+
}
|
|
101
|
+
.rp-selections-summary {
|
|
102
|
+
height: fit-content;
|
|
103
|
+
background: transparent;
|
|
104
|
+
overflow: auto;
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
width: 400px;
|
|
109
|
+
}
|
|
110
|
+
.selections-content {
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
}
|
|
113
|
+
.co-summary-line {
|
|
114
|
+
position: relative;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
font-size: 12px;
|
|
118
|
+
border: 1px solid lightgray;
|
|
119
|
+
padding: 10px;
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: row;
|
|
122
|
+
border-radius: 3px;
|
|
123
|
+
margin-bottom: 3px;
|
|
124
|
+
box-shadow: 2px 1px rgba(211, 211, 211, 0.5);
|
|
125
|
+
background: white;
|
|
126
|
+
}
|
|
127
|
+
.selection-thumbnail {
|
|
128
|
+
width: 54px;
|
|
129
|
+
min-width: 54px;
|
|
130
|
+
height: 54px;
|
|
131
|
+
min-height: 54px;
|
|
132
|
+
border: 1px solid #d3d3d3;
|
|
133
|
+
border-radius: 5px;
|
|
134
|
+
}
|
|
135
|
+
.selection-img {
|
|
136
|
+
width: 54px;
|
|
137
|
+
min-width: 54px;
|
|
138
|
+
height: 54px;
|
|
139
|
+
min-height: 54px;
|
|
140
|
+
border-radius: 5px;
|
|
141
|
+
}
|
|
142
|
+
.answer-thumbnail {
|
|
143
|
+
width: 54px;
|
|
144
|
+
min-width: 54px;
|
|
145
|
+
height: 54px;
|
|
146
|
+
min-height: 54px;
|
|
147
|
+
border: 1px solid #d3d3d3;
|
|
148
|
+
border-radius: 5px;
|
|
149
|
+
}
|
|
150
|
+
.answer-img {
|
|
151
|
+
width: 54px;
|
|
152
|
+
min-width: 54px;
|
|
153
|
+
height: 54px;
|
|
154
|
+
min-height: 54px;
|
|
155
|
+
border-radius: 5px;
|
|
156
|
+
}
|
|
157
|
+
.unloaded {
|
|
158
|
+
background-color: lightgrey;
|
|
159
|
+
}
|
|
160
|
+
.titles {
|
|
161
|
+
margin-left: 14px;
|
|
162
|
+
align-self: center;
|
|
163
|
+
}
|
|
164
|
+
.title-wrapper {
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-direction: column;
|
|
167
|
+
}
|
|
168
|
+
.answer-title-wrapper {
|
|
169
|
+
text-align: center;
|
|
170
|
+
align-self: center;
|
|
171
|
+
margin-left: 14px;
|
|
172
|
+
}
|
|
173
|
+
}
|