redhotmagma-visualization 1.51.0 → 1.51.2
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/AlignTargetProvider.js +21 -30
- package/CommonUtils/Deferred.js +11 -19
- package/CommonUtils/Observable.js +23 -30
- package/CommonUtils/PropertyObserver.js +4 -10
- package/CommonUtils/SyncCurrentFunction.js +25 -31
- package/CommonUtils/SyncObservableEvent.js +4 -10
- package/CommonUtils/pointerEvent.js +9 -15
- package/Constants.js +2 -8
- package/DevApp.js +224 -236
- package/ExposedModules.js +4 -19
- package/FallbackVisualization.js +5 -12
- package/PrintingEffects/ColorEmbossingEffect.js +13 -19
- package/PrintingEffects/DomingEffect.js +13 -19
- package/PrintingEffects/EmbossingEffect.js +14 -20
- package/PrintingEffects/EmbroideryEffect.js +113 -128
- package/PrintingEffects/EngravingEffect.js +14 -20
- package/PrintingEffects/PrintingEffects.js +40 -48
- package/PrintingEffects/PrintingEffectsUtils.js +4 -13
- package/React/ReactBase.js +29 -37
- package/Three/Exporters/glTFExporter.js +3 -10
- package/Three/Three2D.js +441 -470
- package/Three/Three2DLayers.js +136 -148
- package/Three/Three3D.js +285 -302
- package/Three/Three3DScene.js +326 -341
- package/Three/ThreeBase.js +92 -104
- package/Utils/DesignArea/getDesignAreaCanvasSize.js +3 -10
- package/Utils/TextureBuilder/createTextureBuilder.js +57 -69
- package/Utils/TextureBuilder/textureBuilderFunctions.js +4 -10
- package/Utils/canvasBlur.js +2 -8
- package/Utils/createAlphaMapFromAlphaChannel.js +8 -13
- package/Utils/createBakedShadow.js +18 -25
- package/Utils/createCache.js +1 -7
- package/Utils/createCanvas.js +1 -7
- package/Utils/createImageRepository.js +38 -53
- package/Utils/disposeMaterial.js +7 -12
- package/Utils/getImageSize.js +1 -7
- package/Utils/imagePreloader.js +22 -29
- package/Utils/initTextureCanvas.js +10 -17
- package/Utils/isMobileDevice.js +1 -7
- package/Utils/optimizeTextureImage.js +8 -13
- package/Utils/rememberCameraViewOffset.js +1 -7
- package/Utils/removeObject.js +3 -9
- package/Utils/restrictCameraMovement.js +5 -12
- package/Utils/setLightShadow.js +3 -9
- package/Utils/setOrthographicCameraSize.js +1 -7
- package/Utils/updateFitSizeToElement.js +5 -11
- package/VisualizationContainer.js +46 -55
- package/VisualizationInterface.js +42 -50
- package/VisualizationProvider.js +8 -15
- package/index.js +4 -7
- package/package.json +2 -2
- package/src/Three/Exporters/glTFExporter.js +1 -1
- package/src/Three/Three3D.js +4 -4
- package/src/Three/Three3DScene.js +13 -3
- package/src/Utils/restrictCameraMovement.js +1 -1
- package/visualizationAdapterCreator.js +18 -27
package/DevApp.js
CHANGED
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _VisualizationProvider = require("./VisualizationProvider");
|
|
9
|
-
var _VisualizationContainer = _interopRequireDefault(require("./VisualizationContainer"));
|
|
10
|
-
var _visualizationAdapterCreator = require("./visualizationAdapterCreator");
|
|
11
|
-
var _designAreaList2D = _interopRequireDefault(require("./__mocks__/designAreaList2D"));
|
|
12
|
-
var _designAreaList2DVariant = _interopRequireDefault(require("./__mocks__/designAreaList2DVariant"));
|
|
13
|
-
var _designAreaList3DVariant = _interopRequireDefault(require("./__mocks__/designAreaList3DVariant"));
|
|
14
|
-
var _exportedSampleSvg = require("./__mocks__/exportedSampleSvg");
|
|
15
|
-
var _AlignTargetProvider = require("./AlignTargetProvider");
|
|
16
|
-
var _Constants = require("./Constants");
|
|
17
|
-
var _three = require("three");
|
|
18
|
-
var _makeStyles = _interopRequireDefault(require("@material-ui/core/styles/makeStyles"));
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
23
|
-
function _slicedToArray(
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
24
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
4
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
26
|
-
function _arrayWithHoles(
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
function
|
|
32
|
-
function
|
|
5
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
6
|
+
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
11
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
12
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
13
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
33
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
|
-
function _defineProperty(
|
|
36
|
-
function _toPropertyKey(
|
|
37
|
-
function _toPrimitive(
|
|
38
|
-
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
import React, { Fragment, useEffect, useState } from "react";
|
|
20
|
+
import { VisualizationProvider } from "./VisualizationProvider";
|
|
21
|
+
import VisualizationContainer from "./VisualizationContainer";
|
|
22
|
+
import { createAdapterConfig, createVisualizationAdapter } from "./visualizationAdapterCreator";
|
|
23
|
+
import designAreaList2D from "./__mocks__/designAreaList2D";
|
|
24
|
+
import designAreaList2DVariant from "./__mocks__/designAreaList2DVariant";
|
|
25
|
+
import designAreaList3DVariant from "./__mocks__/designAreaList3DVariant";
|
|
26
|
+
import { getExportedSampleSvg } from "./__mocks__/exportedSampleSvg";
|
|
27
|
+
import { AlignTargetProvider, withAlignTarget } from "./AlignTargetProvider";
|
|
28
|
+
import { EventTypes } from "./Constants";
|
|
29
|
+
import { Color } from "three";
|
|
30
|
+
import makeStyles from "@material-ui/core/styles/makeStyles";
|
|
31
|
+
var adapterConfig = createAdapterConfig({
|
|
39
32
|
host: "/"
|
|
40
33
|
}, {
|
|
41
34
|
"2dVariant": {
|
|
@@ -379,11 +372,11 @@ var getDemoData = function getDemoData(mode, model) {
|
|
|
379
372
|
"2dVariant": {
|
|
380
373
|
itemPath: "softshell",
|
|
381
374
|
materialPath: "softshell_red_s",
|
|
382
|
-
view:
|
|
383
|
-
designAreaList:
|
|
375
|
+
view: designAreaList2DVariant[0].designView,
|
|
376
|
+
designAreaList: designAreaList2DVariant
|
|
384
377
|
},
|
|
385
378
|
"2dLayer": {
|
|
386
|
-
designAreaList:
|
|
379
|
+
designAreaList: designAreaList2D,
|
|
387
380
|
configuration: {
|
|
388
381
|
visualizationData: {
|
|
389
382
|
viewImages: {
|
|
@@ -392,76 +385,75 @@ var getDemoData = function getDemoData(mode, model) {
|
|
|
392
385
|
}
|
|
393
386
|
}
|
|
394
387
|
},
|
|
395
|
-
view:
|
|
388
|
+
view: designAreaList2D[0].designView
|
|
396
389
|
},
|
|
397
390
|
"3dScene": _objectSpread({}, modelData["3dScene"][model]),
|
|
398
391
|
"3dVariant": {
|
|
399
392
|
materialPath: "base",
|
|
400
393
|
view: "default",
|
|
401
|
-
designAreaList:
|
|
394
|
+
designAreaList: designAreaList3DVariant
|
|
402
395
|
}
|
|
403
396
|
};
|
|
404
397
|
return demoData[mode];
|
|
405
398
|
};
|
|
406
399
|
var loadDemoModel = /*#__PURE__*/function () {
|
|
407
|
-
var _ref = _asyncToGenerator(
|
|
408
|
-
var _getDemoData, configuration, view, designAreaList, itemPath, materialPath;
|
|
409
|
-
return
|
|
410
|
-
while (1) switch (_context.
|
|
400
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(visualization, mode, model) {
|
|
401
|
+
var _getDemoData, configuration, view, designAreaList, itemPath, materialPath, _t, _t2, _t3, _t4, _t5;
|
|
402
|
+
return _regenerator().w(function (_context) {
|
|
403
|
+
while (1) switch (_context.n) {
|
|
411
404
|
case 0:
|
|
412
405
|
_getDemoData = getDemoData(mode, model), configuration = _getDemoData.configuration, view = _getDemoData.view, designAreaList = _getDemoData.designAreaList, itemPath = _getDemoData.itemPath, materialPath = _getDemoData.materialPath;
|
|
413
|
-
|
|
414
|
-
if (!
|
|
415
|
-
_context.
|
|
406
|
+
_t = visualization.update && configuration;
|
|
407
|
+
if (!_t) {
|
|
408
|
+
_context.n = 1;
|
|
416
409
|
break;
|
|
417
410
|
}
|
|
418
|
-
_context.
|
|
411
|
+
_context.n = 1;
|
|
419
412
|
return visualization.update(configuration);
|
|
420
|
-
case
|
|
421
|
-
|
|
422
|
-
if (!
|
|
423
|
-
_context.
|
|
413
|
+
case 1:
|
|
414
|
+
_t2 = itemPath;
|
|
415
|
+
if (!_t2) {
|
|
416
|
+
_context.n = 2;
|
|
424
417
|
break;
|
|
425
418
|
}
|
|
426
|
-
_context.
|
|
419
|
+
_context.n = 2;
|
|
427
420
|
return visualization.updateItemPath(itemPath);
|
|
428
|
-
case
|
|
429
|
-
|
|
430
|
-
if (!
|
|
431
|
-
_context.
|
|
421
|
+
case 2:
|
|
422
|
+
_t3 = materialPath;
|
|
423
|
+
if (!_t3) {
|
|
424
|
+
_context.n = 3;
|
|
432
425
|
break;
|
|
433
426
|
}
|
|
434
|
-
_context.
|
|
427
|
+
_context.n = 3;
|
|
435
428
|
return visualization.updateMaterialVariantPath(materialPath);
|
|
436
|
-
case
|
|
437
|
-
|
|
438
|
-
if (!
|
|
439
|
-
_context.
|
|
429
|
+
case 3:
|
|
430
|
+
_t4 = designAreaList;
|
|
431
|
+
if (!_t4) {
|
|
432
|
+
_context.n = 4;
|
|
440
433
|
break;
|
|
441
434
|
}
|
|
442
|
-
_context.
|
|
435
|
+
_context.n = 4;
|
|
443
436
|
return visualization.updateDesignAreaList(designAreaList);
|
|
444
|
-
case
|
|
445
|
-
|
|
446
|
-
if (!
|
|
447
|
-
_context.
|
|
437
|
+
case 4:
|
|
438
|
+
_t5 = view;
|
|
439
|
+
if (!_t5) {
|
|
440
|
+
_context.n = 7;
|
|
448
441
|
break;
|
|
449
442
|
}
|
|
450
443
|
if (!visualization.setView) {
|
|
451
|
-
_context.
|
|
444
|
+
_context.n = 6;
|
|
452
445
|
break;
|
|
453
446
|
}
|
|
454
|
-
_context.
|
|
447
|
+
_context.n = 5;
|
|
455
448
|
return visualization.setView(view);
|
|
456
|
-
case
|
|
457
|
-
_context.
|
|
449
|
+
case 5:
|
|
450
|
+
_context.n = 7;
|
|
458
451
|
break;
|
|
459
|
-
case
|
|
460
|
-
_context.
|
|
452
|
+
case 6:
|
|
453
|
+
_context.n = 7;
|
|
461
454
|
return visualization.jumpToView(view);
|
|
462
|
-
case
|
|
463
|
-
|
|
464
|
-
return _context.stop();
|
|
455
|
+
case 7:
|
|
456
|
+
return _context.a(2);
|
|
465
457
|
}
|
|
466
458
|
}, _callee);
|
|
467
459
|
}));
|
|
@@ -495,7 +487,7 @@ function drawImage(ctx, scaling, effect) {
|
|
|
495
487
|
}
|
|
496
488
|
var drawToTexture = function drawToTexture(effect, designAreaList) {
|
|
497
489
|
return /*#__PURE__*/function () {
|
|
498
|
-
var _ref2 = _asyncToGenerator(
|
|
490
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(textureCtx, getTextureBuilder) {
|
|
499
491
|
var designAreas,
|
|
500
492
|
_getTextureBuilder,
|
|
501
493
|
drawCanvasToArea,
|
|
@@ -504,22 +496,23 @@ var drawToTexture = function drawToTexture(effect, designAreaList) {
|
|
|
504
496
|
_iterator,
|
|
505
497
|
_step,
|
|
506
498
|
_loop,
|
|
507
|
-
_args3 = arguments
|
|
508
|
-
|
|
509
|
-
|
|
499
|
+
_args3 = arguments,
|
|
500
|
+
_t6;
|
|
501
|
+
return _regenerator().w(function (_context3) {
|
|
502
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
510
503
|
case 0:
|
|
511
504
|
designAreas = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : designAreaList;
|
|
512
505
|
_getTextureBuilder = getTextureBuilder(textureBuilderConfig), drawCanvasToArea = _getTextureBuilder.drawCanvasToArea, highlightDesignAreas = _getTextureBuilder.highlightDesignAreas, drawOn = _getTextureBuilder.drawOn;
|
|
513
506
|
highlightDesignAreas(designAreas);
|
|
514
507
|
_iterator = _createForOfIteratorHelper(designAreas);
|
|
515
|
-
_context3.
|
|
516
|
-
_loop = /*#__PURE__*/
|
|
508
|
+
_context3.p = 1;
|
|
509
|
+
_loop = /*#__PURE__*/_regenerator().m(function _loop() {
|
|
517
510
|
var designArea;
|
|
518
|
-
return
|
|
519
|
-
while (1) switch (_context2.
|
|
511
|
+
return _regenerator().w(function (_context2) {
|
|
512
|
+
while (1) switch (_context2.n) {
|
|
520
513
|
case 0:
|
|
521
514
|
designArea = _step.value;
|
|
522
|
-
_context2.
|
|
515
|
+
_context2.n = 1;
|
|
523
516
|
return drawCanvasToArea({
|
|
524
517
|
drawToContext: function drawToContext(ctx, x, y, width) {
|
|
525
518
|
drawImage(ctx, width / designArea.position.width, effect);
|
|
@@ -527,42 +520,40 @@ var drawToTexture = function drawToTexture(effect, designAreaList) {
|
|
|
527
520
|
designArea: designArea,
|
|
528
521
|
effect: effect,
|
|
529
522
|
effectOptions: effectOptions[effect],
|
|
530
|
-
getSvg:
|
|
523
|
+
getSvg: getExportedSampleSvg
|
|
531
524
|
});
|
|
532
|
-
case
|
|
533
|
-
|
|
534
|
-
return _context2.stop();
|
|
525
|
+
case 1:
|
|
526
|
+
return _context2.a(2);
|
|
535
527
|
}
|
|
536
528
|
}, _loop);
|
|
537
529
|
});
|
|
538
530
|
_iterator.s();
|
|
539
|
-
case
|
|
531
|
+
case 2:
|
|
540
532
|
if ((_step = _iterator.n()).done) {
|
|
541
|
-
_context3.
|
|
533
|
+
_context3.n = 4;
|
|
542
534
|
break;
|
|
543
535
|
}
|
|
544
|
-
return _context3.
|
|
545
|
-
case
|
|
546
|
-
_context3.
|
|
536
|
+
return _context3.d(_regeneratorValues(_loop()), 3);
|
|
537
|
+
case 3:
|
|
538
|
+
_context3.n = 2;
|
|
547
539
|
break;
|
|
548
|
-
case
|
|
549
|
-
_context3.
|
|
540
|
+
case 4:
|
|
541
|
+
_context3.n = 6;
|
|
550
542
|
break;
|
|
551
|
-
case
|
|
552
|
-
_context3.
|
|
553
|
-
|
|
554
|
-
_iterator.e(
|
|
555
|
-
case
|
|
556
|
-
_context3.
|
|
543
|
+
case 5:
|
|
544
|
+
_context3.p = 5;
|
|
545
|
+
_t6 = _context3.v;
|
|
546
|
+
_iterator.e(_t6);
|
|
547
|
+
case 6:
|
|
548
|
+
_context3.p = 6;
|
|
557
549
|
_iterator.f();
|
|
558
|
-
return _context3.
|
|
559
|
-
case
|
|
550
|
+
return _context3.f(6);
|
|
551
|
+
case 7:
|
|
560
552
|
drawOn(textureCtx);
|
|
561
|
-
case
|
|
562
|
-
|
|
563
|
-
return _context3.stop();
|
|
553
|
+
case 8:
|
|
554
|
+
return _context3.a(2);
|
|
564
555
|
}
|
|
565
|
-
}, _callee2, null, [[
|
|
556
|
+
}, _callee2, null, [[1, 5, 6, 7]]);
|
|
566
557
|
}));
|
|
567
558
|
return function (_x4, _x5) {
|
|
568
559
|
return _ref2.apply(this, arguments);
|
|
@@ -572,19 +563,18 @@ var drawToTexture = function drawToTexture(effect, designAreaList) {
|
|
|
572
563
|
var addTexture = function addTexture(visualization, mode, model, effect) {
|
|
573
564
|
visualization.getDrawingContext(drawToTexture(effect, getDemoData(mode, model).designAreaList), true /* update alpha */, true /* clean up texture before drawing */);
|
|
574
565
|
};
|
|
575
|
-
|
|
576
566
|
var expose = function expose(name, value) {
|
|
577
567
|
return window[name] = value;
|
|
578
568
|
};
|
|
579
|
-
var AlignTestComponent =
|
|
580
|
-
var ref = /*#__PURE__*/
|
|
581
|
-
|
|
569
|
+
var AlignTestComponent = withAlignTarget(function (props) {
|
|
570
|
+
var ref = /*#__PURE__*/React.createRef();
|
|
571
|
+
useEffect(function () {
|
|
582
572
|
props.alignTarget.add(ref.current);
|
|
583
573
|
return function () {
|
|
584
574
|
return props.alignTarget.remove(ref.current);
|
|
585
575
|
};
|
|
586
576
|
}, []);
|
|
587
|
-
return /*#__PURE__*/
|
|
577
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
588
578
|
ref: ref,
|
|
589
579
|
style: {
|
|
590
580
|
position: "fixed",
|
|
@@ -606,13 +596,13 @@ var AlignTestComponent = (0, _AlignTargetProvider.withAlignTarget)(function (pro
|
|
|
606
596
|
});
|
|
607
597
|
var MovementRestrictButton = function MovementRestrictButton(_ref3) {
|
|
608
598
|
var visualization = _ref3.visualization;
|
|
609
|
-
var _useState =
|
|
599
|
+
var _useState = useState(false),
|
|
610
600
|
_useState2 = _slicedToArray(_useState, 2),
|
|
611
601
|
isMovementRestricted = _useState2[0],
|
|
612
602
|
restrictMovement = _useState2[1];
|
|
613
|
-
return /*#__PURE__*/
|
|
603
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
614
604
|
className: "feature"
|
|
615
|
-
}, /*#__PURE__*/
|
|
605
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
616
606
|
onClick: function onClick() {
|
|
617
607
|
if (isMovementRestricted) {
|
|
618
608
|
visualization.freeUserMovement();
|
|
@@ -627,43 +617,43 @@ var MovementRestrictButton = function MovementRestrictButton(_ref3) {
|
|
|
627
617
|
var ViewSwitchOptions = function ViewSwitchOptions(_ref4) {
|
|
628
618
|
var visualization = _ref4.visualization,
|
|
629
619
|
mode = _ref4.mode;
|
|
630
|
-
var _useState3 =
|
|
620
|
+
var _useState3 = useState(getDemoData(mode).view),
|
|
631
621
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
632
622
|
designView = _useState4[0],
|
|
633
623
|
setDesignView = _useState4[1];
|
|
634
|
-
var _useState5 =
|
|
624
|
+
var _useState5 = useState(""),
|
|
635
625
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
636
626
|
designArea = _useState6[0],
|
|
637
627
|
setDesignArea = _useState6[1];
|
|
638
|
-
|
|
628
|
+
useEffect(function () {
|
|
639
629
|
visualization.setView && visualization.setView(designView);
|
|
640
630
|
setDesignArea("");
|
|
641
631
|
}, [designView]);
|
|
642
|
-
|
|
632
|
+
useEffect(function () {
|
|
643
633
|
designArea && visualization.jumpToArea(designArea);
|
|
644
634
|
}, [designArea]);
|
|
645
635
|
var designAreaList = getDemoData(mode).designAreaList;
|
|
646
|
-
return /*#__PURE__*/
|
|
636
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
647
637
|
className: "feature"
|
|
648
|
-
}, /*#__PURE__*/
|
|
638
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
649
639
|
className: "feature"
|
|
650
|
-
}, /*#__PURE__*/
|
|
640
|
+
}, /*#__PURE__*/React.createElement("label", null, "Switch design views:"), designAreaList.map(function (_ref5) {
|
|
651
641
|
var designView = _ref5.designView;
|
|
652
|
-
return /*#__PURE__*/
|
|
642
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
653
643
|
key: designView.identifier,
|
|
654
644
|
value: designView.identifier,
|
|
655
645
|
onClick: function onClick() {
|
|
656
646
|
return setDesignView(designView);
|
|
657
647
|
}
|
|
658
648
|
}, designView.identifier);
|
|
659
|
-
})), /*#__PURE__*/
|
|
649
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
660
650
|
className: "feature"
|
|
661
|
-
}, /*#__PURE__*/
|
|
651
|
+
}, /*#__PURE__*/React.createElement("label", null, "Switch design areas:"), designAreaList.filter(function (_ref6) {
|
|
662
652
|
var identifier = _ref6.designView.identifier;
|
|
663
653
|
return identifier === designView.identifier;
|
|
664
654
|
}).map(function (_ref7) {
|
|
665
655
|
var identifier = _ref7.identifier;
|
|
666
|
-
return /*#__PURE__*/
|
|
656
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
667
657
|
key: identifier,
|
|
668
658
|
value: identifier,
|
|
669
659
|
onClick: function onClick(_ref8) {
|
|
@@ -676,70 +666,70 @@ var ViewSwitchOptions = function ViewSwitchOptions(_ref4) {
|
|
|
676
666
|
var CameraViews = function CameraViews(_ref9) {
|
|
677
667
|
var visualization = _ref9.visualization,
|
|
678
668
|
cameras = _ref9.cameras;
|
|
679
|
-
|
|
669
|
+
useEffect(function () {
|
|
680
670
|
visualization && visualization.jumpToView && visualization.jumpToView("default");
|
|
681
671
|
}, [cameras]);
|
|
682
672
|
if (!visualization || !cameras || !cameras.length) return null;
|
|
683
|
-
return /*#__PURE__*/
|
|
673
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
684
674
|
className: "feature"
|
|
685
|
-
}, /*#__PURE__*/
|
|
686
|
-
onChange: function onChange(
|
|
687
|
-
var value =
|
|
675
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
676
|
+
onChange: function onChange(_ref0) {
|
|
677
|
+
var value = _ref0.target.value;
|
|
688
678
|
return visualization.jumpToView(value);
|
|
689
679
|
}
|
|
690
|
-
}, /*#__PURE__*/
|
|
691
|
-
return /*#__PURE__*/
|
|
680
|
+
}, /*#__PURE__*/React.createElement("option", null, "Select view"), cameras.map(function (name) {
|
|
681
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
692
682
|
key: name,
|
|
693
683
|
value: name
|
|
694
684
|
}, name);
|
|
695
685
|
})));
|
|
696
686
|
};
|
|
697
|
-
var Animations = function Animations(
|
|
698
|
-
var visualization =
|
|
699
|
-
animations =
|
|
687
|
+
var Animations = function Animations(_ref1) {
|
|
688
|
+
var visualization = _ref1.visualization,
|
|
689
|
+
animations = _ref1.animations;
|
|
700
690
|
if (!visualization || !animations || !animations.length) return null;
|
|
701
|
-
return /*#__PURE__*/
|
|
691
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
702
692
|
className: "feature"
|
|
703
|
-
}, /*#__PURE__*/
|
|
704
|
-
onChange: function onChange(
|
|
705
|
-
var value =
|
|
693
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
694
|
+
onChange: function onChange(_ref10) {
|
|
695
|
+
var value = _ref10.target.value;
|
|
706
696
|
return visualization.setActiveAnimation(value);
|
|
707
697
|
}
|
|
708
|
-
}, /*#__PURE__*/
|
|
709
|
-
return /*#__PURE__*/
|
|
698
|
+
}, /*#__PURE__*/React.createElement("option", null, "Select animation"), animations.map(function (name) {
|
|
699
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
710
700
|
key: name,
|
|
711
701
|
value: name
|
|
712
702
|
}, name);
|
|
713
703
|
})));
|
|
714
704
|
};
|
|
715
|
-
var ColorVariants = function ColorVariants(
|
|
716
|
-
var visualization =
|
|
717
|
-
variants =
|
|
705
|
+
var ColorVariants = function ColorVariants(_ref11) {
|
|
706
|
+
var visualization = _ref11.visualization,
|
|
707
|
+
variants = _ref11.variants;
|
|
718
708
|
if (!visualization) return null;
|
|
719
|
-
return /*#__PURE__*/
|
|
709
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
720
710
|
className: "feature"
|
|
721
|
-
}, /*#__PURE__*/
|
|
722
|
-
onChange: function onChange(
|
|
723
|
-
var value =
|
|
711
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
712
|
+
onChange: function onChange(_ref12) {
|
|
713
|
+
var value = _ref12.target.value;
|
|
724
714
|
return visualization.updateMaterialVariantPath(value);
|
|
725
715
|
}
|
|
726
|
-
}, /*#__PURE__*/
|
|
727
|
-
return /*#__PURE__*/
|
|
716
|
+
}, /*#__PURE__*/React.createElement("option", null, "Select variant"), variants.map(function (name) {
|
|
717
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
728
718
|
key: name,
|
|
729
719
|
value: name
|
|
730
720
|
}, name);
|
|
731
721
|
})));
|
|
732
722
|
};
|
|
733
|
-
var FeatureAvailability = function FeatureAvailability(
|
|
734
|
-
var availableFor =
|
|
735
|
-
mode =
|
|
736
|
-
children =
|
|
723
|
+
var FeatureAvailability = function FeatureAvailability(_ref13) {
|
|
724
|
+
var availableFor = _ref13.availableFor,
|
|
725
|
+
mode = _ref13.mode,
|
|
726
|
+
children = _ref13.children;
|
|
737
727
|
if (-1 !== availableFor.indexOf(mode)) {
|
|
738
728
|
return children;
|
|
739
729
|
}
|
|
740
730
|
return null;
|
|
741
731
|
};
|
|
742
|
-
var useStyles = (
|
|
732
|
+
var useStyles = makeStyles({
|
|
743
733
|
container: {
|
|
744
734
|
position: "absolute",
|
|
745
735
|
top: 0,
|
|
@@ -771,36 +761,36 @@ var useStyles = (0, _makeStyles["default"])({
|
|
|
771
761
|
}
|
|
772
762
|
});
|
|
773
763
|
var App = function App() {
|
|
774
|
-
var _useState7 =
|
|
764
|
+
var _useState7 = useState("3dScene"),
|
|
775
765
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
776
766
|
mode = _useState8[0],
|
|
777
767
|
setMode = _useState8[1];
|
|
778
|
-
var _useState9 =
|
|
779
|
-
|
|
780
|
-
model =
|
|
781
|
-
setModel =
|
|
782
|
-
var
|
|
768
|
+
var _useState9 = useState(""),
|
|
769
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
770
|
+
model = _useState0[0],
|
|
771
|
+
setModel = _useState0[1];
|
|
772
|
+
var _useState1 = useState(),
|
|
773
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
774
|
+
visualization = _useState10[0],
|
|
775
|
+
setVisualization = _useState10[1];
|
|
776
|
+
var _useState11 = useState(false),
|
|
783
777
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
var _useState13 =
|
|
778
|
+
showAlignTestComponent = _useState12[0],
|
|
779
|
+
setShowAlignTestComponent = _useState12[1];
|
|
780
|
+
var _useState13 = useState(""),
|
|
787
781
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
var _useState15 =
|
|
782
|
+
effect = _useState14[0],
|
|
783
|
+
setEffect = _useState14[1];
|
|
784
|
+
var _useState15 = useState({}),
|
|
791
785
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
796
|
-
features = _useState18[0],
|
|
797
|
-
setFeatures = _useState18[1];
|
|
798
|
-
(0, _react.useEffect)(function () {
|
|
786
|
+
features = _useState16[0],
|
|
787
|
+
setFeatures = _useState16[1];
|
|
788
|
+
useEffect(function () {
|
|
799
789
|
visualization && visualization.dispose();
|
|
800
790
|
var mappedMode = {
|
|
801
791
|
"3dVariant": "3dScene" // the variant mode is deprecated, the demo is made with the 3dScene
|
|
802
792
|
}[mode] || mode;
|
|
803
|
-
var _visualization =
|
|
793
|
+
var _visualization = createVisualizationAdapter(adapterConfig, mappedMode);
|
|
804
794
|
setVisualization(_visualization);
|
|
805
795
|
_visualization.setOptions3D && _visualization.setOptions3D({
|
|
806
796
|
// uncomment lines to test different settings
|
|
@@ -810,30 +800,29 @@ var App = function App() {
|
|
|
810
800
|
setEffect("");
|
|
811
801
|
setModel("");
|
|
812
802
|
}, [mode]);
|
|
813
|
-
|
|
803
|
+
useEffect(function () {
|
|
814
804
|
var drawFn = function drawFn() {
|
|
815
805
|
visualization.getDrawingContext(drawToTexture("print", getDemoData(mode, model).designAreaList), true /* update alpha */, true /* clean up texture before drawing */);
|
|
816
806
|
};
|
|
817
|
-
|
|
818
|
-
visualization && visualization.observable.on(_Constants.EventTypes.MaterialUpdated, drawFn);
|
|
807
|
+
visualization && visualization.observable.on(EventTypes.MaterialUpdated, drawFn);
|
|
819
808
|
return function () {
|
|
820
|
-
visualization && visualization.observable.off(
|
|
809
|
+
visualization && visualization.observable.off(EventTypes.MaterialUpdated, drawFn);
|
|
821
810
|
};
|
|
822
811
|
}, [visualization, mode, model]);
|
|
823
812
|
|
|
824
813
|
// highlight intersected (clicked) object
|
|
825
|
-
|
|
814
|
+
useEffect(function () {
|
|
826
815
|
if (visualization) {
|
|
827
816
|
var restoreColor;
|
|
828
817
|
var to;
|
|
829
|
-
visualization.observable.on(
|
|
818
|
+
visualization.observable.on(EventTypes.Intersection, function (v) {
|
|
830
819
|
// eslint-disable-next-line no-console
|
|
831
820
|
console.log("Intersection", v);
|
|
832
821
|
var mat = v.data.target.object.material;
|
|
833
822
|
window.clearTimeout(to);
|
|
834
823
|
restoreColor && restoreColor();
|
|
835
824
|
var col = mat.color;
|
|
836
|
-
mat.color = new
|
|
825
|
+
mat.color = new Color(1, 0.5, 0.5);
|
|
837
826
|
mat.updateNeeded = true;
|
|
838
827
|
visualization.render();
|
|
839
828
|
restoreColor = function restoreColor() {
|
|
@@ -849,125 +838,124 @@ var App = function App() {
|
|
|
849
838
|
var classes = useStyles();
|
|
850
839
|
var modelList = modelData[mode] && Object.keys(modelData[mode]);
|
|
851
840
|
var designAreaList = getDemoData(mode, model).designAreaList;
|
|
852
|
-
return /*#__PURE__*/
|
|
841
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
853
842
|
className: classes.container
|
|
854
|
-
}, /*#__PURE__*/
|
|
855
|
-
onChange: function onChange(
|
|
856
|
-
var value =
|
|
843
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
844
|
+
onChange: function onChange(_ref14) {
|
|
845
|
+
var value = _ref14.target.value;
|
|
857
846
|
return setMode(value);
|
|
858
847
|
}
|
|
859
|
-
}, /*#__PURE__*/
|
|
848
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
860
849
|
value: "3dScene"
|
|
861
|
-
}, "3D scene"), /*#__PURE__*/
|
|
850
|
+
}, "3D scene"), /*#__PURE__*/React.createElement("option", {
|
|
862
851
|
value: "3dVariant"
|
|
863
|
-
}, "3D variant"), /*#__PURE__*/
|
|
852
|
+
}, "3D variant"), /*#__PURE__*/React.createElement("option", {
|
|
864
853
|
value: "2dLayer"
|
|
865
|
-
}, "2D layer"), /*#__PURE__*/
|
|
854
|
+
}, "2D layer"), /*#__PURE__*/React.createElement("option", {
|
|
866
855
|
value: "2dVariant"
|
|
867
|
-
}, "2D variant")), modelList && /*#__PURE__*/
|
|
856
|
+
}, "2D variant")), modelList && /*#__PURE__*/React.createElement("select", {
|
|
868
857
|
value: model,
|
|
869
|
-
onChange: function onChange(
|
|
870
|
-
var value =
|
|
858
|
+
onChange: function onChange(_ref15) {
|
|
859
|
+
var value = _ref15.target.value;
|
|
871
860
|
return setModel(value);
|
|
872
861
|
}
|
|
873
|
-
}, /*#__PURE__*/
|
|
874
|
-
return /*#__PURE__*/
|
|
862
|
+
}, /*#__PURE__*/React.createElement("option", null, "Select model"), modelList.map(function (model) {
|
|
863
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
875
864
|
value: model,
|
|
876
865
|
key: model
|
|
877
866
|
}, model);
|
|
878
|
-
})), (!modelList || model) && /*#__PURE__*/
|
|
879
|
-
onClick: /*#__PURE__*/_asyncToGenerator(
|
|
867
|
+
})), (!modelList || model) && /*#__PURE__*/React.createElement("button", {
|
|
868
|
+
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
880
869
|
var foundFeatures;
|
|
881
|
-
return
|
|
882
|
-
while (1) switch (_context4.
|
|
870
|
+
return _regenerator().w(function (_context4) {
|
|
871
|
+
while (1) switch (_context4.n) {
|
|
883
872
|
case 0:
|
|
884
|
-
_context4.
|
|
873
|
+
_context4.n = 1;
|
|
885
874
|
return loadDemoModel(visualization, mode, model);
|
|
886
|
-
case
|
|
875
|
+
case 1:
|
|
887
876
|
foundFeatures = {};
|
|
888
877
|
if (visualization.getCameras) {
|
|
889
|
-
foundFeatures.cameras = visualization.getCameras().map(function (
|
|
890
|
-
var name =
|
|
878
|
+
foundFeatures.cameras = visualization.getCameras().map(function (_ref17) {
|
|
879
|
+
var name = _ref17.name;
|
|
891
880
|
return name;
|
|
892
881
|
});
|
|
893
882
|
}
|
|
894
883
|
if (visualization.getAnimations) {
|
|
895
|
-
foundFeatures.animations = visualization.getAnimations().map(function (
|
|
896
|
-
var name =
|
|
884
|
+
foundFeatures.animations = visualization.getAnimations().map(function (_ref18) {
|
|
885
|
+
var name = _ref18.name;
|
|
897
886
|
return name;
|
|
898
887
|
});
|
|
899
888
|
}
|
|
900
889
|
setFeatures(foundFeatures);
|
|
901
|
-
case
|
|
902
|
-
|
|
903
|
-
return _context4.stop();
|
|
890
|
+
case 2:
|
|
891
|
+
return _context4.a(2);
|
|
904
892
|
}
|
|
905
893
|
}, _callee3);
|
|
906
894
|
}))
|
|
907
|
-
}, "Load demo model"), /*#__PURE__*/
|
|
895
|
+
}, "Load demo model"), /*#__PURE__*/React.createElement("div", {
|
|
908
896
|
className: "feature"
|
|
909
|
-
}, /*#__PURE__*/
|
|
897
|
+
}, /*#__PURE__*/React.createElement("label", null, "Use custom align target"), /*#__PURE__*/React.createElement("input", {
|
|
910
898
|
type: "checkbox",
|
|
911
|
-
onClick: function onClick(
|
|
912
|
-
var checked =
|
|
899
|
+
onClick: function onClick(_ref19) {
|
|
900
|
+
var checked = _ref19.target.checked;
|
|
913
901
|
return setShowAlignTestComponent(checked);
|
|
914
902
|
}
|
|
915
|
-
})), designAreaList && designAreaList.length > 0 && /*#__PURE__*/
|
|
903
|
+
})), designAreaList && designAreaList.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
916
904
|
className: "feature"
|
|
917
|
-
}, /*#__PURE__*/
|
|
905
|
+
}, /*#__PURE__*/React.createElement("label", null, "Texture content effect:"), /*#__PURE__*/React.createElement("select", {
|
|
918
906
|
value: effect,
|
|
919
|
-
onChange: function onChange(
|
|
920
|
-
var value =
|
|
907
|
+
onChange: function onChange(_ref20) {
|
|
908
|
+
var value = _ref20.target.value;
|
|
921
909
|
setEffect(value);
|
|
922
910
|
addTexture(visualization, mode, model, value);
|
|
923
911
|
}
|
|
924
|
-
}, /*#__PURE__*/
|
|
912
|
+
}, /*#__PURE__*/React.createElement("option", null, "No effect"), /*#__PURE__*/React.createElement("option", {
|
|
925
913
|
value: "embossing"
|
|
926
|
-
}, "embossing"), /*#__PURE__*/
|
|
914
|
+
}, "embossing"), /*#__PURE__*/React.createElement("option", {
|
|
927
915
|
value: "engraving"
|
|
928
|
-
}, "engraving"), /*#__PURE__*/
|
|
916
|
+
}, "engraving"), /*#__PURE__*/React.createElement("option", {
|
|
929
917
|
value: "doming"
|
|
930
|
-
}, "doming"), /*#__PURE__*/
|
|
918
|
+
}, "doming"), /*#__PURE__*/React.createElement("option", {
|
|
931
919
|
value: "embroidery"
|
|
932
|
-
}, "embroidery"), /*#__PURE__*/
|
|
920
|
+
}, "embroidery"), /*#__PURE__*/React.createElement("option", {
|
|
933
921
|
value: "color_embossing"
|
|
934
|
-
}, "color embossing"))), /*#__PURE__*/
|
|
922
|
+
}, "color embossing"))), /*#__PURE__*/React.createElement("div", {
|
|
935
923
|
className: "feature"
|
|
936
|
-
}, /*#__PURE__*/
|
|
924
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
937
925
|
className: classes.features
|
|
938
|
-
}, "Features:"), /*#__PURE__*/
|
|
926
|
+
}, "Features:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FeatureAvailability, {
|
|
939
927
|
availableFor: ["3dScene", "3dVariant"],
|
|
940
928
|
mode: mode
|
|
941
|
-
}, /*#__PURE__*/
|
|
929
|
+
}, /*#__PURE__*/React.createElement(MovementRestrictButton, {
|
|
942
930
|
visualization: visualization
|
|
943
|
-
})), /*#__PURE__*/
|
|
931
|
+
})), /*#__PURE__*/React.createElement(FeatureAvailability, {
|
|
944
932
|
availableFor: ["3dScene", "3dVariant"],
|
|
945
933
|
mode: mode
|
|
946
|
-
}, /*#__PURE__*/
|
|
934
|
+
}, /*#__PURE__*/React.createElement(CameraViews, {
|
|
947
935
|
visualization: visualization,
|
|
948
936
|
cameras: features.cameras
|
|
949
|
-
})), /*#__PURE__*/
|
|
937
|
+
})), /*#__PURE__*/React.createElement(FeatureAvailability, {
|
|
950
938
|
availableFor: ["3dScene", "3dVariant"],
|
|
951
939
|
mode: mode
|
|
952
|
-
}, /*#__PURE__*/
|
|
940
|
+
}, /*#__PURE__*/React.createElement(Animations, {
|
|
953
941
|
visualization: visualization,
|
|
954
942
|
animations: features.animations
|
|
955
|
-
})), /*#__PURE__*/
|
|
943
|
+
})), /*#__PURE__*/React.createElement(FeatureAvailability, {
|
|
956
944
|
availableFor: ["2dLayer", "2dVariant"],
|
|
957
945
|
mode: mode
|
|
958
|
-
}, /*#__PURE__*/
|
|
946
|
+
}, /*#__PURE__*/React.createElement(ViewSwitchOptions, {
|
|
959
947
|
visualization: visualization,
|
|
960
948
|
mode: mode
|
|
961
|
-
})), /*#__PURE__*/
|
|
949
|
+
})), /*#__PURE__*/React.createElement(FeatureAvailability, {
|
|
962
950
|
availableFor: ["3dVariant"],
|
|
963
951
|
mode: mode
|
|
964
|
-
}, /*#__PURE__*/
|
|
952
|
+
}, /*#__PURE__*/React.createElement(ColorVariants, {
|
|
965
953
|
visualization: visualization,
|
|
966
954
|
variants: ["base", "red", "green", "metallic", "glass"]
|
|
967
|
-
}))))), /*#__PURE__*/
|
|
955
|
+
}))))), /*#__PURE__*/React.createElement(VisualizationProvider, {
|
|
968
956
|
visualization: visualization
|
|
969
|
-
}, /*#__PURE__*/
|
|
957
|
+
}, /*#__PURE__*/React.createElement(AlignTargetProvider, null, showAlignTestComponent && /*#__PURE__*/React.createElement(AlignTestComponent, null, "The camera offset should be aligned to this component."), /*#__PURE__*/React.createElement(VisualizationContainer, {
|
|
970
958
|
autoDispose: true
|
|
971
959
|
}))));
|
|
972
960
|
};
|
|
973
|
-
|
|
961
|
+
export default App;
|