redhotmagma-visualization 1.56.2 → 1.56.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/CommonUtils/Deferred.js +4 -2
- package/CommonUtils/Observable.js +20 -11
- package/CommonUtils/SyncCurrentFunction.js +26 -18
- package/CommonUtils/SyncObservableEvent.js +3 -3
- package/DevApp.js +84 -73
- package/PrintingEffects/EmbroideryEffect.js +98 -82
- package/PrintingEffects/PrintingEffects.js +24 -14
- package/React/ReactBase.js +14 -13
- package/Three/Exporters/glTFExporter.js +1 -0
- package/Three/Three2D.js +311 -281
- package/Three/Three2DLayers.js +106 -93
- package/Three/Three3D.js +214 -196
- package/Three/Three3DScene.js +231 -209
- package/Three/ThreeBase.js +56 -42
- package/Utils/TextureBuilder/createTextureBuilder.js +67 -58
- package/Utils/createImageRepository.js +50 -33
- package/Utils/imagePreloader.js +24 -16
- package/VisualizationContainer.js +13 -11
- package/VisualizationInterface.js +33 -24
- package/index.js +1 -1
- package/package.json +2 -2
- package/visualizationAdapterCreator.js +2 -0
package/Three/Three2D.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
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); }
|
|
2
|
-
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"); }
|
|
3
2
|
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; } } }; }
|
|
4
3
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5
4
|
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."); }
|
|
@@ -9,23 +8,29 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
9
8
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
9
|
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; }
|
|
11
10
|
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; }
|
|
11
|
+
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
12
|
+
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"); }
|
|
13
|
+
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
14
|
+
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
|
15
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
16
|
+
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
|
12
17
|
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 }; })(); }
|
|
13
18
|
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); }
|
|
19
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
14
20
|
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); }
|
|
15
21
|
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); }); }; }
|
|
16
22
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
23
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
18
24
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
20
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
21
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
22
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
|
-
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
24
25
|
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
25
26
|
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
26
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
27
27
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
28
28
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
29
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
30
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
31
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
32
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
33
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
29
34
|
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; }
|
|
30
35
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
31
36
|
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); }
|
|
@@ -63,44 +68,46 @@ export var allowZooming = function allowZooming(zoom, originalZoom, minZoom, max
|
|
|
63
68
|
return originalZoom > zoom && zoom >= minZoom || originalZoom < zoom && zoom <= maxZoom;
|
|
64
69
|
};
|
|
65
70
|
export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
71
|
+
_inherits(Three2D, _ThreeBase);
|
|
72
|
+
var _super = _createSuper(Three2D);
|
|
66
73
|
function Three2D() {
|
|
67
74
|
var _this;
|
|
68
75
|
var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
69
76
|
_classCallCheck(this, Three2D);
|
|
70
|
-
_this =
|
|
71
|
-
_defineProperty(_this, "_materialMap", new Map());
|
|
72
|
-
_defineProperty(_this, "_designAreaList", []);
|
|
73
|
-
_defineProperty(_this, "_currentDesignView", null);
|
|
74
|
-
_defineProperty(_this, "_currentDesignArea", null);
|
|
75
|
-
_defineProperty(_this, "_viewPath", "");
|
|
76
|
-
_defineProperty(_this, "_model", null);
|
|
77
|
-
_defineProperty(_this, "_containerGroup", null);
|
|
78
|
-
_defineProperty(_this, "_size", {
|
|
77
|
+
_this = _super.call(this, cfg);
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "_materialMap", new Map());
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "_designAreaList", []);
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "_currentDesignView", null);
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "_currentDesignArea", null);
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "_viewPath", "");
|
|
83
|
+
_defineProperty(_assertThisInitialized(_this), "_model", null);
|
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "_containerGroup", null);
|
|
85
|
+
_defineProperty(_assertThisInitialized(_this), "_size", {
|
|
79
86
|
width: 0,
|
|
80
87
|
height: 0
|
|
81
88
|
});
|
|
82
|
-
_defineProperty(_this, "_fitSize", null);
|
|
83
|
-
_defineProperty(_this, "_minZoom", 0.5);
|
|
84
|
-
_defineProperty(_this, "_maxZoom", 2);
|
|
85
|
-
_defineProperty(_this, "_pointerMoveEventListener", null);
|
|
86
|
-
_defineProperty(_this, "_mouseWheelEventListener", null);
|
|
87
|
-
_defineProperty(_this, "_redraw", null);
|
|
88
|
-
_defineProperty(_this, "_modelBasePath", "");
|
|
89
|
-
_defineProperty(_this, "_modelPath", null);
|
|
90
|
-
_defineProperty(_this, "_overlayMode", false);
|
|
91
|
-
_defineProperty(_this, "_options", {
|
|
89
|
+
_defineProperty(_assertThisInitialized(_this), "_fitSize", null);
|
|
90
|
+
_defineProperty(_assertThisInitialized(_this), "_minZoom", 0.5);
|
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "_maxZoom", 2);
|
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "_pointerMoveEventListener", null);
|
|
93
|
+
_defineProperty(_assertThisInitialized(_this), "_mouseWheelEventListener", null);
|
|
94
|
+
_defineProperty(_assertThisInitialized(_this), "_redraw", null);
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "_modelBasePath", "");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "_modelPath", null);
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "_overlayMode", false);
|
|
98
|
+
_defineProperty(_assertThisInitialized(_this), "_options", {
|
|
92
99
|
sharperFullView: false,
|
|
93
100
|
// when zoom = 1 use NearestFilter for sharper product image
|
|
94
101
|
optimizeProductImage: false,
|
|
95
102
|
// upscale or downscale the product image to fit 2048 x 2048
|
|
96
103
|
premultiplyAlpha: false
|
|
97
104
|
});
|
|
98
|
-
_defineProperty(_this, "_imageRepository", createImageRepository(createCache(20), function (src) {
|
|
105
|
+
_defineProperty(_assertThisInitialized(_this), "_imageRepository", createImageRepository(createCache(20), function (src) {
|
|
99
106
|
return new Promise(function (resolve, reject) {
|
|
100
107
|
return new ImageLoader(_this._loadingManager).load(src, resolve, undefined, reject);
|
|
101
108
|
});
|
|
102
109
|
}));
|
|
103
|
-
_defineProperty(_this, "updateModelTextureFilter", function (_ref) {
|
|
110
|
+
_defineProperty(_assertThisInitialized(_this), "updateModelTextureFilter", function (_ref) {
|
|
104
111
|
var _this$_model;
|
|
105
112
|
var currentZoom = _ref.value;
|
|
106
113
|
if (!_this._options.sharperFullView) {
|
|
@@ -118,11 +125,11 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
118
125
|
tex.needsUpdate = true;
|
|
119
126
|
}
|
|
120
127
|
});
|
|
121
|
-
_defineProperty(_this, "redraw", function () {
|
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "redraw", function () {
|
|
122
129
|
return _this._redraw && _this._redraw();
|
|
123
130
|
});
|
|
124
|
-
_defineProperty(_this, "updateView", syncCurrent(/*#__PURE__*/function () {
|
|
125
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
131
|
+
_defineProperty(_assertThisInitialized(_this), "updateView", syncCurrent( /*#__PURE__*/function () {
|
|
132
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(designView) {
|
|
126
133
|
var options,
|
|
127
134
|
_options$forceUpdate,
|
|
128
135
|
forceUpdate,
|
|
@@ -135,22 +142,21 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
135
142
|
needsUpdate,
|
|
136
143
|
availableDesignAreas,
|
|
137
144
|
containerGroup,
|
|
138
|
-
_args = arguments
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
while (1) switch (_context.n) {
|
|
145
|
+
_args = arguments;
|
|
146
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
147
|
+
while (1) switch (_context.prev = _context.next) {
|
|
142
148
|
case 0:
|
|
143
149
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
144
150
|
_options$forceUpdate = options.forceUpdate, forceUpdate = _options$forceUpdate === void 0 ? false : _options$forceUpdate, _options$updateMateri = options.updateMaterial, updateMaterial = _options$updateMateri === void 0 ? true : _options$updateMateri;
|
|
145
151
|
designViewIdentifier = designView && designView.identifier;
|
|
146
152
|
if (designViewIdentifier) {
|
|
147
|
-
_context.
|
|
153
|
+
_context.next = 6;
|
|
148
154
|
break;
|
|
149
155
|
}
|
|
150
156
|
// eslint-disable-next-line no-console
|
|
151
157
|
console.log("No design view identifier! Skipping update.");
|
|
152
|
-
return _context.
|
|
153
|
-
case
|
|
158
|
+
return _context.abrupt("return");
|
|
159
|
+
case 6:
|
|
154
160
|
try {
|
|
155
161
|
oldModelPath = _this.getModelPath();
|
|
156
162
|
} catch (e) {
|
|
@@ -164,36 +170,37 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
164
170
|
modelPathChanged = _this.getModelPath() !== oldModelPath;
|
|
165
171
|
needsUpdate = forceUpdate || modelPathChanged || _this._currentDesignView !== designView;
|
|
166
172
|
if (needsUpdate) {
|
|
167
|
-
_context.
|
|
173
|
+
_context.next = 14;
|
|
168
174
|
break;
|
|
169
175
|
}
|
|
170
|
-
return _context.
|
|
171
|
-
case
|
|
176
|
+
return _context.abrupt("return");
|
|
177
|
+
case 14:
|
|
172
178
|
_this._currentDesignView = designView;
|
|
173
179
|
|
|
174
180
|
// skip view update if the design view is the same
|
|
175
181
|
if (!(forceUpdate || modelPathChanged)) {
|
|
176
|
-
_context.
|
|
182
|
+
_context.next = 18;
|
|
177
183
|
break;
|
|
178
184
|
}
|
|
179
|
-
_context.
|
|
185
|
+
_context.next = 18;
|
|
180
186
|
return _this.loadView();
|
|
181
|
-
case
|
|
187
|
+
case 18:
|
|
182
188
|
_this.clearScene();
|
|
183
189
|
availableDesignAreas = get(designView, "designAreas") || [];
|
|
184
190
|
containerGroup = _this.createObjectsForDesignAreas(availableDesignAreas);
|
|
185
191
|
_this._containerGroup = containerGroup;
|
|
186
192
|
_this._intersectionRoot = containerGroup;
|
|
187
193
|
_this.scene && _this.scene.add(containerGroup);
|
|
188
|
-
|
|
189
|
-
if (!
|
|
190
|
-
_context.
|
|
194
|
+
_context.t0 = updateMaterial;
|
|
195
|
+
if (!_context.t0) {
|
|
196
|
+
_context.next = 28;
|
|
191
197
|
break;
|
|
192
198
|
}
|
|
193
|
-
_context.
|
|
199
|
+
_context.next = 28;
|
|
194
200
|
return _this.dispatchMaterialUpdateEvent();
|
|
195
|
-
case
|
|
196
|
-
|
|
201
|
+
case 28:
|
|
202
|
+
case "end":
|
|
203
|
+
return _context.stop();
|
|
197
204
|
}
|
|
198
205
|
}, _callee);
|
|
199
206
|
}));
|
|
@@ -204,7 +211,7 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
204
211
|
if (cfg.modelBasePath) {
|
|
205
212
|
_this._modelBasePath = cfg.modelBasePath;
|
|
206
213
|
}
|
|
207
|
-
observeProperty(_this, "_size", function (_ref3) {
|
|
214
|
+
observeProperty(_assertThisInitialized(_this), "_size", function (_ref3) {
|
|
208
215
|
var value = _ref3.value,
|
|
209
216
|
dispose = _ref3.dispose;
|
|
210
217
|
if (value.width > 0 && value.height > 0) {
|
|
@@ -214,8 +221,7 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
214
221
|
});
|
|
215
222
|
return _this;
|
|
216
223
|
}
|
|
217
|
-
|
|
218
|
-
return _createClass(Three2D, [{
|
|
224
|
+
_createClass(Three2D, [{
|
|
219
225
|
key: "setOverlayMode",
|
|
220
226
|
value: function setOverlayMode(mode) {
|
|
221
227
|
this._overlayMode = mode;
|
|
@@ -229,6 +235,7 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
229
235
|
stencil: false,
|
|
230
236
|
depth: true // needed only for the admin area, consider to make it configurable
|
|
231
237
|
});
|
|
238
|
+
|
|
232
239
|
renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1);
|
|
233
240
|
renderer.outputColorSpace = LinearSRGBColorSpace;
|
|
234
241
|
return renderer;
|
|
@@ -267,10 +274,10 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
267
274
|
var width = _ref4.width,
|
|
268
275
|
height = _ref4.height;
|
|
269
276
|
var rerender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
270
|
-
|
|
277
|
+
_get(_getPrototypeOf(Three2D.prototype), "setSize", this).call(this, {
|
|
271
278
|
width: width,
|
|
272
279
|
height: height
|
|
273
|
-
}, rerender
|
|
280
|
+
}, rerender);
|
|
274
281
|
if (this.camera.zoom < 1) {
|
|
275
282
|
this.updateZoom(rerender);
|
|
276
283
|
}
|
|
@@ -293,7 +300,7 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
293
300
|
}, {
|
|
294
301
|
key: "setCameraPositionToCurrentDesignArea",
|
|
295
302
|
value: function () {
|
|
296
|
-
var _setCameraPositionToCurrentDesignArea = _asyncToGenerator(/*#__PURE__*/
|
|
303
|
+
var _setCameraPositionToCurrentDesignArea = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
297
304
|
var _ref5,
|
|
298
305
|
animate,
|
|
299
306
|
duration,
|
|
@@ -304,16 +311,16 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
304
311
|
viewOffset,
|
|
305
312
|
position,
|
|
306
313
|
_args2 = arguments;
|
|
307
|
-
return
|
|
308
|
-
while (1) switch (_context2.
|
|
314
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
315
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
309
316
|
case 0:
|
|
310
317
|
_ref5 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {
|
|
311
318
|
animate: false,
|
|
312
319
|
duration: {}
|
|
313
320
|
}, animate = _ref5.animate, duration = _ref5.duration, getViewOffset = _ref5.getViewOffset;
|
|
314
|
-
_context2.
|
|
321
|
+
_context2.next = 3;
|
|
315
322
|
return this.getScreenshotsReady();
|
|
316
|
-
case
|
|
323
|
+
case 3:
|
|
317
324
|
designArea = this._currentDesignArea || first(this._designAreaList);
|
|
318
325
|
obj = designArea && this.findAreaObjectByName(designArea.identifier);
|
|
319
326
|
zoom = this.calculateZoomForObject(obj);
|
|
@@ -329,8 +336,9 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
329
336
|
this.stopAnimation("camera");
|
|
330
337
|
this.setCameraPosition(position, zoom, viewOffset);
|
|
331
338
|
}
|
|
332
|
-
case
|
|
333
|
-
|
|
339
|
+
case 11:
|
|
340
|
+
case "end":
|
|
341
|
+
return _context2.stop();
|
|
334
342
|
}
|
|
335
343
|
}, _callee2, this);
|
|
336
344
|
}));
|
|
@@ -504,14 +512,14 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
504
512
|
}, {
|
|
505
513
|
key: "dispatchMaterialUpdateEvent",
|
|
506
514
|
value: function () {
|
|
507
|
-
var _dispatchMaterialUpdateEvent = _asyncToGenerator(/*#__PURE__*/
|
|
515
|
+
var _dispatchMaterialUpdateEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
508
516
|
var options,
|
|
509
517
|
_options$screenshot,
|
|
510
518
|
screenshot,
|
|
511
519
|
eventParams,
|
|
512
520
|
_args3 = arguments;
|
|
513
|
-
return
|
|
514
|
-
while (1) switch (_context3.
|
|
521
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
522
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
515
523
|
case 0:
|
|
516
524
|
options = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
517
525
|
_options$screenshot = options.screenshot, screenshot = _options$screenshot === void 0 ? false : _options$screenshot;
|
|
@@ -519,10 +527,11 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
519
527
|
variant: this._materialVariantPath,
|
|
520
528
|
screenshot: screenshot
|
|
521
529
|
}; // the redrawing of the areas can be synced if the event handler returns a Promise
|
|
522
|
-
_context3.
|
|
530
|
+
_context3.next = 5;
|
|
523
531
|
return this.observable.dispatch(EventTypes.MaterialUpdated, eventParams, true);
|
|
524
|
-
case
|
|
525
|
-
|
|
532
|
+
case 5:
|
|
533
|
+
case "end":
|
|
534
|
+
return _context3.stop();
|
|
526
535
|
}
|
|
527
536
|
}, _callee3, this);
|
|
528
537
|
}));
|
|
@@ -534,17 +543,20 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
534
543
|
}, {
|
|
535
544
|
key: "updateMaterial",
|
|
536
545
|
value: function () {
|
|
537
|
-
var _updateMaterial = _asyncToGenerator(/*#__PURE__*/
|
|
546
|
+
var _updateMaterial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
538
547
|
var targetObject,
|
|
539
548
|
_args4 = arguments;
|
|
540
|
-
return
|
|
541
|
-
while (1) switch (_context4.
|
|
549
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
550
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
542
551
|
case 0:
|
|
543
552
|
targetObject = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : this.scene;
|
|
544
|
-
_context4.
|
|
553
|
+
_context4.next = 3;
|
|
545
554
|
return this.updateView(this._currentDesignView);
|
|
546
|
-
case
|
|
547
|
-
return _context4.
|
|
555
|
+
case 3:
|
|
556
|
+
return _context4.abrupt("return", _context4.sent);
|
|
557
|
+
case 4:
|
|
558
|
+
case "end":
|
|
559
|
+
return _context4.stop();
|
|
548
560
|
}
|
|
549
561
|
}, _callee4, this);
|
|
550
562
|
}));
|
|
@@ -556,34 +568,34 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
556
568
|
}, {
|
|
557
569
|
key: "_getDrawingContext",
|
|
558
570
|
value: function () {
|
|
559
|
-
var _getDrawingContext2 = _asyncToGenerator(/*#__PURE__*/
|
|
571
|
+
var _getDrawingContext2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(drawingFn) {
|
|
560
572
|
var _this4 = this;
|
|
561
573
|
var updateAlpha,
|
|
562
574
|
clearTexture,
|
|
563
575
|
materialName,
|
|
564
576
|
availableDesignAreas,
|
|
565
577
|
_args6 = arguments;
|
|
566
|
-
return
|
|
567
|
-
while (1) switch (_context6.
|
|
578
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
579
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
568
580
|
case 0:
|
|
569
581
|
updateAlpha = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : false;
|
|
570
582
|
clearTexture = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : false;
|
|
571
583
|
materialName = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : undefined;
|
|
572
584
|
availableDesignAreas = get(this._currentDesignView, "designAreas") || [];
|
|
573
|
-
_context6.
|
|
574
|
-
return Promise.all(availableDesignAreas.map(/*#__PURE__*/function () {
|
|
575
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/
|
|
585
|
+
_context6.next = 6;
|
|
586
|
+
return Promise.all(availableDesignAreas.map( /*#__PURE__*/function () {
|
|
587
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(designArea) {
|
|
576
588
|
var material, _this4$getCanvasConte, ctx, canvas, texture, getTextureBuilder, width, height;
|
|
577
|
-
return
|
|
578
|
-
while (1) switch (_context5.
|
|
589
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
590
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
579
591
|
case 0:
|
|
580
592
|
material = _this4._materialMap.get(designArea.identifier);
|
|
581
593
|
if (!(!material || !material.map || !material.map.image)) {
|
|
582
|
-
_context5.
|
|
594
|
+
_context5.next = 3;
|
|
583
595
|
break;
|
|
584
596
|
}
|
|
585
597
|
throw new Error("Cannot get drawing context for material: ".concat(materialName, "! Is it prepared already?"));
|
|
586
|
-
case
|
|
598
|
+
case 3:
|
|
587
599
|
_this4$getCanvasConte = _this4.getCanvasContextForTexture(material.map), ctx = _this4$getCanvasConte.ctx, canvas = _this4$getCanvasConte.canvas, texture = _this4$getCanvasConte.texture;
|
|
588
600
|
getTextureBuilder = createTextureBuilder(canvas, {
|
|
589
601
|
currentZoom: _this4._screenshotCamera ? _this4._screenshotCamera.zoom : _this4.camera.zoom,
|
|
@@ -593,12 +605,13 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
593
605
|
width = canvas.width, height = canvas.height;
|
|
594
606
|
ctx.clearRect(0, 0, width, height);
|
|
595
607
|
}
|
|
596
|
-
_context5.
|
|
608
|
+
_context5.next = 8;
|
|
597
609
|
return drawingFn(ctx, getTextureBuilder, [designArea]);
|
|
598
|
-
case
|
|
610
|
+
case 8:
|
|
599
611
|
texture.needsUpdate = true;
|
|
600
|
-
case
|
|
601
|
-
|
|
612
|
+
case 9:
|
|
613
|
+
case "end":
|
|
614
|
+
return _context5.stop();
|
|
602
615
|
}
|
|
603
616
|
}, _callee5);
|
|
604
617
|
}));
|
|
@@ -606,12 +619,13 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
606
619
|
return _ref7.apply(this, arguments);
|
|
607
620
|
};
|
|
608
621
|
}()));
|
|
609
|
-
case
|
|
622
|
+
case 6:
|
|
610
623
|
if (!this.isAnimating()) {
|
|
611
624
|
this.render();
|
|
612
625
|
}
|
|
613
|
-
case
|
|
614
|
-
|
|
626
|
+
case 7:
|
|
627
|
+
case "end":
|
|
628
|
+
return _context6.stop();
|
|
615
629
|
}
|
|
616
630
|
}, _callee6, this);
|
|
617
631
|
}));
|
|
@@ -623,58 +637,58 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
623
637
|
}, {
|
|
624
638
|
key: "getDrawingContext",
|
|
625
639
|
value: function () {
|
|
626
|
-
var _getDrawingContext3 = _asyncToGenerator(/*#__PURE__*/
|
|
640
|
+
var _getDrawingContext3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
627
641
|
var _this$_getDrawingCont,
|
|
628
642
|
_this5 = this;
|
|
629
|
-
var _args8 = arguments
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
while (1) switch (_context8.p = _context8.n) {
|
|
643
|
+
var _args8 = arguments;
|
|
644
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
645
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
633
646
|
case 0:
|
|
634
647
|
this._redraw = (_this$_getDrawingCont = this._getDrawingContext).bind.apply(_this$_getDrawingCont, [this].concat(Array.prototype.slice.call(_args8)));
|
|
635
|
-
_context8.
|
|
636
|
-
_context8.
|
|
648
|
+
_context8.prev = 1;
|
|
649
|
+
_context8.next = 4;
|
|
637
650
|
return this._redrawPromise;
|
|
638
|
-
case 2:
|
|
639
|
-
_context8.n = 4;
|
|
640
|
-
break;
|
|
641
|
-
case 3:
|
|
642
|
-
_context8.p = 3;
|
|
643
|
-
_t3 = _context8.v;
|
|
644
651
|
case 4:
|
|
652
|
+
_context8.next = 8;
|
|
653
|
+
break;
|
|
654
|
+
case 6:
|
|
655
|
+
_context8.prev = 6;
|
|
656
|
+
_context8.t0 = _context8["catch"](1);
|
|
657
|
+
case 8:
|
|
645
658
|
this._redrawPromise = new Promise(function (resolve, reject) {
|
|
646
|
-
_this5._redrawFrame = window.requestAnimationFrame(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
while (1) switch (_context7.p = _context7.n) {
|
|
659
|
+
_this5._redrawFrame = window.requestAnimationFrame( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
660
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
661
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
650
662
|
case 0:
|
|
651
|
-
_context7.
|
|
652
|
-
_context7.
|
|
663
|
+
_context7.prev = 0;
|
|
664
|
+
_context7.next = 3;
|
|
653
665
|
return _this5.redraw();
|
|
654
|
-
case
|
|
666
|
+
case 3:
|
|
655
667
|
resolve();
|
|
656
|
-
_context7.
|
|
668
|
+
_context7.next = 9;
|
|
657
669
|
break;
|
|
658
|
-
case
|
|
659
|
-
_context7.
|
|
660
|
-
|
|
661
|
-
reject(
|
|
662
|
-
case
|
|
663
|
-
_context7.
|
|
670
|
+
case 6:
|
|
671
|
+
_context7.prev = 6;
|
|
672
|
+
_context7.t0 = _context7["catch"](0);
|
|
673
|
+
reject(_context7.t0);
|
|
674
|
+
case 9:
|
|
675
|
+
_context7.prev = 9;
|
|
664
676
|
delete _this5._redrawPromise;
|
|
665
|
-
return _context7.
|
|
666
|
-
case
|
|
667
|
-
|
|
677
|
+
return _context7.finish(9);
|
|
678
|
+
case 12:
|
|
679
|
+
case "end":
|
|
680
|
+
return _context7.stop();
|
|
668
681
|
}
|
|
669
|
-
}, _callee7, null, [[0,
|
|
682
|
+
}, _callee7, null, [[0, 6, 9, 12]]);
|
|
670
683
|
})));
|
|
671
684
|
});
|
|
672
|
-
_context8.
|
|
685
|
+
_context8.next = 11;
|
|
673
686
|
return this._redrawPromise;
|
|
674
|
-
case
|
|
675
|
-
|
|
687
|
+
case 11:
|
|
688
|
+
case "end":
|
|
689
|
+
return _context8.stop();
|
|
676
690
|
}
|
|
677
|
-
}, _callee8, this, [[1,
|
|
691
|
+
}, _callee8, this, [[1, 6]]);
|
|
678
692
|
}));
|
|
679
693
|
function getDrawingContext() {
|
|
680
694
|
return _getDrawingContext3.apply(this, arguments);
|
|
@@ -727,28 +741,28 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
727
741
|
}, {
|
|
728
742
|
key: "loadView",
|
|
729
743
|
value: function () {
|
|
730
|
-
var _loadView = _asyncToGenerator(/*#__PURE__*/
|
|
744
|
+
var _loadView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
731
745
|
var rerender,
|
|
732
746
|
url,
|
|
733
747
|
image,
|
|
734
748
|
tex,
|
|
735
749
|
_args9 = arguments;
|
|
736
|
-
return
|
|
737
|
-
while (1) switch (_context9.
|
|
750
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
751
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
738
752
|
case 0:
|
|
739
753
|
rerender = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
740
754
|
if (this._itemPath && this._viewPath) {
|
|
741
|
-
_context9.
|
|
755
|
+
_context9.next = 3;
|
|
742
756
|
break;
|
|
743
757
|
}
|
|
744
|
-
return _context9.
|
|
745
|
-
case
|
|
758
|
+
return _context9.abrupt("return", false);
|
|
759
|
+
case 3:
|
|
746
760
|
url = this.getModelPath();
|
|
747
761
|
this.onLoadStart();
|
|
748
|
-
_context9.
|
|
762
|
+
_context9.next = 7;
|
|
749
763
|
return this._imageRepository.loadImage(url);
|
|
750
|
-
case
|
|
751
|
-
image = _context9.
|
|
764
|
+
case 7:
|
|
765
|
+
image = _context9.sent;
|
|
752
766
|
this.onLoadFinished();
|
|
753
767
|
tex = new Texture(this._options.optimizeProductImage ? optimizeTextureImage(image, MAX_TEXTURE_SIZE, MIN_TEXTURE_SIZE) : image);
|
|
754
768
|
tex.premultiplyAlpha = this._options.premultiplyAlpha;
|
|
@@ -761,8 +775,9 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
761
775
|
if (rerender) {
|
|
762
776
|
this.render();
|
|
763
777
|
}
|
|
764
|
-
case
|
|
765
|
-
|
|
778
|
+
case 16:
|
|
779
|
+
case "end":
|
|
780
|
+
return _context9.stop();
|
|
766
781
|
}
|
|
767
782
|
}, _callee9, this);
|
|
768
783
|
}));
|
|
@@ -973,19 +988,22 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
973
988
|
}, {
|
|
974
989
|
key: "updateViewForArea",
|
|
975
990
|
value: function () {
|
|
976
|
-
var _updateViewForArea = _asyncToGenerator(/*#__PURE__*/
|
|
991
|
+
var _updateViewForArea = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee0(selectedDesignArea) {
|
|
977
992
|
var options,
|
|
978
993
|
designView,
|
|
979
994
|
_args0 = arguments;
|
|
980
|
-
return
|
|
981
|
-
while (1) switch (_context0.
|
|
995
|
+
return _regeneratorRuntime().wrap(function _callee0$(_context0) {
|
|
996
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
982
997
|
case 0:
|
|
983
998
|
options = _args0.length > 1 && _args0[1] !== undefined ? _args0[1] : {};
|
|
984
999
|
designView = get(selectedDesignArea, "designView");
|
|
985
|
-
_context0.
|
|
1000
|
+
_context0.next = 4;
|
|
986
1001
|
return this.updateView(designView, options);
|
|
987
|
-
case
|
|
988
|
-
return _context0.
|
|
1002
|
+
case 4:
|
|
1003
|
+
return _context0.abrupt("return", _context0.sent);
|
|
1004
|
+
case 5:
|
|
1005
|
+
case "end":
|
|
1006
|
+
return _context0.stop();
|
|
989
1007
|
}
|
|
990
1008
|
}, _callee0, this);
|
|
991
1009
|
}));
|
|
@@ -1029,8 +1047,8 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1029
1047
|
*/
|
|
1030
1048
|
}, {
|
|
1031
1049
|
key: "jumpToArea",
|
|
1032
|
-
value:
|
|
1033
|
-
var _jumpToArea = _asyncToGenerator(/*#__PURE__*/
|
|
1050
|
+
value: function () {
|
|
1051
|
+
var _jumpToArea = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee1(designAreaIdentifier) {
|
|
1034
1052
|
var animate,
|
|
1035
1053
|
duration,
|
|
1036
1054
|
forceUpdate,
|
|
@@ -1039,8 +1057,8 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1039
1057
|
zoom,
|
|
1040
1058
|
position,
|
|
1041
1059
|
_args1 = arguments;
|
|
1042
|
-
return
|
|
1043
|
-
while (1) switch (_context1.
|
|
1060
|
+
return _regeneratorRuntime().wrap(function _callee1$(_context1) {
|
|
1061
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1044
1062
|
case 0:
|
|
1045
1063
|
animate = _args1.length > 1 && _args1[1] !== undefined ? _args1[1] : true;
|
|
1046
1064
|
duration = _args1.length > 2 && _args1[2] !== undefined ? _args1[2] : {};
|
|
@@ -1048,24 +1066,24 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1048
1066
|
// use the current design area if present, otherwise try to find it by the designViewIdentifier
|
|
1049
1067
|
designArea = size(this._currentDesignArea) > 0 ? this._currentDesignArea : this.findDesignArea(designAreaIdentifier);
|
|
1050
1068
|
if (!(designAreaIdentifier !== "default")) {
|
|
1051
|
-
_context1.
|
|
1069
|
+
_context1.next = 8;
|
|
1052
1070
|
break;
|
|
1053
1071
|
}
|
|
1054
|
-
_context1.
|
|
1072
|
+
_context1.next = 7;
|
|
1055
1073
|
return this.updateViewForArea(designArea, {
|
|
1056
1074
|
forceUpdate: forceUpdate
|
|
1057
1075
|
});
|
|
1058
|
-
case
|
|
1076
|
+
case 7:
|
|
1059
1077
|
this.render();
|
|
1060
|
-
case
|
|
1078
|
+
case 8:
|
|
1061
1079
|
if (this._containerGroup) {
|
|
1062
|
-
_context1.
|
|
1080
|
+
_context1.next = 11;
|
|
1063
1081
|
break;
|
|
1064
1082
|
}
|
|
1065
1083
|
// eslint-disable-next-line no-console
|
|
1066
1084
|
console.log("Container group is not available, skipping jump to view!");
|
|
1067
|
-
return _context1.
|
|
1068
|
-
case
|
|
1085
|
+
return _context1.abrupt("return", false);
|
|
1086
|
+
case 11:
|
|
1069
1087
|
obj = designArea && this.findAreaObjectByName(designArea.identifier);
|
|
1070
1088
|
zoom = this.calculateZoomForObject(obj);
|
|
1071
1089
|
position = new Vector3();
|
|
@@ -1078,7 +1096,10 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1078
1096
|
} else {
|
|
1079
1097
|
this.setCameraPosition(position, zoom);
|
|
1080
1098
|
}
|
|
1081
|
-
return _context1.
|
|
1099
|
+
return _context1.abrupt("return", true);
|
|
1100
|
+
case 18:
|
|
1101
|
+
case "end":
|
|
1102
|
+
return _context1.stop();
|
|
1082
1103
|
}
|
|
1083
1104
|
}, _callee1, this);
|
|
1084
1105
|
}));
|
|
@@ -1092,27 +1113,29 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1092
1113
|
* @param {object} designView The design view object
|
|
1093
1114
|
* @return {boolean} False if the operation is not possible, otherwise true
|
|
1094
1115
|
*/
|
|
1095
|
-
)
|
|
1096
1116
|
}, {
|
|
1097
1117
|
key: "setView",
|
|
1098
|
-
value:
|
|
1099
|
-
var _setView = _asyncToGenerator(/*#__PURE__*/
|
|
1100
|
-
return
|
|
1101
|
-
while (1) switch (_context10.
|
|
1118
|
+
value: function () {
|
|
1119
|
+
var _setView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(designView) {
|
|
1120
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1121
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1102
1122
|
case 0:
|
|
1103
|
-
_context10.
|
|
1123
|
+
_context10.next = 2;
|
|
1104
1124
|
return this.updateView(designView);
|
|
1105
|
-
case
|
|
1125
|
+
case 2:
|
|
1106
1126
|
if (this._containerGroup) {
|
|
1107
|
-
_context10.
|
|
1127
|
+
_context10.next = 5;
|
|
1108
1128
|
break;
|
|
1109
1129
|
}
|
|
1110
1130
|
// eslint-disable-next-line no-console
|
|
1111
1131
|
console.log("Container group is not available, skipping jump to view!");
|
|
1112
|
-
return _context10.
|
|
1113
|
-
case
|
|
1132
|
+
return _context10.abrupt("return", false);
|
|
1133
|
+
case 5:
|
|
1114
1134
|
this.render();
|
|
1115
|
-
return _context10.
|
|
1135
|
+
return _context10.abrupt("return", true);
|
|
1136
|
+
case 7:
|
|
1137
|
+
case "end":
|
|
1138
|
+
return _context10.stop();
|
|
1116
1139
|
}
|
|
1117
1140
|
}, _callee10, this);
|
|
1118
1141
|
}));
|
|
@@ -1120,7 +1143,7 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1120
1143
|
return _setView.apply(this, arguments);
|
|
1121
1144
|
}
|
|
1122
1145
|
return setView;
|
|
1123
|
-
}()
|
|
1146
|
+
}()
|
|
1124
1147
|
}, {
|
|
1125
1148
|
key: "updateMaxZoomSetting",
|
|
1126
1149
|
value: function updateMaxZoomSetting(maxZoom) {
|
|
@@ -1145,18 +1168,18 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1145
1168
|
}, {
|
|
1146
1169
|
key: "updateDesignAreaList",
|
|
1147
1170
|
value: function () {
|
|
1148
|
-
var _updateDesignAreaList = _asyncToGenerator(/*#__PURE__*/
|
|
1171
|
+
var _updateDesignAreaList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(designAreaList) {
|
|
1149
1172
|
var updateView,
|
|
1150
1173
|
identifier,
|
|
1151
1174
|
activeArea,
|
|
1152
1175
|
_args11 = arguments;
|
|
1153
|
-
return
|
|
1154
|
-
while (1) switch (_context11.
|
|
1176
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1177
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1155
1178
|
case 0:
|
|
1156
1179
|
updateView = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : false;
|
|
1157
1180
|
this._designAreaList = designAreaList;
|
|
1158
1181
|
if (!updateView) {
|
|
1159
|
-
_context11.
|
|
1182
|
+
_context11.next = 9;
|
|
1160
1183
|
break;
|
|
1161
1184
|
}
|
|
1162
1185
|
identifier = this._currentDesignArea && this._currentDesignArea.identifier;
|
|
@@ -1164,16 +1187,17 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1164
1187
|
identifier: identifier
|
|
1165
1188
|
}) || first(designAreaList);
|
|
1166
1189
|
if (!activeArea) {
|
|
1167
|
-
_context11.
|
|
1190
|
+
_context11.next = 9;
|
|
1168
1191
|
break;
|
|
1169
1192
|
}
|
|
1170
|
-
_context11.
|
|
1193
|
+
_context11.next = 8;
|
|
1171
1194
|
return this.updateViewForArea(activeArea);
|
|
1172
|
-
case
|
|
1195
|
+
case 8:
|
|
1173
1196
|
// update the zoom to the initial value only if there is no designArea selected
|
|
1174
1197
|
!identifier && this.updateZoom();
|
|
1175
|
-
case
|
|
1176
|
-
|
|
1198
|
+
case 9:
|
|
1199
|
+
case "end":
|
|
1200
|
+
return _context11.stop();
|
|
1177
1201
|
}
|
|
1178
1202
|
}, _callee11, this);
|
|
1179
1203
|
}));
|
|
@@ -1202,7 +1226,7 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1202
1226
|
}, {
|
|
1203
1227
|
key: "getScreenshots",
|
|
1204
1228
|
value: function () {
|
|
1205
|
-
var _getScreenshots = _asyncToGenerator(/*#__PURE__*/
|
|
1229
|
+
var _getScreenshots = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(callback) {
|
|
1206
1230
|
var _this9 = this;
|
|
1207
1231
|
var _ref0,
|
|
1208
1232
|
designViewList,
|
|
@@ -1224,27 +1248,26 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1224
1248
|
_step,
|
|
1225
1249
|
_loop,
|
|
1226
1250
|
_ret,
|
|
1227
|
-
_args16 = arguments
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
while (1) switch (_context16.p = _context16.n) {
|
|
1251
|
+
_args16 = arguments;
|
|
1252
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context16) {
|
|
1253
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1231
1254
|
case 0:
|
|
1232
1255
|
_ref0 = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {}, designViewList = _ref0.designViewList, areaList = _ref0.areaList, variantList = _ref0.variantList, size = _ref0.size;
|
|
1233
1256
|
if (this.renderer) {
|
|
1234
|
-
_context16.
|
|
1257
|
+
_context16.next = 3;
|
|
1235
1258
|
break;
|
|
1236
1259
|
}
|
|
1237
|
-
return _context16.
|
|
1238
|
-
case
|
|
1260
|
+
return _context16.abrupt("return", callback({}));
|
|
1261
|
+
case 3:
|
|
1239
1262
|
this._screenshottingInProgress = true;
|
|
1240
1263
|
this.endAnimation();
|
|
1241
|
-
_context16.
|
|
1264
|
+
_context16.next = 7;
|
|
1242
1265
|
return this.animationRunning();
|
|
1243
|
-
case
|
|
1244
|
-
_context16.
|
|
1266
|
+
case 7:
|
|
1267
|
+
_context16.next = 9;
|
|
1245
1268
|
return this.createTempOverlay();
|
|
1246
|
-
case
|
|
1247
|
-
removeTempOverlay = _context16.
|
|
1269
|
+
case 9:
|
|
1270
|
+
removeTempOverlay = _context16.sent;
|
|
1248
1271
|
origDesignView = this._currentDesignView; // if the areaList option is provided, use it to filter the design areas
|
|
1249
1272
|
designAreaList = areaList instanceof Array && areaList.length > 0 ? this._designAreaList.filter(function (designArea) {
|
|
1250
1273
|
return areaList.indexOf(designArea.identifier) !== -1;
|
|
@@ -1256,23 +1279,24 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1256
1279
|
this.renderer.getSize(origSize);
|
|
1257
1280
|
origPixelRatio = this.renderer.getPixelRatio();
|
|
1258
1281
|
restoreOriginalValues = /*#__PURE__*/function () {
|
|
1259
|
-
var _ref1 = _asyncToGenerator(/*#__PURE__*/
|
|
1260
|
-
return
|
|
1261
|
-
while (1) switch (_context12.
|
|
1282
|
+
var _ref1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
1283
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1284
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1262
1285
|
case 0:
|
|
1263
1286
|
_this9._screenshotCamera = null;
|
|
1264
1287
|
_this9._screenshottingInProgress = false;
|
|
1265
1288
|
_this9._materialVariantPath = origVariantPath;
|
|
1266
1289
|
_this9._currentDesignView = null;
|
|
1267
|
-
_context12.
|
|
1290
|
+
_context12.next = 6;
|
|
1268
1291
|
return _this9.setView(origDesignView);
|
|
1269
|
-
case
|
|
1292
|
+
case 6:
|
|
1270
1293
|
_this9.renderer.setSize(origSize.width, origSize.height);
|
|
1271
1294
|
_this9.renderer.setPixelRatio(origPixelRatio);
|
|
1272
1295
|
_this9.render();
|
|
1273
1296
|
removeTempOverlay();
|
|
1274
|
-
case
|
|
1275
|
-
|
|
1297
|
+
case 10:
|
|
1298
|
+
case "end":
|
|
1299
|
+
return _context12.stop();
|
|
1276
1300
|
}
|
|
1277
1301
|
}, _callee12);
|
|
1278
1302
|
}));
|
|
@@ -1287,53 +1311,53 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1287
1311
|
return designView;
|
|
1288
1312
|
});
|
|
1289
1313
|
_iterator = _createForOfIteratorHelper(variants);
|
|
1290
|
-
_context16.
|
|
1291
|
-
_loop = /*#__PURE__*/
|
|
1292
|
-
var variant, data, _iterator2, _step2, _loop2, _ret2
|
|
1293
|
-
return
|
|
1294
|
-
while (1) switch (_context15.
|
|
1314
|
+
_context16.prev = 23;
|
|
1315
|
+
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
|
1316
|
+
var variant, data, _iterator2, _step2, _loop2, _ret2;
|
|
1317
|
+
return _regeneratorRuntime().wrap(function _loop$(_context15) {
|
|
1318
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1295
1319
|
case 0:
|
|
1296
1320
|
variant = _step.value;
|
|
1297
1321
|
data = {};
|
|
1298
1322
|
_this9.setMaterialVariantPath(variant);
|
|
1299
1323
|
_this9._currentDesignView = null;
|
|
1300
1324
|
_iterator2 = _createForOfIteratorHelper(views);
|
|
1301
|
-
_context15.
|
|
1302
|
-
_loop2 = /*#__PURE__*/
|
|
1303
|
-
var view
|
|
1304
|
-
return
|
|
1305
|
-
while (1) switch (_context14.
|
|
1325
|
+
_context15.prev = 5;
|
|
1326
|
+
_loop2 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop2() {
|
|
1327
|
+
var view;
|
|
1328
|
+
return _regeneratorRuntime().wrap(function _loop2$(_context14) {
|
|
1329
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1306
1330
|
case 0:
|
|
1307
1331
|
view = _step2.value;
|
|
1308
1332
|
if (!_this9._abortScreenshotting) {
|
|
1309
|
-
_context14.
|
|
1333
|
+
_context14.next = 7;
|
|
1310
1334
|
break;
|
|
1311
1335
|
}
|
|
1312
|
-
_context14.
|
|
1336
|
+
_context14.next = 4;
|
|
1313
1337
|
return restoreOriginalValues();
|
|
1314
|
-
case
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
v:
|
|
1338
|
+
case 4:
|
|
1339
|
+
_context14.t0 = _context14.sent;
|
|
1340
|
+
_context14.t1 = {
|
|
1341
|
+
v: _context14.t0
|
|
1318
1342
|
};
|
|
1319
|
-
return _context14.
|
|
1320
|
-
v:
|
|
1343
|
+
return _context14.abrupt("return", {
|
|
1344
|
+
v: _context14.t1
|
|
1321
1345
|
});
|
|
1322
|
-
case
|
|
1323
|
-
_context14.
|
|
1324
|
-
_context14.
|
|
1346
|
+
case 7:
|
|
1347
|
+
_context14.prev = 7;
|
|
1348
|
+
_context14.next = 10;
|
|
1325
1349
|
return new Promise(function (resolve) {
|
|
1326
|
-
window.setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
1350
|
+
window.setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
1327
1351
|
var _this9$getScreenshotS, width, height;
|
|
1328
|
-
return
|
|
1329
|
-
while (1) switch (_context13.
|
|
1352
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1353
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1330
1354
|
case 0:
|
|
1331
|
-
_context13.
|
|
1355
|
+
_context13.next = 2;
|
|
1332
1356
|
return _this9.updateView(view, {
|
|
1333
1357
|
forceUpdate: false,
|
|
1334
1358
|
updateMaterial: false
|
|
1335
1359
|
});
|
|
1336
|
-
case
|
|
1360
|
+
case 2:
|
|
1337
1361
|
_this9$getScreenshotS = _this9.getScreenshotSize(size), width = _this9$getScreenshotS.width, height = _this9$getScreenshotS.height;
|
|
1338
1362
|
setOrthographicCameraSize(camera, width, height);
|
|
1339
1363
|
_this9.renderer.setSize(width, height);
|
|
@@ -1343,106 +1367,110 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1343
1367
|
height: height
|
|
1344
1368
|
});
|
|
1345
1369
|
camera.updateProjectionMatrix();
|
|
1346
|
-
_context13.
|
|
1370
|
+
_context13.next = 10;
|
|
1347
1371
|
return _this9.dispatchMaterialUpdateEvent({
|
|
1348
1372
|
screenshot: true
|
|
1349
1373
|
});
|
|
1350
|
-
case
|
|
1374
|
+
case 10:
|
|
1351
1375
|
// set size and pixel ratio right before rendering, to make sure they are correct
|
|
1352
1376
|
_this9.renderer.setSize(width, height);
|
|
1353
1377
|
_this9.renderer.setPixelRatio(1);
|
|
1354
1378
|
_this9.renderer.render(_this9.scene, camera);
|
|
1355
1379
|
data[view.identifier] = _this9.renderer.domElement.toDataURL();
|
|
1356
1380
|
resolve();
|
|
1357
|
-
case
|
|
1358
|
-
|
|
1381
|
+
case 15:
|
|
1382
|
+
case "end":
|
|
1383
|
+
return _context13.stop();
|
|
1359
1384
|
}
|
|
1360
1385
|
}, _callee13);
|
|
1361
1386
|
})));
|
|
1362
1387
|
});
|
|
1363
|
-
case
|
|
1364
|
-
_context14.
|
|
1388
|
+
case 10:
|
|
1389
|
+
_context14.next = 14;
|
|
1365
1390
|
break;
|
|
1366
|
-
case
|
|
1367
|
-
_context14.
|
|
1368
|
-
|
|
1369
|
-
case
|
|
1370
|
-
|
|
1391
|
+
case 12:
|
|
1392
|
+
_context14.prev = 12;
|
|
1393
|
+
_context14.t2 = _context14["catch"](7);
|
|
1394
|
+
case 14:
|
|
1395
|
+
case "end":
|
|
1396
|
+
return _context14.stop();
|
|
1371
1397
|
}
|
|
1372
|
-
}, _loop2, null, [[
|
|
1398
|
+
}, _loop2, null, [[7, 12]]);
|
|
1373
1399
|
});
|
|
1374
1400
|
_iterator2.s();
|
|
1375
|
-
case
|
|
1401
|
+
case 8:
|
|
1376
1402
|
if ((_step2 = _iterator2.n()).done) {
|
|
1377
|
-
_context15.
|
|
1403
|
+
_context15.next = 15;
|
|
1378
1404
|
break;
|
|
1379
1405
|
}
|
|
1380
|
-
return _context15.
|
|
1381
|
-
case
|
|
1382
|
-
_ret2 = _context15.
|
|
1406
|
+
return _context15.delegateYield(_loop2(), "t0", 10);
|
|
1407
|
+
case 10:
|
|
1408
|
+
_ret2 = _context15.t0;
|
|
1383
1409
|
if (!_ret2) {
|
|
1384
|
-
_context15.
|
|
1410
|
+
_context15.next = 13;
|
|
1385
1411
|
break;
|
|
1386
1412
|
}
|
|
1387
|
-
return _context15.
|
|
1388
|
-
case
|
|
1389
|
-
_context15.
|
|
1413
|
+
return _context15.abrupt("return", _ret2.v);
|
|
1414
|
+
case 13:
|
|
1415
|
+
_context15.next = 8;
|
|
1390
1416
|
break;
|
|
1391
|
-
case
|
|
1392
|
-
_context15.
|
|
1417
|
+
case 15:
|
|
1418
|
+
_context15.next = 20;
|
|
1393
1419
|
break;
|
|
1394
|
-
case
|
|
1395
|
-
_context15.
|
|
1396
|
-
|
|
1397
|
-
_iterator2.e(
|
|
1398
|
-
case
|
|
1399
|
-
_context15.
|
|
1420
|
+
case 17:
|
|
1421
|
+
_context15.prev = 17;
|
|
1422
|
+
_context15.t1 = _context15["catch"](5);
|
|
1423
|
+
_iterator2.e(_context15.t1);
|
|
1424
|
+
case 20:
|
|
1425
|
+
_context15.prev = 20;
|
|
1400
1426
|
_iterator2.f();
|
|
1401
|
-
return _context15.
|
|
1402
|
-
case
|
|
1427
|
+
return _context15.finish(20);
|
|
1428
|
+
case 23:
|
|
1403
1429
|
screenshots[variant] = data;
|
|
1404
|
-
case
|
|
1405
|
-
|
|
1430
|
+
case 24:
|
|
1431
|
+
case "end":
|
|
1432
|
+
return _context15.stop();
|
|
1406
1433
|
}
|
|
1407
|
-
}, _loop, null, [[
|
|
1434
|
+
}, _loop, null, [[5, 17, 20, 23]]);
|
|
1408
1435
|
});
|
|
1409
1436
|
_iterator.s();
|
|
1410
|
-
case
|
|
1437
|
+
case 26:
|
|
1411
1438
|
if ((_step = _iterator.n()).done) {
|
|
1412
|
-
_context16.
|
|
1439
|
+
_context16.next = 33;
|
|
1413
1440
|
break;
|
|
1414
1441
|
}
|
|
1415
|
-
return _context16.
|
|
1416
|
-
case
|
|
1417
|
-
_ret = _context16.
|
|
1442
|
+
return _context16.delegateYield(_loop(), "t0", 28);
|
|
1443
|
+
case 28:
|
|
1444
|
+
_ret = _context16.t0;
|
|
1418
1445
|
if (!_ret) {
|
|
1419
|
-
_context16.
|
|
1446
|
+
_context16.next = 31;
|
|
1420
1447
|
break;
|
|
1421
1448
|
}
|
|
1422
|
-
return _context16.
|
|
1423
|
-
case
|
|
1424
|
-
_context16.
|
|
1449
|
+
return _context16.abrupt("return", _ret.v);
|
|
1450
|
+
case 31:
|
|
1451
|
+
_context16.next = 26;
|
|
1425
1452
|
break;
|
|
1426
|
-
case
|
|
1427
|
-
_context16.
|
|
1453
|
+
case 33:
|
|
1454
|
+
_context16.next = 38;
|
|
1428
1455
|
break;
|
|
1429
|
-
case
|
|
1430
|
-
_context16.
|
|
1431
|
-
|
|
1432
|
-
_iterator.e(
|
|
1433
|
-
case
|
|
1434
|
-
_context16.
|
|
1456
|
+
case 35:
|
|
1457
|
+
_context16.prev = 35;
|
|
1458
|
+
_context16.t1 = _context16["catch"](23);
|
|
1459
|
+
_iterator.e(_context16.t1);
|
|
1460
|
+
case 38:
|
|
1461
|
+
_context16.prev = 38;
|
|
1435
1462
|
_iterator.f();
|
|
1436
|
-
return _context16.
|
|
1437
|
-
case
|
|
1438
|
-
_context16.
|
|
1463
|
+
return _context16.finish(38);
|
|
1464
|
+
case 41:
|
|
1465
|
+
_context16.next = 43;
|
|
1439
1466
|
return restoreOriginalValues();
|
|
1440
|
-
case
|
|
1467
|
+
case 43:
|
|
1441
1468
|
callback(screenshots);
|
|
1442
|
-
case
|
|
1443
|
-
|
|
1469
|
+
case 44:
|
|
1470
|
+
case "end":
|
|
1471
|
+
return _context16.stop();
|
|
1444
1472
|
}
|
|
1445
|
-
}, _callee14, this, [[
|
|
1473
|
+
}, _callee14, this, [[23, 35, 38, 41]]);
|
|
1446
1474
|
}));
|
|
1447
1475
|
function getScreenshots(_x8) {
|
|
1448
1476
|
return _getScreenshots.apply(this, arguments);
|
|
@@ -1500,9 +1528,10 @@ export var Three2D = /*#__PURE__*/function (_ThreeBase) {
|
|
|
1500
1528
|
this._containerGroup = null;
|
|
1501
1529
|
this._redraw = null;
|
|
1502
1530
|
this._materialMap.clear();
|
|
1503
|
-
|
|
1531
|
+
_get(_getPrototypeOf(Three2D.prototype), "dispose", this).call(this);
|
|
1504
1532
|
}
|
|
1505
1533
|
}]);
|
|
1534
|
+
return Three2D;
|
|
1506
1535
|
}(ThreeBase);
|
|
1507
1536
|
var createGridGeometryBuffer = function createGridGeometryBuffer(_ref12) {
|
|
1508
1537
|
var width = _ref12.width,
|
|
@@ -1556,6 +1585,7 @@ var createGridGeometryBuffer = function createGridGeometryBuffer(_ref12) {
|
|
|
1556
1585
|
indices.push(d, c, b); // face two
|
|
1557
1586
|
}
|
|
1558
1587
|
}
|
|
1588
|
+
|
|
1559
1589
|
var geometry = new BufferGeometry();
|
|
1560
1590
|
geometry.setIndex(indices);
|
|
1561
1591
|
geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
|